Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

codex-security

> AI 编程
Open source

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

7.9K stars0 likes2 views
WebsiteGitHub

About

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

Codex Security

@openai/codex-security is a CLI and TypeScript SDK for defining security policy and finding, validating, and fixing security vulnerabilities in your code.

** See the Codex Security documentation** for full documentation.

Some cybersecurity requests and protected findings require approval through Trusted Access for Cyber. To join the program, visit chatgpt.com/cyber.

Quick start

Requires Node.js 22.13.0 or later and Python 3.10 or later.

bash
npm install @openai/codex-security
npx @openai/codex-security login
npx @openai/codex-security scan /path/to/directory

For CI, set OPENAI_API_KEY instead of signing in.

Generate SECURITY.md

Draft repository-wide or component-scoped SECURITY.md guidance for future scans:

bash
npx @openai/codex-security policy .
npx @openai/codex-security policy . --path services/api --knowledge-base architecture.md

The command saves a draft outside the checkout; it does not install it or run a vulnerability scan. Review the proposed diff before copying the policy. Supporting architecture, threat-model, and review documents stay outside the repository and may contain sensitive details. See the SDK policy guide for headless generation, saved artifacts, and SDK usage.

TypeScript SDK

Codex Security is a Javascript package:

typescript
import { CodexSecurity } from "@openai/codex-security";

const security = new CodexSecurity();
const result = await security.run("/path/to/directory");
await security.run("/path/to/directory", {
  mode: "deep",
  workers: 2,
  subagents: 0,
  stopAfterNoNew: 3,
  maxDiscoveryRuns: 10,
  maxTimeHours: 1.5,
});

console.log(result.reportPath);
await security.close();

Containerized bulk scans

Use the included Docker Compose configuration for scans of many repositories. See the container quick start for more detail.

For individual CLI stages with durable state and access to a separately deployed findings service, use the same scanner image with the workflow runner Compose example.

Findings service (preview)

Run npx @openai/codex-security serve to start the service without Docker. See running without Docker for prerequisites, credentials, and storage configuration.

The findings service runs from the same ghcr.io/openai/codex-security image as the scanner (or a local source build), with a separate container and state volume configured by compose.findings.yaml. It stores findings and embeddings in SQLite and lists findings with pagination. Its read-only dashboard at /dashboard refreshes every five seconds and shows stored findings and duplicate groups from the service's database. It also returns potential duplicates by embedding similarity within a repository or an explicit all-repository scope. The npx @openai/codex-security publish scan --to custom --findings-url http://localhost:3000 command uploads completed findings and their repository ID. The SDK and npx @openai/codex-security dedupe command retrieve candidates, run independent Codex reviews locally, and persist accepted duplicate groups; --all-repositories opts into the broader scope.

Use npx @openai/codex-security classify-severity --scan SCAN_ID --rubric /path/to/policy.md to assess selected findings under your own policy before publishing tickets. Scan classification checkpoints each finding in SQLite and reuses matching assessments on reruns; --reprocess forces reassessment. The SDK exposes the same classification operation; original scan severity stays unchanged. See severity classification.

Other providers

To use another inference provider, set its API key and select a model:

bash
export AWS_BEARER_TOKEN_BEDROCK="<your-bedrock-api-key>"
export AWS_REGION="us-east-2"
npx @openai/codex-security scan . --provider amazon-bedrock --model openai.gpt-5.6-luna

export OPENROUTER_API_KEY="<your-openrouter-api-key>"
npx @openai/codex-security scan . --provider openrouter --model anthropic/claude-sonnet-4.5

export FIREWORKS_API_KEY="<your-fireworks-api-key>"
npx @openai/codex-security scan . --provider fireworks --model accounts/fireworks/models/qwen3-235b-a22b

Documentation

** See the Codex Security documentation** for full documentation.

See project configuration for reusable YAML/JSON settings, CLI overrides, and editor schema support.

Issues· 273 open

View all issuesOpen on GitHub
  • #741

    Codex Security 0.1.22: finalization resurrects resolved checkpoint deferrals and produces inconsistent durable coverage

    Updated Oct 1, 2026
  • #717

    Successful Deep Scan completion promotes findings from unconsumed worker checkpoints

    Updated Sep 30, 2026
  • #663

    Multi_agent_v2 fails against Bedrock Mantle Endpoint

    Updated Sep 30, 2026
  • #20

    Could not save the Codex Security scan: scan-manifest.json

    bugpriority:p1area:reportsarea:sandboxarea:costUpdated Sep 28, 2026
  • #1024

    Daybreak Blue selection gets dropped when using API-key auth

    Updated Sep 24, 2026
  • #52

    Custom API endpoint

    enhancementpriority:p2area:autharea:cliUpdated Sep 21, 2026
  • #973

    Surface multiscan run warnings in campaign summaries

    Updated Sep 18, 2026
  • #251

    Run warnings never reach the SARIF projection, so drift is invisible to SARIF consumers

    bugpriority:p1area:reportsarea:pythonUpdated Sep 18, 2026
  • #956

    onWorkerStatus can omit dispatch events when delegated workers run

    Updated Sep 17, 2026
  • #790

    Supported recovery for terminal unsealed scan missing findings/coverage scanId envelopes

    Updated Sep 12, 2026

> Tags

TypeScriptai-securityapplication-securityclicode-scanning

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.