You want full speed.
Not a sandbox with the doors off.
--dangerously-bypass-approvals-and-sandbox is Codex's own alias for --yolo. Teams flip it because the default sandbox
blocks the network access real work needs. The problem: nothing between "sandboxed
and interrupted" and "no guardrails at all."
Certiv is that middle ground.
Codex security means controlling what an autonomous coding agent can execute: which commands run, which files and credentials it can touch, which MCP servers it can call, and what happens when the sandbox comes off. Certiv adds pre-execution policy enforcement to OpenAI Codex, checking every generated command against policy before it runs, so teams get full autonomous speed without the catastrophic tail.
Every Codex power user faces the same impossible choice
Neither works. Certiv removes the dilemma.
Sandboxed: workspace-write + approvals
- Network access blocked by default: installs and API calls fail
- Anything outside the workspace waits on an approval
- You rubber-stamp approvals without reading
- Autonomous runs constantly interrupted
- CI/CD pipelines broken by prompt pauses
With danger-full-access / --yolo
- Filesystem and network boundaries gone in one flag
- rm -rf ~/ can delete your entire home dir
- No logging of what Codex actually did
- AGENTS.md injection acts with your full privileges
- Repo config already executed code on open (CVE-2025-61260)
- MCP servers load and run unaudited
- All actions auto-approved
- No visibility into what ran
- Sandbox and approvals both off
- AGENTS.md injection executes freely
- MCP servers load unaudited
- Safe actions auto-approved instantly
- Dangerous actions blocked pre-execution
- Full audit trail of every command
- Injections caught before they run
- Project config scanned before session starts
Codex has three sandbox modes. Each has a gap.
Codex sandboxes with Seatbelt on macOS and Landlock on Linux, paired with an approval policy. It is a genuinely stronger default than most coding agents. The problem is what teams do to get real work done.
read-only Safest Codex can read files and reason, but cannot edit or run commands without asking.
The gap: Too restrictive for real work, so teams rarely leave it here.
workspace-write Default Reads, edits inside the workspace, and routine local commands. Network and anything outside the workspace still prompt.
The gap: The blocked network is exactly what installs and API calls need, so the prompts pile up and get rubber-stamped.
danger-full-access Sandbox off No filesystem boundary, no network boundary. With --dangerously-bypass-approvals-and-sandbox (Codex aliases it --yolo), no approvals either.
The gap: One flag removes every guardrail on a machine with real credentials. This is where the incidents happen.
Where Certiv fits: rather than forcing the choice between a sandbox too tight to work in and no sandbox at all, Certiv authorizes each action on its merits. Teams can run the mode they need, including full access, while every command, file read, and tool call is still checked against policy before it executes.
Documented vulnerabilities. Real repos. Real damage.
From the Codex disclosure record, 2025-2026.
Repo open → MCP servers execute
Codex auto-loaded MCP server entries from a project-local config and executed them on open. No approval, no validation, before any trust decision. One malicious repo compromises every developer who opens it.
CVE-2025-61260 · CVSS 9.8 · Check Point ResearchThe sandbox that took orders from its prisoner
Codex's own output could redefine the boundary of its sandbox, letting the agent write outside the workspace it was supposed to be confined to. The control layer accepted instructions from the thing it was controlling.
CVE-2025-59532 · sandbox escapeBranch name → cloud container RCE
Improperly sanitized GitHub branch names let attackers inject arbitrary commands into Codex cloud task containers and retrieve authentication tokens, including GitHub access. The repo metadata itself was the payload.
Codex cloud · patched by OpenAI · March 2026AGENTS.md is an open instruction channel
OpenAI's own security guidance is blunt: web pages, documents, AGENTS.md, and MCP responses can all carry hidden instructions. Anyone who can write to a repo can talk to the agent of everyone who opens it.
OpenAI Codex security documentation6 attack surfaces Codex opens up
Documented, recurring patterns affecting teams deploying Codex at scale.
Project config injection (RCE)
A malicious repo-local config redirected CODEX_HOME and auto-executed attacker MCP servers the moment a developer opened the project. Patched in 0.23.0; the pattern generalizes.
CVE-2025-61260 · CVSS 9.8Sandbox escape
Agent output redefining the workspace boundary let Codex write outside its sandbox. OS-level isolation raises the bar; it is not sufficient against the agent it contains.
CVE-2025-59532 · patchedAGENTS.md prompt injection
AGENTS.md is repo-controlled instructions injected into every session. Hidden text steers the agent: read credentials, weaken configs, call attacker infrastructure. No exploit needed.
OWASP LLM Top 10 · repo-controlledMCP trust boundary abuse
MCP servers declared in Codex config start with the session and inherit its privileges: filesystem, network, tokens. "Legitimate at install" says nothing about each call.
High severity · widely deployedScope creep & destructive drift
Without malicious input, Codex "helps" by modifying files beyond scope: rewriting CI pipelines, force-pushing, deleting directories inside the writable workspace. The sandbox permits all of it.
Approval fatigue → rubber-stampingCloud and CI surface
Codex cloud tasks run headless in OpenAI-hosted containers with GitHub access; a branch-name injection already produced container RCE and token theft. CI runs with approvals off by design.
Supply chain · enterprise-criticalThree policy layers. Pre-execution. Every time.
Certiv intercepts before execution. Not a log you read after the damage.
Hard rules, zero LLM in the loop
Enforced in microseconds. No LLM means no prompt injection.
- Block rm -rf ~/ and rm -rf / variants
- Deny CODEX_HOME and base URL overrides
- Block MCP auto-load from untrusted repos
- Prevent reads of ~/.ssh, ~/.aws
- Enforce tool allowlists in full-access mode
Pattern-aware content scanning
Catches obfuscated attacks and hidden-text injection that regex misses.
- Scan AGENTS.md and docs for hidden injection
- Detect credential aggregation patterns
- Flag outbound data exfil signatures
- Audit project config before session start
- Catch scope creep before execution
Divergence detection
Compares your intent to Codex's next action. Blocks divergence. Escalates when it matters.
- Task scope vs. action scope diff
- Privilege escalation detection
- Git operation audit (commit hygiene)
- Human approval for CI/CD file edits
- Lineage trail: intent → execution
What Certiv actually does in practice
What gets blocked, escalated, and what runs free.
Home directory deletion - rm -rf ~/
Deterministic BlockedMalicious repo config - MCP auto-execution
Deterministic BlockedHidden prompt injection in AGENTS.md
Semantic BlockedCI/CD pipeline edit during refactor
Intent-based EscalatedLegitimate full-speed autonomous refactor
All layers PassedComplete audit trail: every command, every session
Full intent lineage from your prompt to every action Codex took.
The Codex enterprise security checklist
One careful developer reads every diff. A fleet of hundreds of Codex seats, across CLI, IDE, and cloud, cannot. These are the six controls to secure Codex at enterprise scale. Certiv delivers all six from one endpoint agent.
Govern sandbox and approval modes
Know who runs danger-full-access or --dangerously-bypass-approvals-and-sandbox and where. Policy should decide which environments may drop the sandbox, not individual developers. And full access should mean "Certiv enforces instead", not "nothing enforces".
Scan project configs before session start
A repo-controlled config made Codex auto-load and execute MCP servers on open (CVE-2025-61260, CVSS 9.8). Every project config and AGENTS.md needs scanning before Codex loads it.
Codex MCP security
MCP servers declared in Codex config start with the session and run with its privileges. Audit MCP servers before they load, and authorize each MCP tool call at execution, not once at install.
Protect secrets and credentials
Generated commands should never read ~/.ssh, ~/.aws, or .env files. Hidden instructions in AGENTS.md or a document are all it takes to turn "fix the tests" into credential exfiltration.
Keep humans on high-impact actions
CI/CD file edits, deploys, bulk deletions, and outbound data transfers should pause for approval, even in fully autonomous runs. Everything else proceeds at full speed.
Record every session
A complete lineage from prompt to every executed command, with verdicts, across CLI, IDE extension, and cloud tasks. Incident response for security teams, evidence for compliance.
FAQCodex security questions
Expand to view common questions.
Codex security questions
Expand to view common questions.
Is Codex safe to use?
How do I secure Codex?
What is danger-full-access, and is it safe?
How do I secure MCP servers in Codex?
What does Codex enterprise security require beyond individual developer caution?
Does Certiv slow Codex down?
Ship at full speed.
Keep the guardrails.
Smart Codex developers run full access with enforcement, not without.
Keep reading
Claude Code security
The companion page for Anthropic Claude Code: real incidents, CVEs, and the controls that make YOLO mode safe.
For security teams
The six controls to evaluate when rolling out Codex, Claude Code, and other AI agents across an organization.
What is Runtime Assurance?
The category behind the controls on this page: authorize every agent action before it executes.