title: Codex first-class skill runtime status: experimental kind: feature mode: infra source: > RFC-AI-0004 Principle 3 (vendor neutrality) and issue #313. Implemented by the canonical .agents/skills tree, the project .codex profile, tools/sandbox-lint, tools/agent-isolation, docs/adapters/harnesses/codex.md, and the setup/setup-isolated lifecycle. acceptance:
Makes OpenAI Codex a native Magpie runtime rather than a delegation target. Codex reads the same workflow sources as other harnesses, invokes the same tool adapters, and uses its own sandbox, rules, and approvals.
Skills remain SKILL.md files. Codex scans .agents/skills natively and follows the existing symlinks; no conversion into AGENTS.md occurs.
Repository AGENTS.md files remain the instruction hierarchy.
workspace-write is mandatory and workspace network access is disabled.
Approvals are on-request and reviewed by the user, never automatically.
Exec-policy rules allow only scoped read operations, prompt known remote mutations, and forbid credential disclosure commands.
Project trust is a human decision. Setup never edits Codex trust state.
The .codex policy files are committed and reviewed; existing unrelated .codex configuration is preserved during adoption and upgrade.
Codex as a reviewer runs read-only: the adversarial-review tool invokes codex exec -s read-only --ephemeral -c mcp_servers={} with an output schema, pinned by tools/adversarial-review/tests/test_backends.py, and skips it when Codex is the harness running the review.
From a Codex session, setup config adversarial-review can write ~/.codex/prompts/magpie-adversarial-review.md, rendered by adversarial-review commands --harness codex, under the user's home and never in a repository. The prompt resolves the newest installed plugin version at run time and tells the agent to ask for an unsandboxed run, because the reviewer CLIs need network and their own credentials.
The native Bash PreToolUse adapter uses Codex's canonical event and JSON deny schema, including unified exec. Ordinary commands never receive an implicit hook approval. Source and snapshot project registrations resolve the engine from the git root; plugin-owned or user-scope engines outside writable roots are preferred for routine adopters.
Project trust and /hooks definition trust are independent operator decisions. Hook errors can fail open, interactive write_stdin input is not rechecked, and editing a workspace-owned engine does not renew definition trust.
Static lint checks the project engine's existence, accepts absolute user-scope paths, and offers --guard-from-plugin for separately verified plugin registration and trust without a duplicate project hook.
Vetted reads use exact installed paths for both uv launchers. Writes keep native prompt decisions; generated rules never allowlist a general uv command or a mutable checkout. Code and policy tamper limitations and the remaining differences from Claude are reported explicitly.
The Codex catalogue (.agents/plugins/marketplace.json) marks magpie-vetted-ops INSTALLED_BY_DEFAULT, beside magpie-setup (#1761). Installing it grants nothing: its native rules, like the Claude allow rules and sandbox exclusions, are wired only where the isolated setup is configured.
uv run --directory tools/sandbox-lint --group dev pytest uv run --project tools/sandbox-lint --group dev sandbox-lint --codex .codex codex execpolicy check --pretty \ --rules .codex/rules/magpie.rules -- gh pr view 313 codex execpolicy check --pretty \ --rules .codex/rules/magpie.rules -- gh pr create --title test --body test codex execpolicy check --pretty \ --rules .codex/rules/magpie.rules -- gh auth token
codex -s read-only restricts writes and network but not reads, so an instruction injected into a reviewed diff could have it read files elsewhere on the machine; the adversarial-review README tells operators to leave codex out of the reviewer list on machines that hold private checkouts.