Skip to content
Back to search

codex-security

SkillWorks with CodexOfficial: OpenAIGitHub

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/openai/codex-security with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/openai/codex-security'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/openai--codex-security/badge.svg)](/listings/openai--codex-security)

HTML

<a href="/listings/openai--codex-security"><img src="/api/listings/openai--codex-security/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Requires Node.js 22.13.0+ within 22.x, or Node.js 24.x or 26.x, and Python 3.10+. Python 3.10 also requires `tomli`.

Install the CLI globally and sign in:

npm install --global @openai/codex-security
cs login

`cs` is a short alias for `codex-security`; both commands run the same CLI. The installation creates both commands in npm's global executable directory, which must be on your `PATH`. If `cs` already resolves to another tool, use `codex-security` instead. If npm stops with an `EEXIST` error for `cs`, use `npx @openai/codex-security` without a global installation.

Run your scan from the repository directory:

cs scan .

If you have Daybreak Blue access, add `--cyber-access-program daybreak_blue` to the scan command. Otherwise, omit the flag or use `--cyber-access-program standard`.

To use Codex's Daybreak toggle, pass `--codex daybreak=true`. It defaults off and requires compatible access. See [Daybreak configuration](sdk/typescript/docs/cli.md#daybreak-opt-in) for SDK and plugin usage, including Deep Scan workers.

Scans use your existing `SECURITY.md` guidance. You can optionally [draft or update a policy](#generate-securitymd) before scanning.

To run without a global installation, replace `cs` in these examples with `npx @openai/codex-security`, for example:

npx @openai/codex-security scan .

For CI, set `OPENAI_API_KEY` or `CODEX_API_KEY` in the scan process's environment. On remote or headless machines, use `login --device-auth` if your workspace allows it, or [sign in over SSH](sdk/typescript/README.md#remote-login-with-ssh-forwarding).

Some cybersecurity requests and protected findings require [Trusted Access for Cyber](https://chatgpt.com/cyber) approval.

Scan options

Choose a scope and scan mode:

# Scan selected paths.
cs scan . --path src --path tests

# Scan committed changes from a base revision to HEAD.
cs scan . --diff origin/main

# Run a deep scan of the repository.
cs scan . --mode deep

Use `cs scan . --max-time 15` for an advisory 15-minute Standard investigation allowance. See [investigation time](sdk/typescript/docs/cli.md#set-investigation-time) for timing semantics and Deep Scan limits.

Use `cs --help` to browse commands, or `cs scan --help` for scan options, cost limits, and patching after a scan.

For an application spread across repositories, see [review one system across repositories](sdk/typescript/docs/cli.md#review-one-system-across-repositories). Use [bulk scans](sdk/typescript/docs/cli.md#bulk-scans) for independent repository reviews in one resumable campaign.

After a scan, [inspect its scope and follow-up work](sdk/typescript/docs/cli.md#understand-scan-scope-and-follow-up-work) to understand recorded exclusions and decide whether to review the findings, run a focused scan, or recover an interrupted run.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 246 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Codex Security
  2. Codex Security helps you find, investigate, and fix vulnerabilities in your code.
  3. Use its security workflows in Codex, or automate them with the
  4. `@openai/codex-security` CLI and TypeScript SDK.
  5. - **In Codex:** [choose a security workflow](docs/agent-workflows.md).
  6. - **In a terminal:** [install the CLI and scan your repository](#quick-start).
  7. - **In automation:** use the [TypeScript SDK](#typescript-sdk) or
  8. [GitHub Action](#github-actions).
  9. ## Features
  10. - Scan repositories, selected paths, or Git changes. Deep scans repeat Standard scans and return their deduplicated findings.
  11. - Validate candidate findings, generate patches, and verify existing fixes.
  12. - Draft `SECURITY.md` policies and save threat models for later review.
  13. - Browse saved scans and findings, identify duplicates, assess severity against
  14. your own rubric, and suggest owners from source and Git history.
  15. - Preview third-party scanner findings, save them locally, or publish supported reports to Codex Security Cloud. [Scanner import guides](docs/scanner-imports/README.md).
  16. - Track findings in Linear, Jira, or GitHub, publish completed scans, or export SARIF, JSON, and CSV. [Integration workflows](docs/plugin-connectors.md).
  17. - Automate scans across repositories or project components, including in CI and
  18. containers.
  19. ## Use in Codex
  20. Open your repository in a Codex session with the Codex Security plugin enabled,
  21. then ask:
  22. > Run a Codex Security scan on this repository, focusing on authentication and
  23. > authorization. Return the saved report, source evidence, and coverage limits.
  24. A completed scan saves a report and findings. Read the report for source
  25. evidence and exclusions, then request a patch or ask Codex to verify an
  26. existing fix. See the [agent workflow guide](docs/agent-workflows.md) for setup,
  27. task selection, and recovery.
  28. ## Quick start
  29. Requires Node.js 22.13.0+ within 22.x, or Node.js 24.x or 26.x, and Python 3.10+.
  30. Python 3.10 also requires `tomli`.
  31. Install the CLI globally and sign in:
  32. ```bash
  33. npm install --global @openai/codex-security
  34. cs login
  35. ```
  36. Run your first scan from the repository directory:
  37. ```bash
  38. cs scan .
  39. ```
  40. When the scan completes, open the Markdown file at the **REPORT** path in the
  41. terminal. Run `cs scans show` from the same repository to find its latest
  42. completed scan again. See [scan scope and follow-up work](sdk/typescript/docs/cli.md#understand-scan-scope-and-follow-up-work)
  43. for how to interpret exclusions in the report.
  44. `cs` and `codex-security` run the same CLI. If the short name conflicts with
  45. another command, use `codex-security`. To skip the global install, or if npm
  46. reports an `EEXIST` conflict, use `npx @openai/codex-security` in place of
  47. `cs` for both login and scanning.
  48. For CI, set `OPENAI_API_KEY` or `CODEX_API_KEY` in the scan process's environment.
  49. For a headless machine, see [device or SSH login](sdk/typescript/docs/cli.md#authentication).
  50. ### Scan options
  51. Choose a scope and scan mode:
  52. ```bash
  53. # Scan selected paths.
  54. cs scan . --path src --path tests
  55. # Exclude a directory from the scan.
  56. cs scan . --exclude-path examples/
  57. # Scan committed changes from a base revision to HEAD.
  58. cs scan . --diff origin/main
  59. # Run a deep scan of the repository.
  60. cs scan . --mode deep
  61. ```
  62. Use `cs scan . --max-time 15` for an advisory 15-minute Standard investigation
  63. allowance. See [investigation time](sdk/typescript/docs/cli.md#set-investigation-time)
  64. for timing semantics and Deep Scan limits.
  65. Use `cs --help` to browse commands, or `cs scan --help`
  66. for scan options, cost limits, and patching after a scan.
  67. For an application spread across repositories, see
  68. [review one system across repositories](sdk/typescript/docs/cli.md#review-one-system-across-repositories).
  69. Use [bulk scans](sdk/typescript/docs/cli.md#bulk-scans) for independent repository
  70. reviews in one resumable campaign.
  71. Scans use existing root and component `SECURITY.md` guidance. To write or
  72. revise it, see [Generate SECURITY.md](#generate-securitymd).
  73. Some cybersecurity requests and protected findings require
  74. [Trusted Access for Cyber](https://chatgpt.com/cyber). For accounts with Daybreak
  75. access, see [Daybreak opt-in](sdk/typescript/docs/cli.md#daybreak-opt-in) for the
  76. Codex toggle and [Cyber access programs](sdk/typescript/docs/cli.md#select-a-cyber-access-program)
  77. to select a program explicitly.
  78. ## TypeScript SDK
  79. Install the package locally in your TypeScript project:
  80. ```bash
  81. npm install @openai/codex-security
  82. ```
  83. Then import it:
  84. ```ts
  85. import { CodexSecurity } from "@openai/codex-security";
  86. const security = new CodexSecurity();
  87. try {
  88. const result = await security.run("/path/to/repository");
  89. console.log(result.reportPath);
  90. } finally {
  91. await security.close();
  92. }
  93. ```
  94. The [SDK guide](sdk/typescript/docs/sdk.md) includes deep-scan configuration,
  95. validation, severity classification, owner suggestions, and result handling.
  96. Linked Git worktrees share scan history and saved findings when they use the same
  97. Codex Security state directory. Keep `CODEX_SECURITY_STATE_DIR` stable to retain
  98. that shared history and sign-in scope. See the [scan history guide](sdk/typescript/docs/cli.md#scan-history-and-reruns).
  99. ## Read existing Cloud findings
  100. When Codex Security Cloud is available to your account, the Security plugin's
  101. `$cloud-findings` skill can read findings, reports, recorded assignment and
  102. verification, and scan status in Codex desktop or the Codex CLI. Cloud is an
  103. optional connection; local scans work without it.
  104. See [Cloud connection setup and CLI reads](sdk/typescript/docs/sdk.md#read-existing-cloud-findings)
  105. for authentication requirements and a read-only example.
  106. ## Generate SECURITY.md
  107. Use `policy` to draft a new `SECURITY.md` or update an existing one. Use `--path`
  108. to select a component:
  109. ```bash
  110. cs policy .
  111. cs policy . --path services/api --knowledge-base architecture.md
  112. ```
  113. The command saves its draft outside the repository and leaves existing files
  114. unchanged. Review the diff and notes, edit the draft, then copy only `SECURITY.md`
  115. to the displayed **Policy target**. Keep the saved architecture and threat-model
  116. documents outside the repository.
  117. Scans already use root and component `SECURITY.md` files. Keep your current policy
  118. if it needs no changes. When updating it, preserve its vulnerability-reporting
  119. instructions. If the command says the policy is already up to date, no copy is
  120. needed.
  121. Files at `.github/SECURITY.md` or `docs/SECURITY.md` often contain reporting
  122. instructions. Preserve them when drafting a policy; those locations do not
  123. automatically provide repository-wide scan guidance. See the
  124. [policy guide](sdk/typescript/docs/cli.md#generate-a-security-policy) for policy
  125. locations, unanswered questions, saved artifacts, and SDK usage.
  126. ## Save and export threat models
  127. Scans and policy generation save threat models with their results. Export a saved
  128. model without starting another analysis:
  129. ```bash
  130. cs export --scan SCAN_ID --artifact threat-model --output threatmodel.md
  131. ```
  132. Omit `--scan` to use the current repository's latest completed scan. The
  133. [export guide](sdk/typescript/docs/cli.md#exports-and-ci) also covers findings,
  134. SARIF output for CI, and the offline TypeScript API. For ServiceNow Application
  135. Vulnerability Response, see [Export findings for ServiceNow](sdk/typescript/docs/cli.md#export-findings-for-servicenow).
  136. ## GitHub Actions
  137. To run a weekly repository scan on GitHub-hosted Ubuntu:
  138. 1. Add an OpenAI API key as the repository secret `CODEX_SECURITY_API_KEY`.
  139. 2. Copy the [weekly workflow](github-action/examples/repository.yml) to
  140. `.github/workflows/codex-security.yml`. Replace `REPLACE_WITH_REVIEWED_COMMIT`
  141. with the reviewed distribution commit SHA from an Action release.
  142. 3. To try the workflow before the next scheduled run, open **Actions → Codex
  143. Security repository → Run workflow**.
  144. The example uses an estimated $5 limit per scan and reports findings without
  145. failing the job. Requests in progress can exceed the limit. For a severity
  146. threshold, pull request checks, or runner requirements, see the
  147. [Action guide](github-action/README.md). For eligible accounts, see
  148. [Daybreak access](github-action/README.md#daybreak-access-and-refusals).
  149. ## Containerized bulk scans
  150. Scan a list of repositories with the included Docker Compose configuration,
  151. which keeps results and authentication between runs. See the
  152. [container quick start](sdk/typescript/docs/cli.md#containerized-bulk-scans).
  153. The [workflow runner](docker/README.md#workflow-runner) runs individual CLI stages
  154. in containers and can connect to a separately deployed findings service.
  155. ## Findings storage and deduplication
  156. The [findings guide](sdk/typescript/docs/findings-service.md) covers local
  157. storage, deduplication, and compatibility with independently operated endpoints
  158. through `publish scan --to custom` and explicit `--findings-url`. The local
  159. `serve` command and browser dashboard have been removed; existing databases and
  160. scan artifacts remain available.
  161. ## Other providers
  162. Scans support OpenAI, Amazon Bedrock, OpenRouter, Fireworks AI, and Cheaper Inference. Bedrock uses
  163. AWS credentials and does not require a separate OpenAI login. See
  164. [Bedrock setup](docs/bedrock.md) for AWS profiles, regions, and model access.
  165. For OpenRouter, Fireworks AI, and Cheaper Inference, set the provider's API key and choose a supported
  166. model. See [provider configuration](sdk/typescript/docs/cli.md#native-command-authentication-and-other-providers)
  167. for examples.
  168. ## Documentation
  169. - [Online documentation](https://learn.chatgpt.com/docs/security/cli)
  170. - [Agent workflows and recovery](docs/agent-workflows.md)
  171. - [CLI reference](sdk/typescript/docs/cli.md)
  172. - [Imported finding identity and evidence](docs/scanner-imports/schema-guide.md)
  173. - [Project configuration](docs/project-configuration.md)
  174. - [Examples](examples/README.md)
  175. To report a vulnerability privately, follow the [security policy](SECURITY.md).
  176. ## Citation
  177. Use **Cite this repository** on GitHub to copy an APA or BibTeX citation, or
  178. download [CITATION.cff](CITATION.cff). Match the citation’s version to
  179. `codex-security --version` and use the publication date from that version’s
  180. `npm-vX.Y.Z` entry in [GitHub Releases](https://github.com/openai/codex-security/releases).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.