Skip to content

What Is Codex Security? Setup, Scan Examples, GitHub Action and Which Plan You Need

In a project folder you type `cs scan .`; Codex Security reads the code, finds likely vulnerabilities and writes each one into a report with its evidence (which file, how an attacker reaches it). If you want, you have it generate a patch for a finding and verify whether the fix actually works. It's OpenAI's open-source (Apache-2.0) tool; it runs in the terminal, inside Codex as a plugin, or as a GitHub Action. You scan with your ChatGPT account or an API key; the model cost comes out of your plan or your API bill.

What it does
Finds, validates and patches vulnerabilities in code
Type
Command-line tool, TypeScript SDK and Codex plugin
Maker
OpenAI (official repository)
Sign-in
ChatGPT account or API key
Approval
The CLI doesn't pause for approval
Version
0.10.1 (November 18, 2026)
Cost
Tool is free; model cost from your plan or the API

What is Codex Security for?

If a site has checkout, membership or booking code, before release you want to know: "could someone get into the database through this form, or see someone else's order?" Codex Security reads the source code and looks for this kind of vulnerability (unauthorized access, injection, leaked secrets and so on). For each finding it writes the affected code, the attacker's prerequisites, the validation evidence and the remaining uncertainty into the report.

It also drafts a SECURITY.md and a threat model, imports and reassesses findings from other scanners (Snyk, Wiz, SonarQube, GitHub), files findings in Linear, Jira or GitHub, and exports SARIF, JSON and CSV.

Who it helps: agencies and developers who build client websites and apps; teams with e-commerce, hotel booking or membership projects that want a security check before every release. Requires comfort with the terminal and Node.js.

To get to know Codex, the coding agent the plugin runs in, read the Codex guide.

How does Codex Security work?

Your repositoryThe whole repository, selected folders or just a branch's change.
The scan› cs scan .Reads the code, uses SECURITY.md as context if present, and validates likely vulnerabilities.
The reportreport.mdfindings + evidence + coverage limitsSaved to an output folder outside the repository.
Fix, verifyA patch and fix check for the finding you pick.
A deep scan (--mode deep) repeats the standard scan and merges the deduplicated findings; it uses more time and usage.

At the end the scan summarizes on one screen: the report path, the number of findings (e.g. "2 findings: 1 high, 1 medium"), the scope and the elapsed time. By default a finding's severity doesn't fail the scan; if you set a severity threshold in CI, the exit code becomes 1.

How do you install Codex Security?

Requirements: Node.js 22.13.0 or later (22.x), 24.x or 26.x; Python 3.10 or later (the tomli package on 3.10). A ChatGPT account or an API key to sign in. The commands come from the official README and quickstart page.

Install and sign in› npm install --global @openai/codex-security cs login
First scan (in the repository folder)› cs scan .

If cs conflicts with another command, type codex-security. If you don't want a global install, use npx @openai/codex-security instead of cs in every command. On a machine without a browser, cs login --device-auth.

To pin the version, type npm install --global @openai/codex-security@0.10.1; this isn't a README example but this page's suggestion. You update manually with cs update.

What do you type, what do you get? Example scans

The examples are based on the official README, the CLI docs and the Codex workflows doc; the output is described as far as the documentation describes it.

Scan only this branch's changes (before a PR)› cs scan . --diff origin/main

What you get: a security scan of the committed changes from origin/main to HEAD and a report.md. For local, uncommitted changes, --working-tree.

Scan specific folders, leave out examples› cs scan . --path src --exclude-path examples/
Inside Codex (with the plugin)"Run a Codex Security scan on this repository, focusing on authentication and authorization. Return the saved report, source evidence, and coverage limits."What you get: a completed scan saves a report and findings; the report lists source evidence and exclusions. Then you can ask for a patch for a finding or have an existing fix verified.
Have it draft a SECURITY.md› cs policy .

