1# Codex Security setup1# Setup – Codex Security
2 2
3This page walks you from initial access to reviewed findings and remediation pull requests in Codex Security.3This page walks you from initial access to reviewed findings and remediation pull requests in Codex Security.
4 4
5Confirm you've set up Codex Cloud first. If not, see [Codex5Confirm you’ve set up Codex Cloud first. If not, see [Codex
6 Cloud](https://developers.openai.com/codex/cloud) to get started.6Cloud](https://developers.openai.com/codex/cloud) to get started.
7 7
8## 1. Access and environment8## 1. Access and environment
9 9
12- Confirm your workspace has access to Codex Security.12- Confirm your workspace has access to Codex Security.
13- Confirm the repository you want to scan is available in Codex Cloud.13- Confirm the repository you want to scan is available in Codex Cloud.
14 14
15Go to [Codex environments](https://chatgpt.com/codex/settings/environments) and check whether the repository already has an environment. If it doesn't, create one there before continuing.15Go to [Codex environments](https://chatgpt.com/codex/settings/environments) and check whether the repository already has an environment. If it doesn’t, create one there before continuing.
16 16
17<CtaPillLink17[Open environments](https://chatgpt.com/codex/settings/environments)
18 href="https://chatgpt.com/codex/settings/environments"
19 label="Open environments"
20 icon="external"
21 class="my-8"
22/>
23 18
24<div class="not-prose my-8 max-w-6xl overflow-hidden rounded-xl border border-subtle bg-surface">19
25 <img
26 src={createEnvironment.src}
27 alt="Codex environments"
28 class="block h-auto w-full"
29 />
30</div>
31 20
32## 2. New security scan21## 2. New security scan
33 22
34After the environment exists, go to [Create a security scan](https://chatgpt.com/codex/security/scans/new) and choose the repository you just connected.23After the environment exists, go to [Create a security scan](https://chatgpt.com/codex/security/scans/new) and choose the repository you just connected.
35 24
36<CtaPillLink25[Create a security scan](https://chatgpt.com/codex/security/scans/new)
37 href="https://chatgpt.com/codex/security/scans/new"
38 label="Create a security scan"
39 icon="external"
40 class="my-8"
41/>
42 26
43Codex Security scans repositories from newest commits backward first. It uses this to build and refresh scan context as new commits come in.27Codex Security scans repositories from newest commits backward first. It uses this to build and refresh scan context as new commits come in.
44 28
515. Choose a **history window**. Longer windows provide more context, but backfill takes longer.355. Choose a **history window**. Longer windows provide more context, but backfill takes longer.
526. Click **Create**.366. Click **Create**.
53 37
54<div class="not-prose my-8 max-w-6xl overflow-hidden rounded-xl border border-subtle bg-surface">38
55 <img
56 src={createScan.src}
57 alt="Create a security scan"
58 class="block h-auto w-full"
59 />
60</div>
61 39
62## 3. Initial scans can take a while40## 3. Initial scans can take a while
63 41
64When you create the scan, Codex Security first runs a commit-level security pass across the selected history window.42When you create the scan, Codex Security first runs a commit-level security pass across the selected history window.
65The initial backfill can take a few hours, especially for larger repositories or longer windows.43The initial backfill can take a few hours, especially for larger repositories or longer windows.
66If findings aren't visible right away, this is expected. Wait for the initial scan to finish before opening a ticket or troubleshooting.44If findings aren’t visible right away, this is expected. Wait for the initial scan to finish before opening a ticket or troubleshooting.
67 45
68Initial scan setup is automatic and thorough. This can take a few hours. Don’t46Initial scan setup is automatic and thorough. This can take a few hours. Don’t
69 be alarmed if the first set of findings is delayed.47be alarmed if the first set of findings is delayed.
70 48
71## 4. Review scans and improve the threat model49## 4. Review scans and improve the threat model
72 50
73<CtaPillLink51[Review scans](https://chatgpt.com/codex/security/scans)
74 href="https://chatgpt.com/codex/security/scans"52
75 label="Review scans"53
76 icon="external"
77 class="my-8"
78/>
79
80<div class="not-prose my-8 max-w-6xl overflow-hidden rounded-xl border border-subtle bg-surface">
81 <img
82 src={reviewThreatModel.src}
83 alt="Threat model editor in Codex Security"
84 class="block h-auto w-full"
85 />
86</div>
87 54
88When the initial scan finishes, open the scan and review the threat model that was generated.55When the initial scan finishes, open the scan and review the threat model that was generated.
89After initial findings appear, update the threat model so it matches your architecture, trust boundaries, and business context.56After initial findings appear, update the threat model so it matches your architecture, trust boundaries, and business context.
90This helps Codex Security rank issues for your team.57This helps Codex Security rank issues for your team.
91 58
92If you want scan results to change, you can edit the threat model with your59If you want scan results to change, you can edit the threat model with your
93 updated scope, priorities, and assumptions.60updated scope, priorities, and assumptions.
94 61
95After initial findings appear, revisit the model so scan guidance stays aligned with current priorities.62After initial findings appear, revisit the model so scan guidance stays aligned with current priorities.
96Keeping it current helps Codex Security produce better suggestions.63Keeping it current helps Codex Security produce better suggestions.
101 68
102After the initial backfill completes, review findings from the **Findings** view.69After the initial backfill completes, review findings from the **Findings** view.
103 70
104<CtaPillLink71[Open findings](https://chatgpt.com/codex/security/findings)
105 href="https://chatgpt.com/codex/security/findings"
106 label="Open findings"
107 icon="external"
108 class="my-8"
109/>
110 72
111You can use two views:73You can use two views:
112 74
126 88
127You can review each finding and create a PR directly from the finding detail page.89You can review each finding and create a PR directly from the finding detail page.
128 90
129<CtaPillLink91[Review findings and create a PR](https://chatgpt.com/codex/security/findings)
130 href="https://chatgpt.com/codex/security/findings"
131 label="Review findings and create a PR"
132 icon="external"
133 class="my-8"
134/>
135 92
136## Related docs93## Related docs
137 94