codex-manual.md +213 −49
3855npx @openai/codex-security scans rerun BASELINE_SCAN_ID3855npx @openai/codex-security scans rerun BASELINE_SCAN_ID
3856```3856```
3857 3857
3858The rerun keeps the original scan configuration and requires the same plugin
3859version. If the installed plugin has changed, the command stops.
3860
3858Compare the baseline with the new scan:3861Compare the baseline with the new scan:
3859 3862
3860```bash3863```bash
3904 3907
3905#### Automation and cost3908#### Automation and cost
3906 3909
3910#### How do deep-scan time limits work
3911
3912Set a discovery deadline when starting a deep scan:
3913
3914```bash
3915npx @openai/codex-security scan . --mode deep --max-time-hours 1.5
3916```
3917
3918The default is `96` hours. Use any positive value up to `96`, including
3919fractions. The limit applies only to discovery, so validation and reporting
3920can continue after the deadline. If no source review finishes, the report
3921records partial coverage and the CLI returns exit code `2`.
3922
3923For persistent settings or bulk campaigns, set `max_time_hours` under
3924`[deep_scan]` in the [deep-scan
3925configuration](https://learn.chatgpt.com/docs/security/cli/reference#configure-deep-scans).
3926
3907#### How do scan cost limits work3927#### How do scan cost limits work
3908 3928
3909Set an estimated cost limit in USD before starting the scan:3929Set an estimated cost limit in USD before starting the scan:
3913```3933```
3914 3934
3915The limit is an estimate, not a hard spending cap. Requests already in3935The limit is an estimate, not a hard spending cap. Requests already in
39163936progress can finish above the limit. Codex Security keeps available resultsprogress can finish above it. If a deep scan reaches the limit after discovery
39173937when the scan stops.finishes, the CLI saves the completed report with partial coverage and exits
3938with code `2`. Otherwise, it preserves any available partial output.
3918 3939
3919#### Can scans check commits and pull requests3940#### Can scans check commits and pull requests
3920 3941
3959 3980
3960#### Check the prerequisites3981#### Check the prerequisites
3961 3982
39623983The CLI requires Node.js 22.13.0 or later. Running a scan or exporting findingsThe CLI requires Node.js 22 (22.13.0 or later), 24, or 26. Scans, bulk scans,
39633984also requires Python 3.10 or later. For more detail, see [Authentication andexports, scan history, and saved findings also require Python 3.10 or later.
3985For more detail, see [Authentication and
3964prerequisites](https://learn.chatgpt.com/docs/security/cli/reference#authentication-and-prerequisites).3986prerequisites](https://learn.chatgpt.com/docs/security/cli/reference#authentication-and-prerequisites).
3965 3987
3966#### Set up and verify the CLI3988#### Set up and verify the CLI
3971npx @openai/codex-security --version3993npx @openai/codex-security --version
3972```3994```
3973 3995
3996To see both the package version and the version of its bundled plugin, run:
3997
3998```bash
3999npx @openai/codex-security info --json
4000```
4001
3974List the available commands:4002List the available commands:
3975 4003
3976```bash4004```bash
4021 4049
4022#### Prepare a scan4050#### Prepare a scan
4023 4051
40244052Choose a repository to scan and a directory to write results.Choose a repository you trust and have permission to assess. Scans use your
4053local operating-system permissions and don't pause for approval. Scan
4054processes can inherit your environment, so remove unrelated credentials before
4055you start. See [Local scan
4056permissions](https://learn.chatgpt.com/docs/security/cli/reference#local-scan-permissions).
4057
4058Choose a directory outside the repository for the scan results:
4025 4059
4026```bash4060```bash
4027REPOSITORY=/path/to/repository4061REPOSITORY=/path/to/repository
4165 --workers 2 \4199 --workers 2 \
4166 --subagents 0 \4200 --subagents 0 \
4167 --stop-after-no-new 3 \4201 --stop-after-no-new 3 \
41684202 --max-discovery-runs 10 --max-discovery-runs 10 \
4203 --max-time-hours 1.5
4169```4204```
4170 4205
4171These options require deep mode, which supports repository and path targets,4206These options require deep mode, which supports repository and path targets,
4172not diff or working-tree scans. Here, `--workers` controls discovery workers4207not diff or working-tree scans. Here, `--workers` controls discovery workers
4173within one scan; `bulk-scan --workers` controls concurrent repository scans.4208within one scan; `bulk-scan --workers` controls concurrent repository scans.
4209`--max-time-hours` accepts a positive number up to `96`, including fractional
4210hours. When discovery reaches that limit, the scan preserves completed work
4211and continues with validation and reporting.
4174 4212
4175#### Add architecture and security context4213#### Add architecture and security context
4176 4214
4196```4234```
4197 4235
4198The follow-up runs in the same authenticated session after successful scans4236The follow-up runs in the same authenticated session after successful scans
41994237and scans with incomplete coverage or errors. It doesn't run after cancellationand scans with incomplete coverage or errors. If the follow-up fails, the CLI
42004238or a scan that reaches its cost limit. Both options also work withreports a warning and keeps the completed scan. It doesn't run after
42014239`bulk-scan`; a CSV `prompt` column adds repository-specific instructions.cancellation or a scan that reaches its cost limit. Both options also work
4240with `bulk-scan`; a CSV `prompt` column adds repository-specific instructions.
4202 4241
4203#### Set a scan budget4242#### Set a scan budget
4204 4243
4209npx @openai/codex-security scan "$REPOSITORY" --max-cost 54248npx @openai/codex-security scan "$REPOSITORY" --max-cost 5
4210```4249```
4211 4250
42124251Requests already in progress can finish slightly above the limit. If a scanRequests already in progress can finish slightly above the limit. If a deep
42134252aborts due to the cost limit, partial scan results remain available on disk.scan reaches the limit after discovery finishes, the CLI saves the completed
4253report, marks its coverage as `partial`, and returns exit code `2`. If the
4254scan can't produce a completed report, any available partial output stays on
4255disk.
4214 4256
4215#### Scan changes before each commit4257#### Scan changes before each commit
4216 4258
4359[CLI quickstart](https://learn.chatgpt.com/docs/security/cli).4401[CLI quickstart](https://learn.chatgpt.com/docs/security/cli).
4360 4402
4361The `@openai/codex-security` package is public. Running scans requires Codex4403The `@openai/codex-security` package is public. Running scans requires Codex
43624404Security access.Security access. Scans use your local permissions and don't pause for
4405approval. Before you start, review [Local scan
4406permissions](#local-scan-permissions).
4363 4407
4364Run the CLI with `npx @openai/codex-security`.4408Run the CLI with `npx @openai/codex-security`.
4365 4409
4465 [--post-scan-prompt-file FILE]4509 [--post-scan-prompt-file FILE]
4466 [--mode {standard,deep}] [--workers N]4510 [--mode {standard,deep}] [--workers N]
4467 [--subagents N] [--stop-after-no-new N]4511 [--subagents N] [--stop-after-no-new N]
44684512 [--max-discovery-runs N] [--model MODEL] [--max-discovery-runs N] [--max-time-hours HOURS]
4513 [--model MODEL]
4469 [--effort {minimal,low,medium,high,xhigh}]4514 [--effort {minimal,low,medium,high,xhigh}]
4470 [--output-dir DIR]4515 [--output-dir DIR]
4471 [--archive-existing]4516 [--archive-existing]
4601| `--subagents N` | Subagents available to each discovery worker. Defaults to `3`. |4646| `--subagents N` | Subagents available to each discovery worker. Defaults to `3`. |
4602| `--stop-after-no-new N` | Stop after `N` consecutive runs find no new issues. Defaults to `6`. |4647| `--stop-after-no-new N` | Stop after `N` consecutive runs find no new issues. Defaults to `6`. |
4603| `--max-discovery-runs N` | Limit on total discovery runs. Defaults to `60`. |4648| `--max-discovery-runs N` | Limit on total discovery runs. Defaults to `60`. |
4649| `--max-time-hours HOURS` | Discovery time limit in hours. Defaults to `96`; accepts fractions. |
4604 4650
46054651`--subagents` accepts zero or a positive integer. The other options require a`--subagents` accepts zero or a positive integer. `--max-time-hours` accepts a
46064652positive integer. These options aren't available for standard scans.positive number no greater than `96`. The remaining options require a positive
4653integer. These options aren't available for standard scans.
4607 4654
46084655For example, limit a deep scan to two discovery workers and ten total runs:For example, use two discovery workers, allow up to ten runs, and stop
4656discovery after 1.5 hours:
4609 4657
4610```bash4658```bash
4611npx @openai/codex-security scan . \4659npx @openai/codex-security scan . \
4613 --workers 2 \4661 --workers 2 \
4614 --subagents 0 \4662 --subagents 0 \
4615 --stop-after-no-new 3 \4663 --stop-after-no-new 3 \
46164664 --max-discovery-runs 10 --max-discovery-runs 10 \
4665 --max-time-hours 1.5
4617```4666```
4618 4667
4668The time limit applies only to discovery. When it expires, the scan stops
4669unfinished discovery, keeps completed discovery results, and continues with
4670validation and reporting. If no source review finishes, the scan records
4671partial coverage and returns exit code `2`.
4672
4619Set persistent defaults in `~/.codex/codex-security/config.toml`, or in4673Set persistent defaults in `~/.codex/codex-security/config.toml`, or in
4620`$CODEX_HOME/codex-security/config.toml` when you set `CODEX_HOME`:4674`$CODEX_HOME/codex-security/config.toml` when you set `CODEX_HOME`:
4621 4675
4625subagents = 04679subagents = 0
4626stop_after_no_new = 34680stop_after_no_new = 3
4627max_discovery_runs = 104681max_discovery_runs = 10
4682max_time_hours = 1.5
4628```4683```
4629 4684
4630Command-line options override these defaults. `scan --workers` controls4685Command-line options override these defaults. `scan --workers` controls
4631discovery workers within one scan; `bulk-scan --workers` controls concurrent4686discovery workers within one scan; `bulk-scan --workers` controls concurrent
46324687repository scans.repository scans. Set `stop_after_consecutive_errors` only in the TOML file;
4688its default is `3`.
4633 4689
4634#### Add security context4690#### Add security context
4635 4691
4662 4718
4663For example, use the scan prompt to focus on authorization boundaries and ask4719For example, use the scan prompt to focus on authorization boundaries and ask
4664the follow-up to write a new `post-scan-summary.md` in the scan directory.4720the follow-up to write a new `post-scan-summary.md` in the scan directory.
4721If the follow-up fails, the CLI reports a warning and keeps the completed scan.
4665The follow-up doesn't run after cancellation or when the scan reaches its cost4722The follow-up doesn't run after cancellation or when the scan reaches its cost
4666limit.4723limit.
4667 4724
4684| `--full-output` | Print the complete result using the default structured output format. |4741| `--full-output` | Print the complete result using the default structured output format. |
4685 4742
4686The cost limit is an estimate, not a hard spending cap. Requests already in4743The cost limit is an estimate, not a hard spending cap. Requests already in
46874744progress can finish slightly above the limit. If a scan aborts due to the costprogress can finish slightly above the limit. If a deep scan reaches the limit
46884745limit, partial scan results remain available on disk.after discovery finishes, the CLI seals the available results, marks coverage
4746as `partial`, and returns exit code `2`. Otherwise, it returns `2` and leaves
4747any available partial output on disk.
4689 4748
4690When you omit `--output-dir`, results persist under4749When you omit `--output-dir`, results persist under
4691`$CODEX_HOME/state/plugins/codex-security/scans/`. `CODEX_HOME`4750`$CODEX_HOME/state/plugins/codex-security/scans/`. `CODEX_HOME`
4882npx @openai/codex-security scans rerun SCAN_ID4941npx @openai/codex-security scans rerun SCAN_ID
4883```4942```
4884 4943
4944The rerun requires the plugin version recorded by the original scan. If the
4945installed version differs, the command stops instead of running with a
4946different plugin.
4947
4885#### Inspect saved scan logs4948#### Inspect saved scan logs
4886 4949
48874950Read the complete saved session events for a scan and its workers:Read the complete saved session events for a scan and its workers. These logs
4951aren't redacted and can contain source code or credentials, so review them
4952before sharing:
4888 4953
4889```bash4954```bash
4890npx @openai/codex-security scans logs SCAN_ID4955npx @openai/codex-security scans logs SCAN_ID
5241write the available results to stdout. The CLI prints the location of any5306write the available results to stdout. The CLI prints the location of any
5242partial output after an interruption or runtime error.5307partial output after an interruption or runtime error.
5243 5308
5309#### Local scan permissions
5310
5311CLI and SDK scans run with your local operating-system permissions. Every scan
5312uses the `codex_security_scan` filesystem profile and sets `approvalPolicy` to
5313`"never"`. The profile permits reading the local filesystem and writing to
5314workspace roots and the selected scan state directory. Scans don't stop to
5315request interactive approval.
5316
5317Settings supplied through CLI `--codex` or SDK `codexOverrides`, including
5318`approval_policy`, `sandbox_mode`, and filesystem permissions, can't replace
5319or restrict these scan controls. Host and network restrictions still apply.
5320
5321Scan and workbench processes can inherit your environment, including unrelated
5322API tokens and cloud credentials. Scan only repositories you trust and have
5323permission to assess, and provide only the credentials the scan requires.
5324
5244#### Authentication and prerequisites5325#### Authentication and prerequisites
5245 5326
5246Set `OPENAI_API_KEY` or `CODEX_API_KEY`, sign in with5327Set `OPENAI_API_KEY` or `CODEX_API_KEY`, sign in with
5254 5335
5255For CI, keep the API key scoped to the scan step and use a trusted workflow.5336For CI, keep the API key scoped to the scan step and use a trusted workflow.
5256 5337
52575338The CLI requires Node.js 22.13.0 or later. Running a scan or exporting findingsThe CLI requires Node.js 22 (22.13.0 or later), 24, or 26. Scans, bulk scans,
52585339also requires Python 3.10 or later. Python 3.10 also requires `tomli`. Useexports, scan history, and saved findings also require Python 3.10 or later.
52595340`--python` or `PYTHON` to select an interpreter when automatic discovery isPython 3.10 also requires `tomli`. Use `--python` with `scan`, `bulk-scan`, or
52605341unsuitable.`export`, or set `PYTHON` for any Python-backed command.
5261 5342
5262Continue with the [CLI quickstart](https://learn.chatgpt.com/docs/security/cli), [bulk-scan5343Continue with the [CLI quickstart](https://learn.chatgpt.com/docs/security/cli), [bulk-scan
5263guide](https://learn.chatgpt.com/docs/security/cli/bulk-scans), [CLI FAQ](https://learn.chatgpt.com/docs/security/cli/faq), [CI5344guide](https://learn.chatgpt.com/docs/security/cli/bulk-scans), [CLI FAQ](https://learn.chatgpt.com/docs/security/cli/faq), [CI
5477 5558
5478Source: [Codex Security plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog.md)5559Source: [Codex Security plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog.md)
5479 5560
54805561Use this changelog to see what changed in Codex Security and which pluginUse this changelog to see what changed in the Codex Security plugin.
5481versions are available from each installation source.
5482 5562
54835563**Latest release in the hosted Codex Security catalog:** `0.1.18`.**Latest plugin version:** `0.1.19`.
5484 5564
5485Check the plugin version in your current Codex environment before you use a5565Check the plugin version in your current Codex environment before you use a
54865566feature from a newer release. Reopening or rerunning a saved scan doesn't pinfeature from a newer release.
54875567the installed plugin version.
5568Changelog entries follow the plugin version, not the package version. CLI and
5569SDK users can run `npx @openai/codex-security info --json` to check the
5570package and bundled plugin versions together.
5571
5572#### 0.1.19 (August 13, 2026)
5573
5574#### Set a time limit for deep scans
5488 5575
54895576These versions apply to the Codex Security plugin. The Codex app, Codex CLI,- Set `[deep_scan].max_time_hours` to a positive duration of up to 96 hours.
54905577TypeScript SDK, and plugin app have separate version numbers. You can use fractional hours.
5578- Keep completed discovery results when the deadline expires, then continue
5579 with validation and reporting.
5580- Mark the report as partial if no source review finishes before the deadline.
5581
5582#### Improve scan reliability
5583
5584- Keep completed discovery work when a worker stops or a reducer retries.
5585- Read larger source files and generate reports without the previous fixed
5586 size limits.
5587- Read committed changes from the selected revision and preserve
5588 repository-relative paths on Windows.
5589- Pass OpenRouter and Fireworks credentials to deep-scan workers.
5491 5590
5492#### 0.1.18 (August 7, 2026)5591#### 0.1.18 (August 7, 2026)
5493 5592
5834To install Codex Security for a local repository, use the ChatGPT desktop app5933To install Codex Security for a local repository, use the ChatGPT desktop app
5835or Codex CLI.5934or Codex CLI.
5836 5935
58375936The hosted desktop-app catalog and public Codex CLI marketplace can offerCheck the [plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) before you rely
58385937different plugin versions. Check the [pluginon a feature or start a long-running scan. If **Security** doesn't appear in
58395938changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) before you rely on a feature orthe desktop-app sidebar, update the app and plugin and confirm that the plugin
58405939start a long-running scan. If **Security** doesn't appear in the desktop-appis enabled.
5841sidebar, update the app and plugin and confirm that the plugin is enabled.
5842 5940
5843#### Run your first scan5941#### Run your first scan
5844 5942
5962findings, coverage details, and paths to scan artifacts. For longer scans, it6060findings, coverage details, and paths to scan artifacts. For longer scans, it
5963supports preflight checks, cost limits, progress callbacks, and cancellation.6061supports preflight checks, cost limits, progress callbacks, and cancellation.
5964 6062
59656063The SDK uses ECMAScript modules (ESM) and runs server-side with Node.js 22.13.0The SDK uses ECMAScript modules (ESM) and runs server-side with Node.js 22
59666064or later. Scanning also requires Python 3.10 or later.(22.13.0 or later), 24, or 26. Scanning also requires Python 3.10 or later.
6065Python 3.10 also requires the `tomli` package.
5967 6066
5968The Codex Security SDK is [publicly available on6067The Codex Security SDK is [publicly available on
5969GitHub](https://github.com/openai/codex-security). Running scans requires6068GitHub](https://github.com/openai/codex-security). Running scans requires
5991 6090
5992#### Run a scan6091#### Run a scan
5993 6092
6093Scan only repositories you trust and have permission to assess. The SDK runs
6094with your local operating-system permissions and never pauses for approval.
6095Scan processes can inherit your environment, so remove unrelated credentials
6096before you start. See [Local scan
6097permissions](https://learn.chatgpt.com/docs/security/cli/reference#local-scan-permissions).
6098
5994Create one `CodexSecurity` client, run a standard repository scan, and close6099Create one `CodexSecurity` client, run a standard repository scan, and close
5995the client when the work completes. Pass `outputDir` to choose a private6100the client when the work completes. Pass `outputDir` to choose a private
5996results directory outside the enclosing Git worktree.6101results directory outside the enclosing Git worktree.
6134 subagents: 0,6239 subagents: 0,
6135 stopAfterNoNew: 3,6240 stopAfterNoNew: 3,
6136 maxDiscoveryRuns: 10,6241 maxDiscoveryRuns: 10,
6242 maxTimeHours: 1.5,
6137});6243});
6138```6244```
6139 6245
6140Deep mode supports repository and path targets. Use standard mode for diff and6246Deep mode supports repository and path targets. Use standard mode for diff and
6141working-tree scans. The optional settings control concurrent discovery workers,6247working-tree scans. The optional settings control concurrent discovery workers,
6142subagents per worker, consecutive discovery runs without new findings, and the6248subagents per worker, consecutive discovery runs without new findings, and the
61436249total number of discovery runs. They require `mode: "deep"`.total number and duration of discovery runs. They require `mode: "deep"`.
6250
6251`maxTimeHours` defaults to `96` and accepts a positive number up to `96`,
6252including fractional hours. At the deadline, Codex Security stops unfinished
6253discovery, keeps completed discovery results, and continues with validation
6254and reporting. Review `result.coverage.completeness` before treating a
6255time-limited scan as evidence of full coverage.
6144 6256
6145#### Add a security knowledge base6257#### Add a security knowledge base
6146 6258
6172});6284});
6173```6285```
6174 6286
6287If the follow-up fails, the SDK keeps the completed scan and reports the
6288error through `onWarning`. It restores any completed scan artifacts that the
6289follow-up changed.
6290
6175#### Set a scan budget6291#### Set a scan budget
6176 6292
6177Set `maxCostUsd` to stop a scan when its estimated model cost exceeds a limit.6293Set `maxCostUsd` to stop a scan when its estimated model cost exceeds a limit.
6189```6305```
6190 6306
6191The limit estimates spending but isn't a hard cap, so requests already in6307The limit estimates spending but isn't a hard cap, so requests already in
61926308progress can finish slightly above it. If the scan exceeds the limit, the SDKprogress can finish slightly above it. If a deep scan reaches the limit after
61936309throws `ScanCostLimitExceededError` and preserves the available results.discovery finishes, `run` returns a result with `coverage.completeness` set to
6310`"partial"` and reports the budget warning through `onWarning`.
6311
6312If the scan can't produce a completed partial result, `run` throws
6313`ScanCostLimitExceededError` and preserves any available output.
6194 6314
6195#### Work with scan results6315#### Work with scan results
6196 6316
6215| `sarifPath` | The generated SARIF path, or `null` when SARIF is absent. |6335| `sarifPath` | The generated SARIF path, or `null` when SARIF is absent. |
6216| `pluginVersion` | The version recorded by the scan producer. |6336| `pluginVersion` | The version recorded by the scan producer. |
6217 6337
6338To require the same plugin for a later scan, pass
6339`expectedPluginVersion: result.pluginVersion`. The SDK rejects the scan if
6340the installed plugin version differs.
6341
6218Use the structured findings and coverage directly:6342Use the structured findings and coverage directly:
6219 6343
6220```ts6344```ts
6352Bedrock](https://learn.chatgpt.com/docs/security/cli/reference#use-amazon-bedrock), set6476Bedrock](https://learn.chatgpt.com/docs/security/cli/reference#use-amazon-bedrock), set
6353`model_provider` and `model` in `codexOverrides`.6477`model_provider` and `model` in `codexOverrides`.
6354 6478
6479`codexOverrides` can't restrict the scan's filesystem access or change its
6480approval policy. See [Local scan
6481permissions](https://learn.chatgpt.com/docs/security/cli/reference#local-scan-permissions).
6482
6355For OpenRouter or Fireworks, also provide the matching API key and a complete6483For OpenRouter or Fireworks, also provide the matching API key and a complete
6356provider configuration in `codexOverrides`. For example, set6484provider configuration in `codexOverrides`. For example, set
6357`OPENROUTER_API_KEY` and configure OpenRouter:6485`OPENROUTER_API_KEY` and configure OpenRouter:
6891codex plugin add codex-security@openai-curated7019codex plugin add codex-security@openai-curated
6892```7020```
6893 7021
68947022The install command uses the public Codex CLI plugin marketplace, which canThe install command uses the public Codex CLI plugin marketplace. Check the
6895offer a different version from the hosted desktop-app catalog. Check the
6896[plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) before you depend on a7023[plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) before you depend on a
6897specific plugin version or feature in CI.7024specific plugin version or feature in CI.
6898 7025
7343subagents = 07470subagents = 0
7344stop_after_no_new = 37471stop_after_no_new = 3
7345max_discovery_runs = 107472max_discovery_runs = 10
7473max_time_hours = 1.5
7346```7474```
7347 7475
7348| Setting | Default | Description |7476| Setting | Default | Description |
73497477| -------------------- | ------- | ------------------------------------------------------------------------------------------------ || ------------------------------- | ------- | ------------------------------------------------------------------------------------------------ |
7350| `workers` | `auto` | Number of discovery workers allowed to run at the same time. Set a positive integer or `"auto"`. |7478| `workers` | `auto` | Number of discovery workers allowed to run at the same time. Set a positive integer or `"auto"`. |
7351| `subagents` | `3` | Number of subagents each discovery worker may start. Set `0` to disable them. |7479| `subagents` | `3` | Number of subagents each discovery worker may start. Set `0` to disable them. |
7352| `stop_after_no_new` | `6` | Stop discovery after this many consecutive runs produce no new candidates. |7480| `stop_after_no_new` | `6` | Stop discovery after this many consecutive runs produce no new candidates. |
7481| `stop_after_consecutive_errors` | `3` | Stop discovery after this many consecutive worker errors. |
7353| `max_discovery_runs` | `60` | Limit on discovery runs before the scan moves to validation. |7482| `max_discovery_runs` | `60` | Limit on discovery runs before the scan moves to validation. |
7483| `max_time_hours` | `96` | Limit discovery to a positive number of hours up to `96`; use fractions as needed. |
7354 7484
7355Lower values can reduce scan time and token use but may miss findings.7485Lower values can reduce scan time and token use but may miss findings.
7356Configuration changes apply to new deep scans, not scans already in progress.7486Configuration changes apply to new deep scans, not scans already in progress.
7357 7487
7488The time limit applies only to discovery. When it expires, Codex Security
7489stops unfinished discovery, keeps completed results, and continues with
7490validation and reporting. If no source review finishes before the deadline,
7491the report records partial coverage.
7492
7493The `max_time_hours` setting requires plugin version `0.1.19` or later. See the
7494[plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) for release details.
7495
7358#### Start the deep scan7496#### Start the deep scan
7359 7497
7360In the desktop app, open **Security**, select **Scans**, and select **+ Scan**.7498In the desktop app, open **Security**, select **Scans**, and select **+ Scan**.
7529Use `--mode deep` to select deep scanning for rows without their own `mode`.7667Use `--mode deep` to select deep scanning for rows without their own `mode`.
7530Each CSV row can still choose its own scan mode and repository scope.7668Each CSV row can still choose its own scan mode and repository scope.
7531 7669
7670Set `[deep_scan].max_time_hours` to limit discovery for each deep scan in the
7671campaign. The `--max-time-hours` flag works with `scan`, not `bulk-scan`.
7672
7532The CLI checks out each pinned revision, scans the selected target, records the7673The CLI checks out each pinned revision, scans the selected target, records the
7533result, and removes the temporary repository checkout. A repository counts as7674result, and removes the temporary repository checkout. A repository counts as
7534complete only when its scan has complete coverage and all required result7675complete only when its scan has complete coverage and all required result
7733variable. Keep the credential scoped to the scan process and use7874variable. Keep the credential scoped to the scan process and use
7734`--auth api-key` to select it explicitly.7875`--auth api-key` to select it explicitly.
7735 7876
7877Run the workflow only for repositories and pull requests you trust. Scans use
7878the runner's local permissions and don't pause for approval. Scan processes
7879can inherit the job environment, so keep unrelated tokens and cloud
7880credentials out of it.
7881
7736The runner needs:7882The runner needs:
7737 7883
77387884- Node.js 22.13.0 or later.- Node.js 22 (22.13.0 or later), 24, or 26.
7739- Python 3.10 or later.7885- Python 3.10 or later.
7740- The published `@openai/codex-security` package, installed outside the7886- The published `@openai/codex-security` package, installed outside the
7741 repository checkout.7887 repository checkout.
19737 19883
19738If you support CIMD, set `client_id_metadata_document_supported: true` in your authorization server metadata. This lets ChatGPT use one stable client identity for connectors that choose CIMD, which your authorization server can use for redirect URI allowlists, rate limits, and other policies.19884If you support CIMD, set `client_id_metadata_document_supported: true` in your authorization server metadata. This lets ChatGPT use one stable client identity for connectors that choose CIMD, which your authorization server can use for redirect URI allowlists, rate limits, and other policies.
19739 19885
1974019886ChatGPT's production CIMD document advertises both supported client authentication methods using the [OpenID Connect RP Metadata Choices](https://openid.net/specs/openid-connect-rp-metadata-choices-1_0-final.html) client metadata field:ChatGPT is adopting the CIMD transition proposed in
19887[MCP SEP-3149](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/3149).
19888Its production CIMD document publishes
19889`token_endpoint_auth_methods_supported` as an array of methods that ChatGPT
19890can use, with no preference order. During the transition, it also publishes
19891the legacy singular `token_endpoint_auth_method` as a preference:
19741 19892
19742```json19893```json
19743{19894{
1974419895 "token_endpoint_auth_methods_supported": ["none", "private_key_jwt"] "token_endpoint_auth_methods_supported": ["none", "private_key_jwt"],
19896 "token_endpoint_auth_method": "private_key_jwt"
19745}19897}
19746```19898```
19747 19899
1974819900The same field name has different perspectives in the two documents: in authorization server metadata, it lists the methods your token endpoint accepts; in ChatGPT's CIMD document, it lists the methods ChatGPT can use. The `client_id` URL is stable and does not use query parameters to select a method-specific document. At runtime, ChatGPT compares both lists and prefers the stronger `private_key_jwt` method when your authorization server supports it; otherwise, it uses `none`.The plural field has different perspectives in the two documents:
19901authorization server metadata lists the methods your token endpoint accepts,
19902while ChatGPT's CIMD document lists the methods ChatGPT can use. ChatGPT
19903selects a method from the intersection of those sets. When the singular legacy
19904preference is in the intersection, ChatGPT uses it for compatibility with
19905authorization servers that still treat the singular field as binding.
19906Otherwise, ChatGPT can use another method in the intersection.
19907
19908Authorization servers that read the plural CIMD field should accept any method
19909in the intersection unless local security policy disallows that method for the
19910client. They must reject methods outside the intersection. The `client_id` URL
19911stays stable and does not use query parameters to select a method-specific
19912document.
19749 19913
19750The supported methods are:19914The supported methods are:
19751 19915