What you get: the draft is saved outside the repository and existing files stay unchanged. You read the diff and notes, then copy only SECURITY.md to the displayed target; keep the vulnerability-reporting instructions.

TaskIn CodexIn the terminal
Scan the repository or a folder$security-scancs scan .
Review a PR, commit or branch diff$security-diff-scancs scan . --diff origin/main
Audit the same target repeatedly$deep-security-scancs scan . --mode deep
Assess another scanner's finding$triage-findingcs validate findings.json
Prepare a patch for a finding$fix-findingcs patch --scan SCAN_ID
Verify a fix$verify-fixcs verify-fix --scan SCAN_ID
Review a downloaded skill before installing it$check-skills—

If a finding is wrong, record why: cs findings false-positive <id> --reason "…". Later scans receive that explanation as context but still check the code independently.

Which model? The differences

Codex Security scans with an AI model. The default provider is OpenAI; you change it with --model and --effort (reasoning level), and switch to another provider with --provider. Which model and effort combinations work depends on the provider, the Codex version and your account.

ModelHow the docs describe itHow to select itAccess
gpt-5.6-solDefault model; default effort xhighNo setting neededChatGPT sign-in or API key
Other Codex models in your accountDocs example: --model gpt-6.1-sol --effort medium--model, --effortThose available to your account
Daybreak BlueAn access program for cybersecurity work--model gpt-6-sol --cyber-access-program daybreak_blueDaybreak Blue access in your workspace (Trusted Access for Cyber approval)
Daybreak RedRequires separate approval and provisioning--cyber-access-program daybreak_redSeparate approval
OpenRouter, Fireworks, Amazon Bedrock modelsYou must name the model explicitly--provider openrouter --model …The provider's key; AWS credentials for Bedrock

Which should you pick? Start with the default: the plugin docs recommend the default model with xhigh effort for the best scan quality. To cut time and usage, choose a lower effort; the docs don't quantify how effort affects speed and cost. cs scan . --dry-run --verbose shows which model and effort will be used without starting the scan.

Checked on November 18, 2026. Source: the CLI reference ("Configure the runtime") and the pricing page. Model names change often.

Where does Codex Security run?

Terminal (CLI and TypeScript SDK)YesmacOS, Linux, Windows; with Node.js and Python.
Codex (desktop app and Codex CLI)YesWith the Codex Security plugin.
GitHub ActionsYesOn an Ubuntu 24.04 runner; with an OpenAI key, or GitHub OIDC for Bedrock.
Cloud (Daybreak Defense Factory)BetaPreview; an Enterprise / Education workspace with Daybreak access.
Claude Code, Cursor and other agentsUnclearThe docs describe the scanning workflow only for Codex; mcp add gives other clients only a read-only info tool.

If you want an open-source tool that probes a running app like an attacker, see the Strix guide; Codex Security reads the source code.

To have a coding agent run a security audit as a skill, read the Cloudflare security-audit guide.

What does Codex Security access, and where does my code go?

Reads

The scanned repository's source code and git history, root and component SECURITY.md files, and architecture documents you supply.

Sends

A local scan can send relevant code and prompts to the selected model provider (OpenAI, Bedrock, OpenRouter, Fireworks).

Writes

The report, findings and threat model go to an output folder outside the repository; on request, patches and draft PRs; with permission, Linear, Jira and GitHub issues. A plugin scan leaves your source unchanged.

Runs

The CLI runs with your operating-system permissions and doesn't pause for approval; the scan process can inherit environment variables.

Remove unrelated keys from the environment before scanning, and review reports, logs or dashboard output before sharing: they can contain source code or credentials.

Source: the CLI quickstart, the plugin quickstart and SECURITY.md. This section isn't a security certification.

Is Codex Security free, and which plan do you need?

The tool is free and open source (Apache-2.0). The cost comes from the model that runs the scan, and there are two routes:

