OpenAI Open Sources Codex Security: Using AI Agents to Really Find, Verify, and Fix Vulnerabilities
In today's world where software development speed is constantly being accelerated by AI coding assistants, security review is becoming an increasingly obvious bottleneck. Traditional static scanning tools often generate a large number of false positives and low-value alerts, forcing security teams to spend a lot of time "sifting through junk"; while purely manual review is difficult to keep up with the pace of code changes.
Verification: Attempt to reproduce the issue in an isolated environment significantly reduces false positives. Remediation: Generate patch suggestions based on system context, which developers can directly review and open PRs. It emphasizes "high signal, low noise". OpenAI stated in internal and early customer validation that the proportion of overreported severity decreased by more than 90%, and the false positive rate decreased by more than 50%. It has also helped discover and report high-risk vulnerabilities in multiple open-source projects (including OpenSSH, GnuTLS, GOGS, etc.), and multiple CVEs have been assigned. Currently, the local CLI and SDK are still in limited beta, primarily targeting approved customers and partners; the cloud version is available for research preview for ChatGPT Pro / Business / Enterprise / Edu users.
Quick Start Guide (Local CLI)
Environment Requirements:
- Node.js 22.13+ (22.x line), 24.x or 26.x
- Python 3.10+
- An account with Codex Security access (Trusted Access recommended)
An account with Codex Security access (Trusted Access recommended) (Verification for better results)
Installation and Login:
npm install @openai/codex-security
npx @openai/codex-security login
The Simplest Scan:
npx @openai/codex-security scan .
Specify stronger model and inference strength:
npx @openai/codex-security scan . --model gpt-5.6-terra --effort high
{ CodexSecurity } from"@openai/codex-security";
const security = newCodexSecurity();
try {
const result = await security.run(".", {
outputDir: "/path/outside/repository/results",
});
console.log(result.reportPath);
console.log(result.findings.findings.length);
} finally {
await security.close();
Differences from Traditional Tools
Traditional SAST/DAST tools rely on rules and signatures, which can easily generate a lot of noise; pure LLM tools often give suggestions that "seem reasonable but are actually irrelevant" due to a lack of project context. The key to Codex Security lies in: First, building an editable project threat model (what the system does, what it trusts, and where the exposure surface is). Second, using the threat model to guide searches, rather than blindly scanning. Third, validating high-confidence issues in a sandbox. Fourth, remediation suggestions consider system intent and surrounding code to reduce regression risk. Fifth, supporting user feedback (adjusting severity, marking false positives) allows for learning in subsequent scans. It's more like a "security researcher who understands your business" than a long list of alerts. **Usage Notes and Boundaries** **Permissions and Trust Boundaries:** Only scan repositories you own or have explicitly authorized access to. The tool runs as a local user; scan results may contain sensitive code snippets and reproduction steps. Please keep the output directory safe. **Adjustable Threat Model:** Users are encouraged to supplement architecture documents, security policies, or directly edit threat models to make the results more closely reflect real risks. **Cost and Coverage:** Deep scans are more time-consuming and costly; regular scans are suitable for daily use. The budget can be controlled using `--max-cost`. Security Strategy: The tool itself also has a clear threat model and security policy documentation, emphasizing "only reviewing code that you trust and have the authority to review." Codex Security represents a new direction for AI in the field of application security: not replacing security engineers, but automating the closed loop of "discovery-verification-remediation," allowing security teams to focus their efforts on truly high-value issues. For teams already coding with Codex, this is almost a natural extension; for organizations with close security and engineering collaborations, it provides a implementable, iterative, and feedback-driven security agent workflow. The tool itself does not guarantee the discovery of all vulnerabilities, nor can it replace professional security assessments and penetration testing. It is better suited as a high-signal auxiliary layer in daily development and security processes.