What Codex does for security review
- Checks each change for injection, missing authorization, exposed data and secrets in code before it merges.
- Scans the whole repository on a schedule and reports findings with evidence, not bare warnings.
- Turns confirmed findings into patches or issues, most severe first.
- Checks a fix again to confirm it closes the hole.
Codex features for security review
| Feature | What it does | How to start |
|---|---|---|
@codex security review | Posts security findings on a pull request, with the full report in the Codex task | Comment on the pull request |
| Auto security review | Reviews pull requests for vulnerabilities without being asked | Codex settings, under Review security vulnerabilities |
| Codex Security plugin | Scans a local repository and keeps findings in the Security workbench | /plugins in Codex, then install Codex Security |
| Codex Security CLI | Repeatable scans from a terminal or CI | npx @openai/codex-security scan |
How to set up Codex for security review
Connect the tools
Use the plugin for your first local scan and the CLI for scripts and CI. Scans that use OpenAI's models need Codex Security access; sign in with your ChatGPT account, and keep the results outside the repository.
# Sign in, then scan a repository; results go outside it npx @openai/codex-security login npx @openai/codex-security scan /path/to/repo \ --auth chatgpt --output-dir /path/outside/repo/resultsWrite the rules in AGENTS.md
Codex reads AGENTS.md before any work:
~/.codex/AGENTS.md, then the files from the repository root down to the folder it's working in. Put the job's rules there, or in a skill under.agents/skills/if they're long. See the AGENTS.md guide.## Security review rules - Review every pull request that touches auth/, billing/ or SQL. Look for injection, missing authorization checks, secrets in code and data returned to the wrong user. - Rate each finding Critical, High, Medium or Low, with the file, the line and how it could be exploited. - Never run exploits against production or anything we don't own. Read the code and test locally. - Open fixes as pull requests; never push to main.Run it without the interactive interface
codex execruns one task and exits. Progress goes to stderr and the final message to stdout;-oalso writes it to a file and--jsonstreams events. The sandbox is read-only unless you pass--sandbox workspace-write.# A security pass on this branch, with your rules from AGENTS.md codex exec "Review this branch against main for security issues, following AGENTS.md" # A repository scan from CI, without the live dashboard npx @openai/codex-security scan "$REPOSITORY" --auth chatgpt \ --output-dir "$SCAN_DIR" --headlessPut it on a schedule
Create a scheduled task in the ChatGPT desktop app or on the web (the CLI doesn't manage them), or run
codex execfrom cron. See how to make Codex proactive.
Limits and safety
- It reads the code in your checkout, not your running site, so it won't catch a misconfigured server.
- Scans are nondeterministic: two runs can surface different findings. Run them regularly, not once.
- It adds to your scanners and dependency alerts. It doesn't replace them or a penetration test.
- Codex sandboxes commands by default: writes stay in the workspace and the network is off. Keep
danger-full-accessfor an isolated runner or container.
Claude Code or Codex for security review?
The rules carry over. Write them once in AGENTS.md and put @AGENTS.md in CLAUDE.md, and both agents read the same file.
Step by step for the other agent: security review with Claude Code.
| Claude Code | Codex | |
|---|---|---|
| Rules file | CLAUDE.md | AGENTS.md |
| Connect tools | claude mcp add | codex mcp add or config.toml |
| Run without you | claude -p | codex exec |
| Schedule | /schedule, desktop scheduled tasks, /loop | Scheduled tasks in the ChatGPT app, cron |
| Built in for security review | /security-review, two security plugins | @codex security review, Codex Security |
Make security review someone's job
Commands run when someone remembers to run them. Crewmark turns your own Codex into an AI employee with a role, a goal in numbers, working hours and a heartbeat, so the work happens on schedule and shows up on a board.
Start from the role
The AI software engineer, with these rules in its brief.
Put the work on its board
Add the job as a recurring issue. The employee wakes on its heartbeat, does it and reports in a comment.
Related
For bugs that aren't security issues, see code review.
FAQ
How do I get a security review from Codex on a pull request?
Comment @codex security review on the pull request. Codex posts its findings there; the full report is under the Security Report tab of the Codex task.
What's the difference between Codex code review and security review?
Code review flags serious bugs of any kind. Security review goes deeper on vulnerabilities and produces a security report. Both can run on the same pull request.
Can I run Codex security scans in CI?
Yes, with the Codex Security CLI from the @openai/codex-security package; OpenAI's docs include GitHub and GitLab setups.
Checked against Claude Code's and OpenAI's Codex documentation on November 13, 2026.