Fork of openai/codex-security that
runs scans through OpenRouter with
moonshotai/kimi-k3 as the default model.
This is not the published @openai/codex-security npm package. Build and
run it from this repository.
Requires Node.js 22 or later, Python 3.10 or later, pnpm, and an OpenRouter API key.
git clone https://github.com/marcopesani/codex-security.git
cd codex-security/sdk/typescript
pnpm install
pnpm build
export OPENROUTER_API_KEY=...
node ./bin/codex-security.mjs scan /path/to/repository
node ./bin/codex-security.mjs scan /path/to/repository --model moonshotai/kimi-k3 --effort highOptional: link the local CLI onto your PATH after building:
pnpm link --global
codex-security scan /path/to/repositoryScan history is stored in the Codex Security workbench state directory. If that
directory cannot be written, set CODEX_SECURITY_STATE_DIR to a writable
directory outside the repository.
After pnpm build in sdk/typescript, import from the local package (or link
it into your app):
import { CodexSecurity } from "@openai/codex-security";
const security = new CodexSecurity();
const result = await security.run(".");
console.log(result.reportPath);
await security.close();For CLI options, authentication, and the local security model, see sdk/typescript/README.md.