codex_run
Run the Codex coding agent non-interactively to handle tasks like code reviews, edits, and diagnostics with custom prompts, sandbox policies, and CLI controls.
Instructions
Run the Codex agent non-interactively (codex exec) with common CLI controls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cd | No | Directory codex should treat as its working root (--cd). | |
| cwd | No | Working directory for the codex process. | |
| env | No | Additional environment variables for codex. | |
| model | No | Model the agent should use. May be forced by the server's model-override environment variable. | |
| images | No | Image file paths to attach to the prompt. | |
| prompt | Yes | Task for the Codex agent. | |
| addDirs | No | Additional directories to expose to the agent (--add-dir). | |
| sandbox | No | Sandbox policy for model-generated shell commands. | |
| ephemeral | No | Skip persisting session files to disk. Defaults to true. | |
| extraArgs | No | Additional raw codex CLI arguments appended to the command. | |
| timeoutMs | No | Process timeout in milliseconds. | |
| ignoreRules | No | Do not load user or project execpolicy .rules files. | |
| approveForMe | No | Route approval requests through automatic review using the workspace-write sandbox. | |
| outputSchema | No | Path to a JSON Schema file describing the expected final response shape. | |
| skipGitRepoCheck | No | Allow running outside a Git repository. Defaults to true. | |
| outputLastMessage | No | Path to a file where the final agent message should be written. | |
| dangerouslyBypassApprovalsAndSandbox | No | Skip all confirmation prompts and sandboxing. Only use in an already-isolated environment. |