44 44
45- [Projects and chats](https://learn.chatgpt.com/docs/projects): Keep related chats, context, and work together.45- [Projects and chats](https://learn.chatgpt.com/docs/projects): Keep related chats, context, and work together.
46 46
47- [Codex Remote](https://learn.chatgpt.com/docs/remote): Start tasks, approve actions, and review work from your phone.
48
47- [Sites](https://learn.chatgpt.com/docs/sites): Create, save, and publish interactive websites and apps in ChatGPT.49- [Sites](https://learn.chatgpt.com/docs/sites): Create, save, and publish interactive websites and apps in ChatGPT.
48 50
49- [Visualizations](https://learn.chatgpt.com/docs/visualizations): Turn ideas and information into interactive visual explanations.51- [Visualizations](https://learn.chatgpt.com/docs/visualizations): Turn ideas and information into interactive visual explanations.
3813npm install @openai/codex-security3815npm install @openai/codex-security
3814```3816```
3815 3817
3816Check the installed version:
3817
3818```bash
3819npx @openai/codex-security --version
3820```
3821
3822List the available commands:3818List the available commands:
3823 3819
3824```bash3820```bash
3825npx @openai/codex-security --help3821npx @openai/codex-security --help
3826```3822```
3827 3823
3828Use `npx @openai/codex-security scan --help` or3824See also [CLI reference](https://learn.chatgpt.com/docs/security/cli/reference).
3829`npx @openai/codex-security export --help` for complete command help. The
3830[CLI reference](https://learn.chatgpt.com/docs/security/cli/reference) covers each argument, output
3831format, and exit code.
3832 3825
3833#### Sign in3826#### Sign in
3834 3827
3850export OPENAI_API_KEY="<your-api-key>"3843export OPENAI_API_KEY="<your-api-key>"
3851```3844```
3852 3845
3853Keep API keys in your shell or secret manager. Codex Security can also reuse an3846For AWS credentials, see [Amazon Bedrock
3854existing file-backed Codex sign-in. When both a stored ChatGPT sign-in and an3847setup](https://learn.chatgpt.com/docs/security/cli/reference#use-amazon-bedrock).
3855environment API key are available, interactive scans with text output ask
3856which to use. CI, JSON and JSONL scans, and other unattended scans use the
3857API key by default.
3858 3848
3859To use your ChatGPT sign-in when an API key is also set, select it explicitly:3849To use your ChatGPT sign-in when an API key is also set, select it explicitly:
3860 3850
3868npx @openai/codex-security scan . --auth api-key3858npx @openai/codex-security scan . --auth api-key
3869```3859```
3870 3860
3871To make your stored sign-in the automatic default, unset both environment API
3872keys:
3873
3874```bash
3875unset OPENAI_API_KEY CODEX_API_KEY
3876```
3877
3878Depending on your account and repository, full-repository scans may also3861Depending on your account and repository, full-repository scans may also
3879require [Trusted Access for Cyber](https://chatgpt.com/cyber). Signing in or3862require [Trusted Access for Cyber](https://chatgpt.com/cyber).
3880setting an API key doesn't grant that access.
3881 3863
3882#### Prepare a scan3864#### Prepare a scan
3883 3865
4274 4256
4275```text4257```text
4276usage: codex-security scan [-h] [--auth {auto,chatgpt,api-key}]4258usage: codex-security scan [-h] [--auth {auto,chatgpt,api-key}]
4259 [--provider {openai,openrouter,fireworks,amazon-bedrock}]
4277 [--path PATH | --diff BASE | --working-tree]4260 [--path PATH | --diff BASE | --working-tree]
4278 [--head HEAD] [--base BASE]4261 [--head HEAD] [--base BASE]
4279 [--knowledge-base PATH]4262 [--knowledge-base PATH]
4283 [--archive-existing]4266 [--archive-existing]
4284 [--plugin-path PATH] [--python PATH]4267 [--plugin-path PATH] [--python PATH]
4285 [--codex KEY=VALUE] [--fail-on-severity LEVEL]4268 [--codex KEY=VALUE] [--fail-on-severity LEVEL]
4286 [--max-cost USD] [--dry-run]4269 [--max-cost USD] [--dry-run] [--verbose]
4287 [--json] [--format {toon,json,yaml,jsonl}]4270 [--json] [--format {toon,json,yaml,jsonl}]
4288 [--full-output] [repository]4271 [--full-output] [repository]
4289```4272```
4313To make stored credentials the automatic default, run4296To make stored credentials the automatic default, run
4314`unset OPENAI_API_KEY CODEX_API_KEY`.4297`unset OPENAI_API_KEY CODEX_API_KEY`.
4315 4298
4299#### Use Amazon Bedrock
4300
4301Select Amazon Bedrock with `--provider amazon-bedrock` and specify an explicit
4302Bedrock model with `--model`:
4303
4304```bash
4305npx @openai/codex-security scan . \
4306 --provider amazon-bedrock \
4307 --model openai.gpt-5.6-sol
4308```
4309
4310Set `AWS_REGION` and authenticate with `AWS_BEARER_TOKEN_BEDROCK`, standard AWS
4311access keys, an AWS profile, web identity, container credentials, or the
4312default AWS credential chain. Bedrock scans use AWS credentials instead of
4313`--auth`, ChatGPT sign-in, or an OpenAI API key. Both `scan` and `bulk-scan`
4314support `--provider`.
4315
4316#### Select the scan target4316#### Select the scan target
4317 4317
4318Choose one target type for each scan.4318Choose one target type for each scan.
4391| `--fail-on-severity LEVEL` | Return exit `1` when a completed scan reports a finding at or above `critical`, `high`, `medium`, or `low`. |4391| `--fail-on-severity LEVEL` | Return exit `1` when a completed scan reports a finding at or above `critical`, `high`, `medium`, or `low`. |
4392| `--max-cost USD` | Stop a scan when its estimated model cost exceeds the specified USD amount. |4392| `--max-cost USD` | Stop a scan when its estimated model cost exceeds the specified USD amount. |
4393| `--dry-run` | Check the repository, target, output directory, and Codex configuration without starting a scan. |4393| `--dry-run` | Check the repository, target, output directory, and Codex configuration without starting a scan. |
4394| `--verbose` | Print redacted lifecycle, authentication, progress, and cost diagnostics to stderr. |
4394| `--json` | Print manifest, findings, coverage, paths, and turn metadata as one JSON document. |4395| `--json` | Print manifest, findings, coverage, paths, and turn metadata as one JSON document. |
4395| `--format FORMAT` | Print the complete scan result as `toon`, `json`, `yaml`, or `jsonl`. |4396| `--format FORMAT` | Print the complete scan result as `toon`, `json`, `yaml`, or `jsonl`. |
4396| `--full-output` | Print the complete result using the default structured output format. |4397| `--full-output` | Print the complete result using the default structured output format. |
4448Codex configuration value.4449Codex configuration value.
4449 4450
4450| Argument | Description |4451| Argument | Description |
4451| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- |4452| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
4452| `--auth {auto,chatgpt,api-key}` | Select the scan credentials. The default is `auto`. |4453| `--auth {auto,chatgpt,api-key}` | Select the scan credentials. The default is `auto`. |
4453| `--model MODEL` | Select the OpenAI model. The default is `gpt-5.6-sol`. |4454| `--provider {openai,openrouter,fireworks,amazon-bedrock}` | Select the inference provider. The default is `openai`. |
4455| `--model MODEL` | Select the model. The default is `gpt-5.6-sol`. Required with `--provider amazon-bedrock`. |
4454| `--effort {minimal,low,medium,high,xhigh}` | Select the model's reasoning effort. The default is `xhigh`. |4456| `--effort {minimal,low,medium,high,xhigh}` | Select the model's reasoning effort. The default is `xhigh`. |
4455| `--plugin-path PATH` | Use a Codex Security plugin directory or ZIP to override the bundled plugin. |4457| `--plugin-path PATH` | Use a Codex Security plugin directory or ZIP to override the bundled plugin. |
4456| `--python PATH` | Select the Python interpreter for the plugin runtime. |4458| `--python PATH` | Select the Python interpreter for the plugin runtime. |
4498```text4500```text
4499usage: codex-security bulk-scan [input] [--output-dir DIR]4501usage: codex-security bulk-scan [input] [--output-dir DIR]
4500 [--workers N] [--mode {standard,deep}]4502 [--workers N] [--mode {standard,deep}]
4503 [--provider {openai,openrouter,fireworks,amazon-bedrock}]
4501 [--model MODEL]4504 [--model MODEL]
4502 [--effort {minimal,low,medium,high,xhigh}]4505 [--effort {minimal,low,medium,high,xhigh}]
4503 [--max-attempts N] [--plugin-path PATH]4506 [--max-attempts N] [--plugin-path PATH]
4779without writing the complete scan result to stdout. Request `--json`,4782without writing the complete scan result to stdout. Request `--json`,
4780`--format`, or `--full-output` to send structured scan results to stdout.4783`--format`, or `--full-output` to send structured scan results to stdout.
4781 4784
4785#### Verbose diagnostics
4786
4787Add `--verbose` to print redacted lifecycle, authentication, progress, and cost
4788diagnostics to stderr:
4789
4790```bash
4791npx @openai/codex-security scan . --verbose
4792```
4793
4794Set `CODEX_SECURITY_LOG_LEVEL=debug` to enable the same diagnostics without the
4795flag. `LOG_LEVEL=debug` also enables diagnostics when
4796`CODEX_SECURITY_LOG_LEVEL` is unset.
4797
4798These logging controls apply only to the CLI. Credentials and provider
4799identifiers remain redacted, and structured scan results remain on stdout.
4800
4782#### Completion summary4801#### Completion summary
4783 4802
4784A completed scan writes its finding count, severity breakdown, coverage,4803A completed scan writes its finding count, severity breakdown, coverage,
4882 4901
4883Set `OPENAI_API_KEY` or `CODEX_API_KEY`, sign in with4902Set `OPENAI_API_KEY` or `CODEX_API_KEY`, sign in with
4884`npx @openai/codex-security login`, or use an existing file-backed Codex4903`npx @openai/codex-security login`, or use an existing file-backed Codex
4885sign-in.4904sign-in. For Amazon Bedrock, use a Bedrock API key or the standard AWS
4905credential chain instead.
4886 4906
4887For credential selection, see [Select scan4907For credential selection, see [Select scan
4888authentication](#select-scan-authentication).4908authentication](#select-scan-authentication).
5583npm install @openai/codex-security5603npm install @openai/codex-security
5584```5604```
5585 5605
5586Before starting a scan, set `OPENAI_API_KEY` or `CODEX_API_KEY`, or use an5606Before starting a scan, set `OPENAI_API_KEY` or `CODEX_API_KEY`, use an
5587existing file-backed Codex sign-in.5607existing file-backed Codex sign-in, or [configure Amazon
5608Bedrock](#configure-the-runtime-and-credentials) with AWS credentials and
5609explicit `model_provider` and `model` overrides.
5588 5610
5589For best results, use an account verified for [Trusted Access for5611For best results, use an account verified for [Trusted Access for
5590Cyber](https://chatgpt.com/cyber). Signing in or providing an API key does not5612Cyber](https://chatgpt.com/cyber). Signing in or providing an API key does not
5910plugin interpreter. `codexOverrides` merges supported values into the isolated5932plugin interpreter. `codexOverrides` merges supported values into the isolated
5911Codex configuration. Scans use `gpt-5.6-sol` with extra-high reasoning effort5933Codex configuration. Scans use `gpt-5.6-sol` with extra-high reasoning effort
5912by default. Set `model` and `model_reasoning_effort` in `codexOverrides` to use5934by default. Set `model` and `model_reasoning_effort` in `codexOverrides` to use
5913a different model or reasoning effort.5935a different model or reasoning effort. To use [Amazon
5936Bedrock](https://learn.chatgpt.com/docs/security/cli/reference#use-amazon-bedrock), set
5937`model_provider` and `model` in `codexOverrides`.
5914 5938
5915The client also exposes supported authentication methods:5939The client also exposes supported authentication methods:
5916 5940
7410reference](https://learn.chatgpt.com/docs/security/cli/reference). For an interactive plugin-based CI7434reference](https://learn.chatgpt.com/docs/security/cli/reference). For an interactive plugin-based CI
7411review, see [Review code changes for security](https://learn.chatgpt.com/docs/security/plugin/code-changes#automate-reviews-in-cicd).7435review, see [Review code changes for security](https://learn.chatgpt.com/docs/security/plugin/code-changes#automate-reviews-in-cicd).
7412 7436
7437### Security Review
7438
7439Source: [Security Review](https://learn.chatgpt.com/docs/security/security-review.md)
7440
7441Security Review is available in research preview.
7442It is available to ChatGPT Enterprise, Business, Edu, and Pro customers; it is
7443not available on Plus. During the introductory period, Security Review does not
7444consume ChatGPT credits. Usage limits may apply.
7445
7446Security Review is an additional review for customers that want to
7447pay particular attention to security issues in pull requests.
7448
7449Security Review goes deeper than [Code
7450Review](https://learn.chatgpt.com/docs/third-party/github) on security-specific risks by analyzing the
7451pull request diff, supporting repository context, and configured threat models
7452or security guidance. Code Review can also identify security-related issues as
7453part of its general review, so you may see occasional overlap between findings.
7454
7455#### Before you start
7456
7457To configure automatic Security Review, you need:
7458
7459- Security Review research preview access for your workspace
7460- [Codex cloud](https://learn.chatgpt.com/docs/cloud) set up with a connected GitHub repository
7461- GitHub push or admin permission for the repository settings
7462
7463An existing Codex Security scan is optional.
7464
7465#### Configure Security Review
7466
74671. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
74682. Under **Repository preferences**, choose which pull requests get Security
7469 Review:
7470 - **Follow personal** lets each contributor opt in with their personal
7471 Security Review settings.
7472 - **Review all PRs** applies to every pull request in the repository.
7473 - **Review team PRs**, when available, applies to pull requests opened by
7474 members of your ChatGPT workspace, not members of a GitHub team.
74753. Choose when Security Review runs:
7476 - **On PR open** runs independently when a pull request is opened.
7477 - **Every push** runs independently after new commits are pushed.
7478 - **Whenever code review runs** requires Code Review and runs Security Review
7479 alongside it.
7480
7481#### Add threat-model context
7482
7483You can configure a threat model to give Codex context about your application's
7484assets, trust boundaries, security assumptions, and repository-specific risks.
7485If the repository has an existing Codex Security scan configuration, you can use
7486its threat model. Otherwise, provide the path to a threat model file checked
7487into the repository. If you do not specify a source, Codex regenerates the
7488threat model for every review.
7489
7490#### Set reporting thresholds
7491
7492By default, automatic Security Reviews report **High** and **Critical**
7493findings, while manually requested reviews report **Medium**, **High**, and
7494**Critical** findings. You can change the minimum severity independently for
7495automatic and manual reviews, and add path-based overrides.
7496
7497Findings posted to a pull request inherit that pull request's GitHub
7498visibility. Anyone who can view the pull request can view those findings,
7499including on public repositories or pull requests from contributors outside
7500your workspace. Choose reporting thresholds carefully for repositories where
7501pull request comments may be broadly visible. The reporting threshold controls
7502what Codex posts to GitHub; the full Security Review report remains in Codex.
7503
7504#### Request a Security Review
7505
7506To request a Security Review manually, add this comment to a pull request:
7507
7508`@codex security review`
7509
7510Codex reacts while the review is running, then posts findings that meet your
7511manual reporting threshold directly on the pull request. Open the associated
7512Codex task and select the **Security Report** tab to view the full report,
7513including severity, attack path, supporting evidence, validation, and
7514remediation guidance. If no issues meet the reporting threshold, Codex does not
7515post findings to the pull request.
7516
7517#### Related docs
7518
7519- [Review GitHub pull requests with Codex](https://learn.chatgpt.com/docs/third-party/github) explains Code Review and the GitHub integration.
7520- [Codex Security](https://learn.chatgpt.com/docs/security) gives the product overview.
7521- [Codex Security cloud setup](https://learn.chatgpt.com/docs/security/setup) explains repository scans and findings review.
7522- [Improving the threat model](https://learn.chatgpt.com/docs/security/threat-model) explains how to tune repository context.
7523
7413### Triage a backlog7524### Triage a backlog
7414 7525
7415Source: [Triage a backlog](https://learn.chatgpt.com/docs/security/plugin/triage-backlog.md)7526Source: [Triage a backlog](https://learn.chatgpt.com/docs/security/plugin/triage-backlog.md)
9388- [Codex Security CLI FAQ](https://learn.chatgpt.com/docs/security/cli/faq) answers common questions about scans, findings, coverage, and costs.9499- [Codex Security CLI FAQ](https://learn.chatgpt.com/docs/security/cli/faq) answers common questions about scans, findings, coverage, and costs.
9389- [Codex Security TypeScript SDK](https://learn.chatgpt.com/docs/security/sdk) explains how to run scans from an application or developer tool.9500- [Codex Security TypeScript SDK](https://learn.chatgpt.com/docs/security/sdk) explains how to run scans from an application or developer tool.
9390- [Codex Security cloud setup](https://learn.chatgpt.com/docs/security/setup) details setup, scanning, and findings review.9501- [Codex Security cloud setup](https://learn.chatgpt.com/docs/security/setup) details setup, scanning, and findings review.
9502- [Security Review](https://learn.chatgpt.com/docs/security/security-review) explains how to run in-depth security reviews on GitHub pull requests.
9391- [Improving the threat model](https://learn.chatgpt.com/docs/security/threat-model) explains how to tune scope, entry points, and criticality assumptions.9503- [Improving the threat model](https://learn.chatgpt.com/docs/security/threat-model) explains how to tune scope, entry points, and criticality assumptions.
9392- [Codex Security cloud FAQ](https://learn.chatgpt.com/docs/security/faq) covers common cloud product questions.9504- [Codex Security cloud FAQ](https://learn.chatgpt.com/docs/security/faq) covers common cloud product questions.
9393 9505
9429 9541
9430- [Codex Security cloud setup](https://learn.chatgpt.com/docs/security/setup): Connect repositories and configure cloud security scans.9542- [Codex Security cloud setup](https://learn.chatgpt.com/docs/security/setup): Connect repositories and configure cloud security scans.
9431 9543
9544- [Security Review](https://learn.chatgpt.com/docs/security/security-review): Run in-depth security reviews on GitHub pull requests.
9545
9432- [Threat model](https://learn.chatgpt.com/docs/security/threat-model): Review and improve the threat model for your codebase.9546- [Threat model](https://learn.chatgpt.com/docs/security/threat-model): Review and improve the threat model for your codebase.
9433 9547
9434- [Codex Security cloud FAQ](https://learn.chatgpt.com/docs/security/faq): Get answers about cloud scans, findings, privacy, and access.9548- [Codex Security cloud FAQ](https://learn.chatgpt.com/docs/security/faq): Get answers about cloud scans, findings, privacy, and access.
15353 15467
153541. Start Remote setup.154681. Start Remote setup.
15355 15469
15356 Open the app on the host and select **Set up Remote** in the sidebar.15470 Open the ChatGPT desktop app on the host. Go to **Settings** >
15471 **Connections** > **Control this Mac or PC**, then select **Set up** or
15472 **Add**. Approve remote access and complete any requested verification.
15357 15473
153582. Scan the QR code.154742. Scan the QR code.
15359 15475
15369 15485
153704. Review host settings.154864. Review host settings.
15371 15487
15372 In the app on the host, use **Settings > Connections** to manage connected15488 In the app on the host, use **Settings** > **Connections** to manage connected
15373 devices. You can also choose whether to keep the computer awake, enable15489 devices. You can also choose whether to keep the computer awake, enable
15374 Computer Use, or install the Chrome extension.15490 Computer Use, or install the Chrome extension.
15375 15491
16741 Computer Use.16857 Computer Use.
167423. Restart the app and try again.168583. Restart the app and try again.
16743 16859
16860### Codex Remote
16861
16862Source: [Codex Remote](https://learn.chatgpt.com/docs/remote.md)
16863
16864Start, guide, approve, and review Codex tasks on a connected computer from your phone.
16865
16744### Image generation16866### Image generation
16745 16867
16746Source: [Image generation](https://learn.chatgpt.com/docs/image-generation.md)16868Source: [Image generation](https://learn.chatgpt.com/docs/image-generation.md)
19988consolidation_model = "gpt-5.6-luna"20110consolidation_model = "gpt-5.6-luna"
19989```20111```
19990 20112
19991### Codex code review in GitHub
19992
19993Source: [Codex code review in GitHub](https://learn.chatgpt.com/docs/third-party/github.md)
19994
19995Use Codex code review to get another high-signal review pass on GitHub pull
19996requests. Codex reviews the pull request diff, follows your repository guidance,
19997and posts a standard GitHub code review focused on serious issues.
19998
19999#### Before you start
20000
20001Make sure you have:
20002
20003- [Codex cloud](https://learn.chatgpt.com/docs/cloud) set up for the repository you want to review.
20004- Access to [Codex code review settings](https://chatgpt.com/codex/settings/code-review).
20005- An `AGENTS.md` file if you want Codex to follow repository-specific review guidance.
20006
20007#### Set up Codex code review
20008
200091. Set up [Codex cloud](https://learn.chatgpt.com/docs/cloud).
200102. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
200113. Turn on **Code review** for your repository.
20012
20013#### Request a Codex review
20014
200151. In a pull request comment, mention `@codex review`.
200162. Wait for Codex to react (👀) and post a review.
20017
20018Codex posts a review on the pull request, just like a teammate would. In
20019GitHub, Codex flags only P0 and P1 issues so review comments stay focused on
20020high-priority risks.
20021
20022#### Enable automatic reviews
20023
20024If you want Codex to review every pull request automatically, turn on
20025**Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review).
20026Codex will post a review whenever someone opens a new PR for review, without
20027needing an `@codex review` comment.
20028
20029#### Customize what Codex reviews
20030
20031Codex searches your repository for `AGENTS.md` files and follows the applicable
20032code review rules. Add a `## Code Review Rules` section to the file closest to
20033the code the rules govern. Use `###` headings to group related checks when
20034helpful.
20035
20036For example, an experiment-reporting service can keep post-exposure behavior
20037from changing a comparison cohort:
20038
20039```md
20040## Code Review Rules
20041
20042### Experiment cohorts
20043
20044- Do not filter treatment comparisons on post-exposure behavior, including conversion or retention.
20045 Safe path: build cohorts from assignment or exposure; report conversion as an outcome.
20046```
20047
20048Put repository-wide rules in the root `AGENTS.md` and service-specific rules
20049in a nested file, such as `services/experiment_reporting/AGENTS.md`. Codex
20050applies the root and more-specific guidance that covers each changed file, so
20051unrelated changes don't have to carry service-specific context.
20052
20053Start with two or three concise rules that encode checks reviewers often explain. Useful rules:
20054
20055- **Focus on consequential, repository-specific behavior.** Describe the
20056 compatibility constraint, data boundary, or unsafe side effect to flag and
20057 why it matters.
20058- **State the safe path or exception.** Give Codex enough context to distinguish
20059 a real issue from expected behavior.
20060- **Keep rules scoped and durable.** Prefer outcomes over function names that
20061 can change, and place guidance near the code it governs.
20062- **Leave mechanical checks in CI.** Keep formatting, lint, and other
20063 deterministic checks out of review rules.
20064
20065Open a representative pull request and request a review with `@codex review`.
20066Refine the rules based on the findings and feedback you see, and narrow or
20067remove guidance that produces noise.
20068
20069Code review rules guide Codex; they don't replace tests, branch protections, or
20070required approvals.
20071
20072For a one-off focus, add it to your pull request comment:
20073
20074`@codex review for security regressions`
20075
20076#### Act on review findings
20077
20078After Codex posts a review, you can ask it to fix issues in the same pull
20079request by leaving another comment:
20080
20081```md
20082@codex fix the P1 issue
20083```
20084
20085Codex starts a cloud chat with the pull request as context and can push a fix
20086back to the branch when it has permission to do so.
20087
20088#### Give Codex other tasks
20089
20090If you mention `@codex` in a comment with anything other than `review`, Codex starts a [cloud chat](https://learn.chatgpt.com/docs/cloud) using your pull request as context.
20091
20092```md
20093@codex fix the CI failures
20094```
20095
20096#### Troubleshoot code review
20097
20098If Codex doesn't react or post a review:
20099
20100- Confirm you turned on **Code review** for the repository in [Codex settings](https://chatgpt.com/codex/settings/code-review).
20101- Confirm the pull request belongs to a repository with [Codex cloud](https://learn.chatgpt.com/docs/cloud) set up.
20102- Use the exact trigger `@codex review` in a pull request comment.
20103- For automatic reviews, check that you turned on **Automatic reviews** and that
20104 the pull request event matches your review trigger settings.
20105
20106### Connect and test your plugin20113### Connect and test your plugin
20107 20114
20108Source: [Connect and test your plugin](https://developers.openai.com/plugins/deploy/connect-chatgpt.md)20115Source: [Connect and test your plugin](https://developers.openai.com/plugins/deploy/connect-chatgpt.md)
25832);25839);
25833```25840```
25834 25841
25842### Review GitHub pull requests with Codex
25843
25844Source: [Review GitHub pull requests with Codex](https://learn.chatgpt.com/docs/third-party/github.md)
25845
25846Use Codex code review to get another high-signal review pass on GitHub pull
25847requests. Codex reviews the pull request diff, follows your repository guidance,
25848and posts a standard GitHub code review focused on serious issues. Security
25849Review, available in research preview, provides a more in-depth review of
25850potential security issues in a pull request.
25851
25852#### Before you start
25853
25854Make sure you have:
25855
25856- [Codex cloud](https://learn.chatgpt.com/docs/cloud) set up for the repository you want to review.
25857- Access to [Codex code review settings](https://chatgpt.com/codex/settings/code-review).
25858- An `AGENTS.md` file if you want Codex to follow repository-specific review guidance.
25859
25860#### Set up Codex code review
25861
25862To configure automatic reviews, you need a connected GitHub repository and
25863GitHub push or admin permission for its settings.
25864
258651. Set up [Codex cloud](https://learn.chatgpt.com/docs/cloud).
258662. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
258673. Turn on **Code review** for your repository.
25868
25869#### Request a Codex review
25870
258711. In a pull request comment, mention `@codex review`.
258722. Wait for Codex to react (👀) and post a review.
25873
25874Codex posts a review on the pull request, just like a teammate would. In
25875GitHub, Codex flags only P0 and P1 issues so review comments stay focused on
25876high-priority risks.
25877
25878#### Enable automatic reviews
25879
25880If you want Codex to review every pull request automatically, turn on
25881**Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review).
25882Codex will post a review whenever someone opens a new PR for review, without
25883needing an `@codex review` comment.
25884
25885#### Customize what Codex reviews
25886
25887Codex searches your repository for `AGENTS.md` files and follows the applicable
25888code review rules. Add a `## Code Review Rules` section to the file closest to
25889the code the rules govern. Use `###` headings to group related checks when
25890helpful.
25891
25892For example, an experiment-reporting service can keep post-exposure behavior
25893from changing a comparison cohort:
25894
25895```md
25896## Code Review Rules
25897
25898### Experiment cohorts
25899
25900- Do not filter treatment comparisons on post-exposure behavior, including conversion or retention.
25901 Safe path: build cohorts from assignment or exposure; report conversion as an outcome.
25902```
25903
25904Put repository-wide rules in the root `AGENTS.md` and service-specific rules
25905in a nested file, such as `services/experiment_reporting/AGENTS.md`. Codex
25906applies the root and more-specific guidance that covers each changed file, so
25907unrelated changes don't have to carry service-specific context.
25908
25909Start with two or three concise rules that encode checks reviewers often explain. Useful rules:
25910
25911- **Focus on consequential, repository-specific behavior.** Describe the
25912 compatibility constraint, data boundary, or unsafe side effect to flag and
25913 why it matters.
25914- **State the safe path or exception.** Give Codex enough context to distinguish
25915 a real issue from expected behavior.
25916- **Keep rules scoped and durable.** Prefer outcomes over function names that
25917 can change, and place guidance near the code it governs.
25918- **Leave mechanical checks in CI.** Keep formatting, lint, and other
25919 deterministic checks out of review rules.
25920
25921Open a representative pull request and request a review with `@codex review`.
25922Refine the rules based on the findings and feedback you see, and narrow or
25923remove guidance that produces noise.
25924
25925Code review rules guide Codex; they don't replace tests, branch protections, or
25926required approvals.
25927
25928For a one-off focus, add it to your pull request comment:
25929
25930`@codex review for issues in the database migration`
25931
25932#### Security Review
25933
25934Security Review is an additional review for customers that want to
25935pay particular attention to security issues in pull requests. It goes deeper
25936than Code Review on security-specific risks by analyzing the pull request diff,
25937supporting repository context, and configured threat models or security
25938guidance.
25939
25940Code Review can also identify security-related issues as part of its general
25941review, so you may see occasional overlap between Code Review and Security
25942Review findings.
25943
25944#### Set up Security Review
25945
25946For more detailed setup instructions and configuration options, see [Security
25947Review](https://learn.chatgpt.com/docs/security/security-review).
25948
259491. Set up [Codex cloud](https://learn.chatgpt.com/docs/cloud).
259502. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
259513. Under **Repository preferences**, choose which pull requests get Security
25952 Review and when it runs. Select **Whenever code review runs** to run it
25953 alongside Code Review.
25954
25955#### Request a Security Review
25956
25957To request a Security Review manually, add this comment to a pull request:
25958
25959`@codex security review`
25960
25961Codex reacts while the review is running, then posts security findings directly
25962on the pull request. Open the associated Codex task and select the **Security
25963Report** tab to view the full report.
25964
25965#### Act on review findings
25966
25967After Codex posts a review, you can ask it to fix issues in the same pull
25968request by leaving another comment:
25969
25970```md
25971@codex fix the P1 issue
25972```
25973
25974Codex starts a cloud chat with the pull request as context and can push a fix
25975back to the branch when it has permission to do so.
25976
25977#### Give Codex other tasks
25978
25979If you mention `@codex` in a comment with anything other than `review`, Codex starts a [cloud chat](https://learn.chatgpt.com/docs/cloud) using your pull request as context.
25980
25981```md
25982@codex fix the CI failures
25983```
25984
25985#### Troubleshoot code review
25986
25987If Codex doesn't react or post a review:
25988
25989- Confirm you turned on **Code review** for the repository in [Codex settings](https://chatgpt.com/codex/settings/code-review).
25990- Confirm the pull request belongs to a repository with [Codex cloud](https://learn.chatgpt.com/docs/cloud) set up.
25991- Use the exact trigger `@codex review` in a pull request comment.
25992- For automatic reviews, check that you turned on **Automatic reviews** and that
25993 the pull request event matches your review trigger settings.
25994
25835### Rules25995### Rules
25836 25996
25837Source: [Rules](https://learn.chatgpt.com/docs/agent-configuration/rules.md)25997Source: [Rules](https://learn.chatgpt.com/docs/agent-configuration/rules.md)
33462- Feature is currently limited to only specific regions. Check33622- Feature is currently limited to only specific regions. Check
33463 the individual feature documentation to learn more about geo restrictions.33623 the individual feature documentation to learn more about geo restrictions.
33464 33624
33465 † Local plugin bundles are supported when their capabilities do33625 † Local plugin bundles and OpenAI-curated plugins that don't
33466 not require ChatGPT authentication. OpenAI-curated plugin discovery and33626 require ChatGPT authentication, including Codex Security, are available.
33467 features that depend on connectors or cloud-hosted sharing aren't33627 Plugins that require ChatGPT authentication, connectors, or cloud-hosted
33468 available.33628 sharing aren't available.
33469 33629
33470#### Troubleshooting33630#### Troubleshooting
33471 33631