Back to skill

Security audit

codex-cli-exec

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only skill for using Codex CLI with Openclaw, with expected but important guidance around credentials and automation settings.

Install only if you intend Openclaw to invoke Codex CLI for coding tasks. Prefer dedicated workspaces, avoid broad `--add-dir` use, use `Allow once` or explicit approvals when unsure, and be careful with API keys and `--full-auto` because those settings can spend account quota and modify files in the allowed workspace.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (16)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 21)May include surrounding context.

codex --version codex login codex login --device-auth codex exec ""

text

Mention `codex "<prompt>"` only when the user explicitly wants a human-driven interactive session.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
96% confidence
Finding

The skill instructs users to pipe the value of OPENAI_API_KEY directly into a login command. While this is a common shell pattern, it normalizes handling a secret on the command line boundary and may expose the credential through shell history substitutes, wrapper tooling, logging, or accidental output capture in automated environments. In a skill specifically about non-interactive automation, this increases the chance the pattern is copied into CI or agent logs.

Content

Scanner excerpt · SKILL.md (reported line 57)May include surrounding context.

text

```bash
printenv OPENAI_API_KEY | codex login --with-api-key
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 106)May include surrounding context.

Examples:

bash
codex exec --cd /path/to/workspace "<prompt>"
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 110)May include surrounding context.

text

```bash
codex exec --cd /path/to/app --add-dir /path/to/shared "<prompt>"

Git Repository Check

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 122)May include surrounding context.

Example:

bash
codex exec --skip-git-repo-check "<prompt>"

Trust and Approvals

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 170)May include surrounding context.

Example:

bash
codex exec --skip-git-repo-check "<prompt>"

Trust and Approvals

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 162)May include surrounding context.

Examples:

bash
codex exec -a on-request -s workspace-write "<prompt>"
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 166)May include surrounding context.

text

```bash
codex exec --full-auto "<prompt>"
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 185)May include surrounding context.

Examples:

bash
codex exec --json "<prompt>"
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 189)May include surrounding context.

text

```bash
codex exec -i screenshot.png "Match this UI design."
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 193)May include surrounding context.

text

```bash
codex exec -m gpt-5.4 "<prompt>"

Prompt Examples

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 201)May include surrounding context.

Use short examples like these:

bash
codex exec "Add a README section for local development."
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

text

```bash
codex exec "Implement a login retry feature with exponential backoff in the Openclaw client."
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 209)May include surrounding context.

text

```bash
codex exec "Write a Python script that reads a CSV file and outputs a JSON summary by category."
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 213)May include surrounding context.

text

```bash
codex exec "Modify the file upload endpoint to reject files larger than 10 MB and add a test for it."
bash

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 217)May include surrounding context.

text

```bash
codex exec --json "List all API endpoints in this workspace."

If the user explicitly wants an interactive chat, use: