openai / openai/codex

Codex documentation and model-facing instructions recommend unsafe prefix rules as examples of safe ones

Open
#39,085 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI documentation sandbox
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

What is the type of issue?

Documentation is incorrect

What is the issue?

The Codex auto-review documentation recommends,

Add narrowly scoped prefix rules. Prefer precise command prefixes such as ["cargo", "test"] or ["pnpm", "run", "lint"] over broad patterns such as ["python"] or ["curl"].

cargo test is not in any meaningful sense safer or more narrowly-scoped than python if the agent has write access to the workspace. Rust test suites may execute arbitrary code. Assuming a default :workspace-write permission setting, the agent can put whatever it wants into the test suite without requiring escalation. cargo test will execute that suite.

The same bad recommendation appears in the model-facing escalation-request instructions which provide guidance on what prefix rule to suggest for a persistent approval. They mention ["npm", "run", "dev"] and ["cargo", "test"] as good examples.

A similar error is present in the OpenAI-authored code-change-verification skill which tells the agent to ask for a persistent prefix-rule authorization that executes a repository-owned shell script, and in the curated cloudflare-deploy skill which suggests an ["npm", "run", "deploy"] escalation.

Where did you find it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the auto-review documentation with codex-rs/prompts/templates/permissions/approval_policy/on_request.md, then inspect the referenced SKILL.md files in openai-agents-python and openai/skills. Trace how each prefix-rule example is presented and update the affected documentation and model-facing guidance so the examples do not imply repository-owned commands are inherently safe. Done means the identified sources consistently describe the relevant safety limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, python, rust
Domain
documentation, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.