OpenAI's Codex can now take a feature from a one-line request to an open pull request without a developer typing much code. It runs as a command-line tool, an extension for VS Code and similar editors, part of the ChatGPT desktop app and as cloud tasks that work on GitHub repositories. Many small teams and founders have used it to build most of an app. The harder part is the step after: putting that app in front of real customers, with real data and real payments.
This checklist is for that step. It assumes the app already exists and mostly works. It covers how Codex itself was configured, how its changes reach your main branch, and what the app needs before launch. Every product detail was checked on OpenAI's and GitHub's documentation on 20 November 2026. Both change often, so confirm settings in your own account. If you are still choosing an agent, start with our comparison of Codex and Claude Code.
- Use the Ask for approval permission mode for most work. Full access removes the sandbox and all approval prompts.
- In July 2026 a Codex bug deleted files in some users' home directories, mostly in full access mode. OpenAI has since shipped safeguards.
- Protect your main branch: require pull requests, a human approval and passing checks before anything an agent writes can merge.
- Tests that mock the database, sign-in and payments can pass while the real app fails.
- Keep production credentials off the machines and cloud environments Codex works in, and turn on secret scanning push protection.
- Have a tested rollback, database backups and error alerts in place before launch day.
Is Codex safe to use for a production app?
Yes, if the process around it is safe. Codex is a capable agent, but it writes plausible code quickly, and plausible is not the same as correct or secure. The risks sit in three places: what Codex is allowed to do on the machine it runs on, what reaches your main branch without a person checking it, and what the finished app exposes to the internet.
Developers are wary for good reason. In the Stack Overflow Developer Survey 2025, more respondents distrusted the accuracy of AI tools (46%) than trusted it (33%). The most common frustration, named by 66%, was AI solutions that are almost right, but not quite. Among respondents asked about AI agents, 81% agreed they were concerned about security and privacy.
Share of respondents. Bases vary by question, from 28,930 to 33,244.
| View | Share |
|---|---|
| Concerned about the accuracy of AI agents | |
| Concerned about AI agent security and privacy | |
| Frustrated by AI answers that are almost right | |
| Distrust the accuracy of AI tools | |
| Trust the accuracy of AI tools |
The same pattern shows up in apps built by AI tools generally. In October 2025, the security company Escape published a scan of more than 5,600 public apps made with AI app builders. It found more than 2,000 vulnerabilities and over 400 exposed secrets. Those apps came from browser-based builders rather than Codex, but the failure types are the same ones an agent can introduce in any codebase.
- 5,600+ publicly available apps built with AI app builders analysed
- 2,000+ vulnerabilities identified
- 400+ exposed secrets, such as API keys and tokens
- 175 instances of exposed personal data, including medical records and bank details
Source: Escape, How we discovered vulnerabilities in apps built with vibe coding, 29 October 2025
Which Codex permission mode should you use?
Ask for approval, for most work. OpenAI's permissions documentation advises starting there. In the ChatGPT desktop app and IDE extension the choice sits in the permissions control below the composer; in the CLI it is the /permissions command.
Two layers sit under each mode. The sandbox sets what commands can technically touch, and the approval policy decides when Codex must stop and ask. The sandbox values are read-only, workspace-write and danger-full-access, which OpenAI's approvals and security page describes as no sandbox and no approvals, and labels not recommended. By default the agent has no network access, and inside a writable project the .git, .agents and .codex folders stay read-only.
| Action | Ask for approval | Approve for me | Full access |
|---|---|---|---|
| Edit files in the project | Yes | Yes | Yes |
| Edit files outside the project | No, asks first | Partial, a reviewer agent decides | Yes |
| Use the internet | No, asks first | Partial, a reviewer agent decides | Yes |
| Runs inside the operating system sandbox | Yes, workspace-write | Yes, workspace-write | No, danger-full-access |
| Asks you before crossing the sandbox | Yes | No, auto-review decides | No, never asks |
Sources: OpenAI, Codex permissions; OpenAI, Codex agent approvals and security, checked 20 November 2026
Approve for me sends eligible requests to a separate reviewer agent instead of to you. It is designed to block actions such as leaking secrets or irreversible deletion. OpenAI's auto-review page is clear that "it is not a deterministic security guarantee". Treat it as a second line, not the first.
What the 2026 file deletion bug teaches
In July 2026, users reported that Codex running GPT-5.6 Sol had deleted files in their home directories. BankInfoSecurity reported that OpenAI traced it to the model overriding $HOME with a temporary folder, then deleting the real home directory while cleaning up. Deletions happened more often in full access mode, without the sandbox. OpenAI said it would add harness safeguards and guide more users toward safer permission modes. On 19 August 2026, The Decoder reported that OpenAI had shipped several safeguards in a security update.
The lesson outlasts the bug. If the agent cannot reach a file, a faulty command cannot delete it. Keep Codex in the sandbox, commit often so you can roll back, and never run it in full access mode on a machine that holds client data or production credentials.
How should you review Codex pull requests before they merge?
Through the same gate as a new developer's work: a pull request, passing checks and a human approval. Cloud tasks and the GitHub integration make it easy to open many pull requests quickly, which is exactly why the gate needs to be enforced by settings rather than habit.
GitHub's protected branches do most of this. On your main branch, turn on:
- Require a pull request before merging, with at least one approving review.
- Dismiss stale approvals, so a new commit after approval needs a fresh review.
- Require approval of the most recent push, so the last change is approved by someone other than whoever pushed it.
- Require status checks to pass: tests, type checks, linting and a build.
- Do not allow bypassing, so administrators follow the same rules.
Codex can also review pull requests when you comment @codex review. That is a useful extra pass, but OpenAI's own code review guide tells you to check findings against the diff before approving. A person who understands the business still signs off. The UK's National Cyber Security Centre warned in March 2026 that policies requiring human review of all AI code are under strain; its Vibe check blog favours rules enforced in code over trusting one AI to police another.
Write the rules down in AGENTS.md
Codex reads AGENTS.md files before it starts work. Per OpenAI's AGENTS.md documentation, it reads a global file from your Codex home folder, then files from the repository root down to the folder it is working in, with closer files taking precedence. It stops adding files at 32 KiB by default. Use it for the test command, folder structure, migration rules and things never to touch, such as payment logic without a test. AGENTS.md guides the agent; it does not enforce anything. Branch protection and checks do that.
Do your tests check real behaviour or just mocks?
Check before you trust a green tick. Agents are good at making tests pass, and the quickest way to do that is often to mock whatever is hard: the database, the sign-in provider, the payment service. A suite where everything is mocked proves the code agrees with itself, not that the app works.
Before launch, read the test files as well as the results. Look for at least:
- Tests that run against a real test database with your actual access rules switched on.
- A sign-in test as two different users, proving one cannot see or change the other's data.
- A payment test using your provider's test mode and a verified webhook, not a mocked success.
- An end-to-end test of the two or three journeys that earn you money.
- No tests that were skipped, deleted or loosened in the pull request that made them pass.
That last point matters with any agent. When a test fails, a model may change the test rather than the code. Branch protection that requires checks to pass will not catch a weakened test; a reviewer reading the diff will.
How do you keep secrets and production credentials away from Codex?
Give Codex test credentials only, and keep production keys in your hosting platform's secret store. A Codex session can read what is in the project folder and run commands with your user's access, so anything on that machine is within reach of a mistake or a malicious instruction hidden in a file or web page.
- Keep
.envfiles with live keys off developer machines where Codex runs; use separate test accounts for payments, email and the database. - For cloud tasks, set up each Codex environment with test values and only the internet access the task needs.
- Turn on GitHub secret scanning and push protection. GitHub's push protection documentation says it blocks secrets before they reach the repository; for repositories it needs GitHub Secret Protection and is off by default.
- Search the built front-end code and Git history for keys. Rotate any key that has ever been committed, even briefly.
- OpenAI also advises keeping prompt logging off, because prompts can contain source code and sensitive data.
Is your app's database properly locked down?
Assume not until you have tested it. Broken access control, where one user can reach another user's data, is number one in the OWASP Top 10:2025. Agent-built apps often get the screens right and the rules wrong, because the person prompting usually tests as themselves.
Check that every query is scoped to the signed-in user on the server, not just filtered in the browser. If you use Supabase or another Postgres service, make sure Row Level Security is on for every exposed table and that secret keys never reach the front end. Our vibe-coded app security checklist covers those database tests step by step.
Two further checks matter for Codex in particular. First, review every migration an agent writes before it runs against live data, and never let Codex hold a connection string for the production database. Second, confirm backups or point-in-time recovery are on, and restore one copy to prove it works.
The pre-launch checklist for a Codex-built app
These are the checks we would expect to see passed before a Codex-built app takes real users, in rough priority order.
| Check | Risk if missed | How to verify |
|---|---|---|
| 1. Codex permission mode | A faulty command reaches files outside the project | Ask for approval or tighter; full access never used on machines with live data |
| 2. Protected main branch | Agent code merges unreviewed | Pull request, one human approval, passing checks, no bypass |
| 3. AGENTS.md | The agent ignores your conventions | Test command, migration rules and no-go areas written down |
| 4. Real tests | Green checks hide broken features | Tests hit a test database, sign-in and payment test mode |
| 5. Secrets | Keys leak through code, history or prompts | Push protection on; history searched; leaked keys rotated |
| 6. Database access rules | One user reads another's data | Tested as two users and signed out |
| 7. Migrations and backups | A bad migration loses live data | Migrations reviewed; one restore tested |
| 8. Dependencies | Unused or invented packages add risk | Every package exists, is needed and is current; lockfile committed |
| 9. Rollback | A bad release stays live | Previous version can be redeployed in minutes |
| 10. Monitoring | Errors and attacks go unnoticed | Error alerts, uptime checks and access logs reviewed |
If several of these fail at once, read our guide on whether to fix or rebuild a vibe-coded app before patching one issue at a time.
How do you deploy, roll back and monitor a Codex-built app?
Keep deployment boring and in human hands. In the Stack Overflow survey, 75.8% of developers said they did not plan to use AI for deployment and monitoring. That caution is sensible for a first launch. Codex can write the pipeline, but a person should own the button and the alerts.
- Merge only through a protected pull request with passing checks
- Deploy automatically to a staging copy with test data
- Run the end-to-end tests and a manual smoke test on staging
- Promote the same build to production; do not rebuild it
- Watch error rates and key journeys for the first hour
- Roll back to the previous build if anything looks wrong, then fix forward
Monitoring is the part most agent-built apps skip. OWASP lists security logging and alerting failures at A09 in its 2025 list. As a minimum, set up error tracking that alerts a person, uptime checks on the main pages, and logs of sign-ins and admin actions you can actually search. Write down who is called when the alert fires.
When should you get outside help?
Before launch, if the app takes payments, stores personal or health data, or is about to face due diligence. Also if nobody on the team can read the code Codex wrote and explain what it does. Our sister guide to taking a Claude Code app to production covers the same ground for Anthropic's agent, and our explainer on vibe coding covers where AI-built apps tend to break.
Circlemount builds with these tools ourselves. The Study Room's Portal, Dentorb and ORBQ were built with AI-assisted development, including Codex and Claude Code. We are not an OpenAI partner. Marcus (founder) and a team of 12 specialists work from Telford with teams across the UK, from Birmingham to Manchester. Our Codex app fixing service works through this checklist on your code, and our security audit focuses on the access rules, secrets and payment flows.
Frequently asked questions
Is Codex safe to use on a production codebase?
It can be, with the right setup. Run Codex in a sandboxed permission mode such as Ask for approval, give it test credentials only, and require a pull request, passing checks and a human approval before anything merges. The risk comes from broad permissions and unreviewed changes, not from using an agent at all.
Which Codex permission mode is the safest?
Read-only is the most restrictive, but Ask for approval is the practical default OpenAI recommends for most work. It lets Codex edit files in the project inside a sandbox and asks before editing outside it or using the internet. Full access removes the sandbox and approvals, and OpenAI labels it not recommended.
What happened with the Codex file deletion bug?
In July 2026, users reported Codex running GPT-5.6 Sol deleting files in their home directories. OpenAI traced it to a clean-up command that pointed at the real home folder instead of a temporary one. Reports said it happened mostly in full access mode. By August, OpenAI had shipped several safeguards.
Can Codex review its own pull requests?
Codex can review pull requests when you comment @codex review on GitHub, and it is a useful extra check. It should not be the only approval. Set GitHub branch protection to require a human approval of the most recent push and passing status checks, so a person signs off every merge.
Should Codex have access to production credentials?
No. Give Codex test accounts for the database, payments and email, and keep live keys in your hosting platform's secret store. Turn on GitHub secret scanning push protection, search your Git history for keys, and rotate any key that has ever been committed, even briefly, or pasted into a prompt.
Does AGENTS.md make Codex follow security rules?
It guides Codex but does not enforce anything. Codex reads AGENTS.md files from your home folder and the repository before starting work, up to 32 KiB by default. Use it for test commands, migration rules and areas not to touch, then enforce the rules with branch protection, required checks and human review.
Sources
Checked on 20 November 2026. Product features and figures change quickly, so check the current source before you rely on a detail.
- OpenAI: Codex permissions
- OpenAI: Codex agent approvals and security
- OpenAI: Codex auto-review
- OpenAI: Codex AGENTS.md
- The Decoder: OpenAI fixes Codex bug that deleted real user files (19 August 2026)
- BankInfoSecurity: OpenAI warns GPT-5.6 file deletions stem from full access mode (17 July 2026)
- GitHub Docs: About protected branches
- GitHub Docs: About push protection
- Stack Overflow Developer Survey 2025: AI
- Escape: How we discovered vulnerabilities in apps built with vibe coding (29 October 2025)
Built your app with Codex?
Our Codex app fixing service reviews your repository, permissions, tests, secrets, database rules and release process, then fixes what stands between your app and launch. The initial app assessment is free, project work starts from £1,000 + VAT, and ongoing support plans start from £125 a month + VAT. Join the Circle for a free business analysis and proposal.