Sign-in routeWhat you payNote
ChatGPT account (cs login)It comes out of your plan's Codex usage allowanceThe pricing page lists Codex in the terminal on Plus ($20/month) and Pro (from $100/month), Business and Enterprise
API key (CI, automation)API pricing; not deducted from your ChatGPT allowanceThe GitHub Action uses this route; --max-cost sets an estimated limit
Cloud scanning of GitHub repositoriesThe pricing table shows access as "available" only on Enterprise / EducationRequires a workspace with Daybreak access; preview

--max-cost is an estimate, not a hard spending cap; requests in progress can go over it. The docs don't give a typical cost per scan; you can run your first scan on a small folder with --show-cost to see the estimated cost. Prices are in US dollars; Turkey is on OpenAI's list of supported countries.

Source: learn.chatgpt.com/docs/pricing (November 18, 2026). The Free and Go plans are listed on the pricing page only for the desktop app; whether CLI sign-in works on those plans isn't stated in the official sources.

Official pricing page last checked on .

Common problems and fixes

What's happeningWhat to do
I signed in, but the scan uses my API keyIf OPENAI_API_KEY or CODEX_API_KEY is in the environment, non-interactive scans choose it. Add --auth chatgpt or remove the variables.
"Refresh token already used" errorcodex-security logout, then codex-security login. To avoid sharing a sign-in with Codex, sign in separately before your first scan.
The same scan returned different findingsAI-assisted scans vary. Compare with cs scans rerun and cs scans compare, provide architecture and security context, and recheck any important finding that disappears.
Exit code 0, but some files weren't reviewedCheck scan.scope.limitations in scan-manifest.json.
The cs command conflicts or npm reports EEXISTUse the name codex-security or npx @openai/codex-security.

How do you uninstall Codex Security?

  1. CLI: npm uninstall --global @openai/codex-security (npm's standard command; not stated in the official documentation). First remove the sign-in with codex-security logout.
  2. Plugin: Remove it from Plugins in the Codex desktop app, or via /plugins in Codex CLI.
  3. Outputs: Delete the output folder with the scan results and the CODEX_SECURITY_STATE_DIR folder manually.

Frequently asked questions

What is Codex Security?

OpenAI's open-source tool that finds vulnerabilities in a code repository, validates them, proposes patches and verifies fixes. It runs in the terminal with the cs command, inside Codex as a plugin, or as a GitHub Action.

How do you install the Codex Security plugin?

Open Codex in the ChatGPT desktop app and install Codex Security under Plugins; in Codex CLI, install it with the /plugins command and start a new chat with /new.

How do you install the Codex Security CLI?

With Node.js and Python installed, run npm install --global @openai/codex-security, then cs login, and cs scan . in the repository folder.

Which plan or key do you need?

If you sign in with a ChatGPT account, scans come out of your plan's Codex usage allowance; the pricing page lists Codex in the terminal on Plus and higher plans. In CI an API key is used and you pay API prices.

Who can use Codex Security Cloud?

Daybreak Defense Factory, which scans connected GitHub repositories in the cloud, is in preview; the pricing table shows access only on the Enterprise / Education plan, and a workspace with Daybreak access is required. Local scans work without the cloud connection.

Does my code go to OpenAI?

A local scan can send relevant code and prompts to the selected model provider; the default provider is OpenAI. If you choose Bedrock, OpenRouter or Fireworks, it goes to that provider.

Can Codex Security scan PRs on GitHub?

Yes. The official GitHub Action scans the repository or a PR, can fail the job based on a severity threshold, and produces JSON and SARIF reports; OpenAI scans use an OpenAI API key, while Amazon Bedrock uses AWS credentials through GitHub OIDC.

Related guides

Sources

Not clear in the official sources: Whether CLI sign-in works on the ChatGPT Free and Go plans · the typical cost of a scan · scanning with requests in Turkish and Turkish reports. Each is covered in its section.