TL;DR
- Codex is not autocomplete. It reads your repo. It edits files. It runs shell commands. It can open pull requests. OpenAI's own safety rests on two settings. Sandbox mode. Approval rule.
- Keep the sandbox on read-only or workspace-write. OpenAI treats full-access as a one-off setting. Not a real-project default.
- Codex Security is its own real feature. It scans a connected repo for bugs. It gives you patches. It checks your source, not your live app.
- Scan your live app free in 30 seconds: launchreadycode.com/free-scan.
Is OpenAI Codex Safe for Production Code?
Yes, if you use the sandbox and approval settings right. Codex is not simple autocomplete. It reads your repo. It edits files across the tree. It runs shell commands. It can open pull requests. Each step needs a limit. OpenAI builds those limits in. Most teams just never turn them on right.
OpenAI runs Codex on a simple rule. Low-risk actions should be easy. High-risk actions should stop for review. That rule shows up as two settings. The sandbox. And the ask-first rule. Both matter more than most teams treat them.
How Do Codex’s Sandbox Modes Actually Work?
The sandbox sets where Codex can write. It also sets if Codex can reach the network. OpenAI's default modes are read-only and workspace-write. Read-only blocks all file changes. Workspace-write allows changes inside your project folder only. A third mode, full-access, removes those limits. OpenAI's own guidance is direct here. Use full-access on a throwaway container only. Never on a real project.
The ask-first rule decides when Codex must check with you. Say Codex wants to do something outside the sandbox. It has to stop and ask you. You can say yes once. Or you can say yes for the whole session. This is not a small detail. It is the main control most teams skip. They get tired of the prompts. Then they turn it off.
What Is Codex Security, and Is It Enough on Its Own?
Codex also ships another feature. It is called Codex Security. Do not confuse the two. Codex Security is a scanner. It connects to a GitHub repo. It builds a threat model from your commits. Then it looks for real bugs. It tries to copy each bug. This happens in a closed sandbox. It gives a patch for human review. It does not touch your code on its own. A person still has to merge the fix.
Codex Security is useful. It is not a full answer, though. It reviews your source from the inside. It does not check your live app. Not the way an outside attacker would. A repo can pass each inside check. It can still ship with an exposed key. Or an open admin route once it is live.
What Are the Three Risks to Check When Codex Ships Real Code?
Risk 1: What Happens With Wide-Open Approval Settings?
Some teams turn on full-access mode to move faster. Or they enable bypass-approvals to skip each prompt. That removes the one safety net OpenAI built in. Keep the default sandbox on. Save full-access for a one-off test box only.
Risk 2: What Happens When Secrets Get Exposed?
Codex can read your whole repo. That includes any file with a stray key. Or a stray token. Say a secret sits in a config file. Codex can see it. It may reuse that secret in a suggestion. Store keys in a proper secret manager. Never in a file the agent can read as plain text.
Risk 3: What Is Prompt Injection Through Untrusted Content?
Codex can read tickets. It can read docs too. Code comments count as part of a task. A hidden command can hide inside any of these. It can steer what Codex does next. OWASP lists prompt injection as its top LLM risk. Treat any text Codex reads from outside your team as unchecked input.
Is There a Supply Chain Risk Too?
An agent moving fast may add a package. This can solve a task fast. Check any new dependency Codex adds. Use a real flaw list. Do this before the PR merges, not after.
What Should You Check Before You Ship Codex-Generated Code?
- Keep the sandbox on. Default to read-only or workspace-write. Do not flip to full-access on a real project.
- Use approval prompts for anything outside the sandbox. Do not turn on bypass-approvals out of habit.
- Store each key in a secret manager. Keep secrets out of files Codex can read.
- Treat external content as unchecked. Tickets, docs, and web pages can carry a hidden command.
- Check new dependencies against a flaw database. A package name alone proves nothing.
- Run Codex Security if you have access to it. It catches real bugs inside your source.
- Scan your live URL too. A clean source scan does not prove your live app is safe.
How Does Platform-Aware Scanning Cover Codex-Built Apps?
This last step is where Launch Ready Code fits in. Our scans are platform-aware. We detect apps built with Codex. We also detect Devin, Cursor, and Bolt. Lovable, Replit, Claude Code, Copilot, and Windsurf too. Each platform leaves its own pattern of gaps behind. We check for that exact pattern. This runs the same way across each scan tier we offer. It is a feature of the product. Not a separate add-on you pay extra for.
A free scan takes 30 seconds. It returns a Launch Readiness Score out of 100. The paid Launch Readiness Audit Report ($499, one-time) goes further. It covers four parts: security, reliability, performance, and monitoring. It comes with file-and-line references. A senior engineer signs off within 48 hours.
We do not read your Codex session or your repo. We test what an outsider sees on your live URL. Exposed secrets. Missing auth checks. Open rate limits. Missing security headers. That is the gap between a clean repo and a safe app.
See your Codex-built app’s readiness score?
Free scan, 30 seconds, no code access. Score out of 100 with the top gaps identified.
Scan your live URL now.Frequently Asked Questions
Is OpenAI Codex safe for production code?
Yes, if you use the sandbox and approval settings right. Codex reads your repo. It edits files. It can run shell commands. Keep the sandbox on read-only or workspace-write mode. Ask first for anything that reaches outside it.
What is the difference between Codex's sandbox modes?
Read-only blocks all file changes. Workspace-write allows changes inside your project folder only. Full-access removes those limits. OpenAI's own guidance is clear here. Use full-access on a throwaway container only. Never on a real project.
What is Codex Security and how is it different from the coding agent?
Codex Security is its own feature. It connects to a GitHub repo. It builds a threat model. It looks for real bugs. It tries to copy each one. This happens in a closed sandbox. Then it gives a patch for human review. It checks your source code from the inside. It does not check your live app. Not the way an outside attacker would.
Should I turn on full-access or bypass-approvals mode in Codex?
Not on a real project. OpenAI treats full-access and bypass-approvals as one-off settings only. Both remove the sandbox and approval checks. Those checks stop Codex from taking an unchecked step outside your project.
How do I check my Codex-built app is safe before launch?
A clean Codex Security scan checks your source code. It does not confirm your deployed app is safe. Run the free URL scan at launchreadycode.com/free-scan. It tests what an attacker sees from outside. Exposed secrets. Missing auth checks. Open rate limits. Missing headers.
Research sources
- OpenAI — Running Codex Safely at OpenAI. Published May 2026. Source for the sandbox and approval details above.
- OpenAI Help Center — Codex Security. Official docs for the scan feature named above.
- OpenAI Developers — Agent Approvals & Security. Reference for the approval and command rules above.
- OWASP GenAI Security Project — OWASP Top 10 for LLM Applications 2025. Source for the prompt injection risk ranking above.