For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Codex security cookbook

Configure, verify, and combine enterprise controls for Codex access, files, services, and actions

Rolling out Codex means deciding which accounts, files, and services it should be able to access and which actions it should be able to take. This cookbook helps enterprise administrators turn those decisions into configuration, test the results, and understand where additional protections are needed.

These security recommendations are intended to help you give developers useful access to Codex while reducing the risk of unintended changes, exposure of sensitive data, and changes to the safeguards themselves. Use them to choose controls that fit your workflows and risk requirements, understand their limits, and verify how they work in your environment. They complement the identity, endpoint, network, and service protections your organization already manages.

You can start with a specific task—such as restricting sign-in to your company workspace—or a broader goal, such as letting developers use Codex while protecting production.

Choose the starting point that fits your work:

  • Configuration recipes walk through individual controls, with setup instructions, verification checks, rollback guidance, and limitations.

  • Combined recipes show how to combine several controls with protections in your identity, source control, deployment, and other systems to meet a common security goal.

The examples give you a starting point to adapt to your organization. Use each configuration example with its accompanying guidance: where it belongs, which clients or environments it applies to, and what it does and does not control.

Before a wider rollout, try the configuration on a test endpoint. Check that an intended workflow succeeds and an intentionally restricted action is blocked. Use those results to refine the setup and explain the boundaries to the people who will use Codex.

Choose your starting point

Use the page outline to open a section below.

If you want to Start with
Configure one specific control Configuration recipes
Let developers use Codex while protecting production Let developers use Codex while protecting production
Reduce the risk of publishing internal code Reduce the risk of publishing internal code
Keep Codex from changing its own safeguards Keep Codex from changing its own safeguards

The combined recipes include the relevant controls, external protections, and checks for each goal.

Start here

  1. Inventory the surfaces in scope: desktop app, CLI, IDE extension, Codex Cloud, CI runners, and remote hosts.

  2. Pilot the configuration on a test endpoint before a broad rollout.

  3. Record the minimum supported Codex version. Permission-profile allowlists require Codex 0.138.0 or later.

  4. Keep a rollback copy of each managed configuration bundle.

  5. Test one allowed workflow and one intentionally blocked workflow after every change.

Managed requirements are admin-enforced constraints; managed defaults are startup values. Use requirements for supported authentication, sandbox, approval, MCP, plugin, hook, and network restrictions. Authentication requirements must be delivered locally or through macOS MDM; cloud-managed requirements do not enforce them. See Managed configuration and the Configuration Reference.

Where configuration belongs

Adapt these example configurations to your organization before rolling them out to a pilot group. The TOML blocks are policy fragments: merge the settings you need into your existing files, without duplicating tables, and replace example names, domains, and paths. The checks describe expected outcomes to validate in your environment.

For local Codex, an administrator can deploy enforced requirements in /etc/codex/requirements.toml on macOS and Linux or %ProgramData%\OpenAI\Codex\requirements.toml on Windows. On managed macOS devices, an MDM can deliver the com.openai.codex:requirements_toml_base64 preference. Cloud-managed policy can also be configured in the Admin Console under Agent Security by selecting a policy, choosing the applicable environment or OS, and configuring Requirements. Protect the policy file and its parent directory from modification by the Codex user. Settings in a regular config.toml or managed Defaults provide startup values rather than enforced requirements. See Managed configuration and Agent Security.

Configuration recipes

Choose the control you need. Open a recipe to see its configuration, verification checks, rollback guidance, and limitations. Check items as you verify them; progress is saved in this browser when browser storage is available.

Combined recipes for enterprise security goals

These examples show how to combine controls for common enterprise security goals. Test the configuration on each client and environment in scope.

Source pages