2 2
3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.
4 4
5Run a deep scan when you need a more thorough review and can allow for a longer5A deep scan runs multiple independent standard scans over the same repository
6runtime. Deep scans search a repository more extensively and can reduce6or folder and combines their findings. Use it when you want repeated review
7variability between runs.7and can allow for the additional runtime and token use.
8 8
9Start with a [standard scan](https://learn.chatgpt.com/docs/security/plugin/scans) to check your scope9Start with a [standard scan](https://learn.chatgpt.com/docs/security/plugin/scans) to check that the
10and results. Then use a deep scan when you need a more thorough assessment.10scope and security context match your goal. Repeated review can find issues
11missed by an earlier pass, but doesn't guarantee complete detection or identical
12results between runs.
11 13
12## Choose between standard and deep scans14## Choose between standard and deep scans
13 15
14| | Standard scan | Deep scan |16| | Standard scan | Deep scan |
15| ----------------------- | -------------------------------------------------- | ----------------------------------------------------- |17| ---------- | ------------------------------------------- | ---------------------------------------------- |
16| Best for | First runs and routine repository or folder review | More thorough reviews after a standard scan |18| Review | One standard scan | Multiple standard scans with combined findings |
17| Variability | Standard | Reduced |19| Use it for | A first scan or a review of a defined scope | Additional independent reviews of that scope |
18| Scope | Repository or explicit folder | Repository or explicit folder |20| Scope | Repository or folder | Repository or folder |
19| Runtime and resources | Lower | Higher |21| Changes | Use the change-review workflow | Not supported |
20| Pull requests and diffs | Use the change-review workflow | Not supported; use the change-review workflow instead |
21 22
22## Configure deep-scan runtime23## Start the deep scan
23
24To control a deep scan's concurrency and duration, create or edit
25`~/.codex/codex-security/config.toml`. If you set `CODEX_HOME`, use
26`$CODEX_HOME/codex-security/config.toml` instead.
27
28For example, this profile runs a shorter scan with limited concurrency:
29
30```toml
31[deep_scan]
32workers = 2
33subagents = 0
34stop_after_no_new = 3
35max_discovery_runs = 10
36max_time_hours = 1.5
37```
38
39| Setting | Default | Description |
40| ------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
41| `workers` | `4` | Number of independent standard-scan workers allowed to run at the same time. Legacy `"auto"` also resolves to `4`. |
42| `subagents` | `3` | Number of subagents each worker may start. Set `0` to disable them. |
43| `stop_after_no_new` | `4` | Stop after this many consecutive completed worker scans produce no new findings. |
44| `stop_after_consecutive_errors` | `3` | Stop after this many consecutive worker errors. |
45| `max_discovery_runs` | `40` | Limit the number of independent standard-scan runs before aggregation. |
46| `max_time_hours` | `96` | Limit worker execution to a positive number of hours up to `96`; use fractions as needed. |
47
48Lower values can reduce scan time and token use but may miss findings.
49Configuration changes apply to new deep scans, not scans already in progress.
50 24
51When the time limit expires, Codex Security stops unfinished workers, keeps25For the best scan quality, use `gpt-5.6-sol`
52completed scan results, and aggregates them into the final report. If no worker26with `xhigh` reasoning effort.
53finishes source review before the deadline, the report records partial
54coverage.
55 27
56The `max_time_hours` setting requires plugin version `0.1.19` or later. See the28<WorkflowSteps>
57[plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) for release details.
58 29
59## Start the deep scan301. Open **Security** > **Scans** and select **+ Scan**.
312. Choose a repository or folder, select **Codebase**, and turn on **Deep scan**.
32 The scan reviews the entire selected repository or folder.
333. Choose the model and reasoning effort. Add threat-model or deployment
34 context under **Additional context**.
354. Select **Start scan**.
60 36
61In the desktop app, open **Security**, select **Scans**, and select **+ Scan**.37</WorkflowSteps>
62Choose a repository or another folder, select **Codebase**, and turn on
63**Deep scan**. The scan covers the entire selected repository or folder.
64 38
65You can also start a repository-wide deep scan from a Codex conversation:39You can also start it from a Codex conversation:
66 40
67```text41```text
68Use $codex-security:deep-security-scan to run a deep security scan of this repository.42Use $codex-security:deep-security-scan to run a deep security scan of this repository.
69```43```
70 44
71For one component in a monorepo, identify the folder explicitly:45For one component, replace "this repository" with the path to its folder.
72
73```text
74Use $codex-security:deep-security-scan to run a deep security scan of /absolute/path/to/repository/services/payments.
75```
76
77For a scoped deep scan in the desktop app, select the folder as the codebase.
78The scan covers the entire selected folder.
79
80## Confirm setup and preflight
81
82For the best scan quality, use `gpt-5.6-sol`
83with `xhigh` reasoning effort.
84
85<WorkflowSteps>
86
871. Select **Codebase** and turn on **Deep scan**.
882. Confirm that the repository or selected folder is the code you intended to
89 scan.
903. Choose a model and reasoning effort.
914. Open **Additional context** for concrete attack vectors, sensitive
92 application areas, or repository context that the code can't reveal.
935. Select **Start scan**.
94
95</WorkflowSteps>
96 46
97Deep scan workers inherit your selected model and reasoning settings. Each47Deep scan workers inherit your selected model and reasoning settings. Each
98worker runs a complete standard scan, and Codex Security aggregates the48worker runs a complete standard scan, and Codex Security aggregates the
99completed results. Follow the saved scan from **Scans**, or select **View49completed results. Follow the saved scan from **Scans**, or select **View
100activity** to inspect its Codex task. Check the [plugin50activity** to inspect its Codex task. Set [runtime limits](#configure-deep-scan-runtime) before starting if you need
101changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) before you update the plugin or51to limit concurrency or duration.
102start a long-running scan.
103 52
104<figure className="not-prose my-8">53<figure className="not-prose my-8">
105 <CodexScreenshot54 <CodexScreenshot
129finding](https://learn.chatgpt.com/docs/security/plugin/fix-findings).78finding](https://learn.chatgpt.com/docs/security/plugin/fix-findings).
130 79
131To review a pull request, commit, branch range, or local patch, use [Review code80To review a pull request, commit, branch range, or local patch, use [Review code
132changes](https://learn.chatgpt.com/docs/security/plugin/code-changes). A deep scan never substitutes81changes](https://learn.chatgpt.com/docs/security/plugin/code-changes). Deep scans don't accept diff targets.
133for the diff-focused workflow.82
83## Configure deep-scan runtime
84
85To control a deep scan's concurrency and duration, create or edit
86`~/.codex/codex-security/config.toml`. If you set `CODEX_HOME`, use
87`$CODEX_HOME/codex-security/config.toml` instead.
88
89For example, this profile runs a shorter scan with limited concurrency:
90
91```toml
92[deep_scan]
93workers = 2
94subagents = 0
95stop_after_no_new = 3
96max_discovery_runs = 10
97max_time_hours = 1.5
98```
99
100| Setting | Default | Description |
101| ------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
102| `workers` | `4` | Number of independent standard-scan workers allowed to run at the same time. Legacy `"auto"` also resolves to `4`. |
103| `subagents` | `3` | Number of subagents each worker may start. Set `0` to disable them. |
104| `stop_after_no_new` | `4` | Stop after this many consecutive completed worker scans produce no new findings. |
105| `stop_after_consecutive_errors` | `3` | Stop after this many consecutive worker errors. |
106| `max_discovery_runs` | `40` | Limit the number of independent standard-scan runs before aggregation. |
107| `max_time_hours` | `96` | Limit worker execution to a positive number of hours up to `96`; use fractions as needed. |
108
109Lower values can reduce scan time and token use but may miss findings.
110Configuration changes apply to new deep scans, not scans already in progress.
111
112When the time limit expires, Codex Security stops unfinished workers, keeps
113completed scan results, and aggregates them into the final report. If no worker
114finishes source review before the deadline, the report records partial
115coverage.
116
117The `max_time_hours` setting requires plugin version `0.1.19` or later. See the
118[plugin changelog](https://learn.chatgpt.com/docs/security/plugin/changelog) for release details.