openai/codex-security
OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript★ 12,594+643 that day#2 on trending
C60/100
Duplication86
1.8% in typescript, python, javascript, rust, bash, tsx, powershell, docker, batchDead code74
3.3%Complexity34
77.7% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
0.55%duplicated code · 1,023 of 186,555 lines
44clones in code
567code files of 1,534 scanned
1.85%duplicated over all files · 1,028 clones
Most complex files
- sdk/typescript/src/cli.ts2811 cx
- sdk/typescript/tests-ts/api.test.ts2627 cx
- sdk/typescript/src/api.ts1470 cx
- plugins/codex-security/scripts/workbench/retained_coverage.py1287 cx
- sdk/typescript/src/cost.ts1235 cx
- sdk/typescript/src/runtime.ts1064 cx
- plugins/codex-security/mcp-app/src/artifact-scan-draft.ts1048 cx
- plugins/codex-security/scripts/finalize_scan_contract.py949 cx
- sdk/typescript/tests-ts/external-findings-publish.test.ts805 cx
- sdk/typescript/tests-ts/cost.test.ts696 cx
Dead code 3.34% unused · 215 findings
- plugins/codex-security/mcp-app/src/sealed-contract.tsunused-file
- plugins/codex-security/native/proof-process-windows.mtsunused-file
- evals/secret-discovery/test_discovery.mtsunused-file
- sdk/typescript/src/patch-tui.tsxunused-file
- evals/secret-discovery/test_runtime.mtsunused-file
- evals/standard-time-budget/test_grading.mtsunused-file
- plugins/codex-security/native/proof-windows.mtsunused-file
- plugins/codex-security/mcp-app/src/workbench/local-dedupe.tsunused-file
- plugins/codex-security/native/proof-windows-wide.mtsunused-file
- evals/secret-discovery/harness.mtsunused-file
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 434 lines in 2 placestypescript1,971 tokens
3export interface ScanManifest { 4 documentType: "codex-security.scan-manifest"; 5 schemaVersion: "1.0"; 6 scan: { 7 id: string; 8 producer: { 9 name: string; 10 version: string; 11 [k: string]: unknown; 12 };First 10 of 434 lines.
- 110 lines in 2 placestypescript522 tokensplugins/codex-security/mcp-app/src/contract-values.ts:1–110sdk/typescript/src/contract-values.ts:2–111
1import { hash } from "node:crypto"; 2import { isAbsolute, posix } from "node:path"; 3import type { Finding } from "./models.js"; 4import { isWindowsUnsafePathComponent } from "./windows-path.js"; 5 6export class SealedContractError extends Error { 7 constructor(message: string, options?: ErrorOptions) { 8 super(message, options); 9 this.name = new.target.name; 10 }First 10 of 110 lines.
- 54 lines in 2 placestypescript268 tokens
1import { parse, toNamespacedPath } from "node:path"; 2 3// SQLite's default win32 VFS allows MAX_PATH * 4 UTF-8 bytes, including room for "-journal". 4const SQLITE_WINDOWS_MAX_FILENAME_BYTES = 260 * 4 - 8; 5 6export function sqliteFilename(path: string): string { 7 // Ordinary paths also preserve Win32 handling of device names and trailing spaces or dots. 8 if ( 9 process.platform !== "win32" || 10 path.length + 8 < 260 ||First 10 of 54 lines.
7 more
- 47 lines in 2 placestypescript232 tokens
- 24 lines in 2 placestypescript184 tokens
- 12 lines in 3 placestypescript57 tokens
- 27 lines in 2 placestypescript109 tokens
- 9 lines in 2 placespython75 tokens
- 8 lines in 2 placespython75 tokens
- 8 lines in 2 placestypescript71 tokens
Largest clones over all files, tests and data included
- 434 lines in 2 placestypescript1,971 tokens
3export interface ScanManifest { 4 documentType: "codex-security.scan-manifest"; 5 schemaVersion: "1.0"; 6 scan: { 7 id: string; 8 producer: { 9 name: string; 10 version: string; 11 [k: string]: unknown; 12 };First 10 of 434 lines.
- 226 lines in 2 placesjsondata files799 tokensplugins/codex-security/mcp-app/src/deep-scan/project-config.schema.json:1–226sdk/typescript/schemas/project-config.schema.json:1–226
1{ 2 "$schema": "http://json-schema.org/draft-07/schema#", 3 "type": "object", 4 "properties": { 5 "$schema": { 6 "description": "Editor schema URI or relative path. The CLI does not fetch or select a validator from this value.", 7 "type": "string", 8 "minLength": 1 9 }, 10 "auth": {First 10 of 226 lines.
- 10 lines in 12 placestypescripttests60 tokenssdk/typescript/tests-ts/api.test.ts:5945–5954sdk/typescript/tests-ts/api.test.ts:6253–6262sdk/typescript/tests-ts/api.test.ts:6351–6360sdk/typescript/tests-ts/api.test.ts:6693–6702sdk/typescript/tests-ts/api.test.ts:6797–6806and 7 more
5945 pollAllowed.resolve(); 5946 } 5947 return { events: completedEvents("thread-1", events()) }; 5948 }), 5949}); 5950// The fake stream has no process handle to keep the unref'ed poll alive. 5951const keepAlive = setInterval(() => {}, 1_000); 5952try { 5953 await client.run(repository, { 5954 onProgress: (update) => updates.push(update), - 86 lines in 2 placesyamldocs and examples643 tokens
- 34 lines in 2 placesmarkupmarkup580 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 430 | 138,497 | 27 | 874 | 0.63% |
| python | 53 | 34,188 | 13 | 115 | 0.34% |
| javascript | 57 | 9,847 | 4 | 34 | 0.35% |
| rust | 7 | 2,194 | 0 | 0 | 0% |
| bash | 18 | 1,054 | 0 | 0 | 0% |
| tsx | 1 | 768 | 0 | 0 | 0% |
| powershell | 1 | 7 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 895 | 447,256 | 799 | 8,597 | 1.92% |
| python | 158 | 102,601 | 180 | 1,704 | 1.66% |
| yaml | 74 | 7,628 | 15 | 230 | 3.02% |
| json | 61 | 9,591 | 11 | 442 | 4.61% |
| markup | 3 | 962 | 9 | 170 | 17.67% |
| javascript | 105 | 16,983 | 7 | 57 | 0.34% |
| markdown | 141 | 17,739 | 6 | 54 | 0.3% |
| txt | 4 | 86 | 1 | 17 | 19.77% |
| rust | 8 | 2,745 | 0 | 0 | 0% |
| bash | 60 | 1,866 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Nov 13, 2026 | #2 | 12,594 (+643) | 1,534 | 609,788 | 1,028 | 1.85% | 0.55% | C 60 | 4822a9c |
| Nov 12, 2026 | #7 | 11,883 (+52) | 1,529 | 608,712 | 1,024 | 1.84% | 0.55% | C 60 | 2911786 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.