Skip to content

Instantly share code, notes, and snippets.

@up1
Last active July 30, 2026 05:55
Show Gist options
  • Select an option

  • Save up1/c3fe112418eb7e46923355ba963aa885 to your computer and use it in GitHub Desktop.

Select an option

Save up1/c3fe112418eb7e46923355ba963aa885 to your computer and use it in GitHub Desktop.
Codex Security CLI
// Install in prject
$npm install @OpenAI/codex-security
// Run
$npx @openai/codex-security scan --help
codex-security scan — Run a Codex Security scan.
Usage: codex-security scan [repository] [options]
Arguments:
repository Repository root to scan (default: current directory).
Options:
--auth <auto|chatgpt|api-key> Select automatic, ChatGPT, or API-key authentication. (default: auto)
--path <array> Scan only PATH; repeat for multiple paths.
--knowledge-base <array> Read security docs; repeat for multiple paths.
--diff <string> Scan Git changes from BASE to --head.
--working-tree Scan staged and unstaged changes.
--head <string> Git head ref for --diff.
--base <string> Git base ref for --working-tree.
--mode <standard|deep> Scan mode. (default: standard)
--model <string> OpenAI model to use (default: gpt-5.6-sol).
--effort <minimal|low|medium|high|xhigh> Model reasoning effort (default: xhigh).
$npx @openai/codex-security login
$npx @openai/codex-security scan .
$npx @openai/codex-security scan . --model gpt-5.6-terra --effort high
// ตัวอย่างการใช้งานผ่าน API Key
$export OPENAI_API_KEY=<your key>
$npx @openai/codex-security scan workshop/demo-orders
[00:00] Preparing scan
[00:00] Authentication: API key from OPENAI_API_KEY.
[00:00] To use your ChatGPT sign-in, retry with --auth chatgpt.
[00:00] Preparing scan
[00:34] Running scan
[00:34] Preflight: worker delegation supported (up to 8 worker slots).
[00:43] Running scan
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment