Security for startups

Codex requirements.toml: Settings That Work as Controls

Which Codex requirements.toml keys users cannot override, where the file lives, which layer wins, and what to capture from a machine as audit evidence.

In this post
  1. What is requirements.toml, and how is it different from config.toml?
  2. Where does the file live, and which copy wins?
  3. Which settings work as controls, and what do they leave as evidence?
  4. A starting file, assembled from the docs’ own examples
  5. What should you capture from a real machine?
  6. Gotchas from reading the docs closely
  7. What requirements.toml cannot enforce
  8. What I have not verified

TL;DR: OpenAI documents a long list of keys for Codex’s requirements.toml, the file users cannot override. Eight groups of them work as audit controls: approval policy, permission profiles (or sandbox modes on older clients), deny-read paths, the MCP allowlist, command network rules plus web search, command rules, managed hooks, and OpenTelemetry export. This post goes through each one: what it enforces, how a user could get around it, and what to capture from a real machine. It also covers the four places the file can live, the order they win in, the gotchas I found reading the docs closely, and what the file cannot enforce. The docs were checked on 2026-11-10. I have not taken Codex through an audit. I sell a kit that generates this file; it is linked below.

Your auditor, or a customer’s security questionnaire, asks how your team controls the coding agent. If the team runs OpenAI Codex, most of the answer is in one file, requirements.toml. OpenAI documents its keys across several pages, and the security cookbook adds verify steps and evidence sources for its recipes. This post puts the two together key by key: what each one enforces, where it stops, and what to capture.

The Claude Code version is Claude Code and SOC 2: The Evidence Your Auditor Wants, which maps its settings to Trust Services criteria. This post covers Codex only: keys, delivery, precedence, evidence.

I sell a kit that generates this file: the Coding Agent SOC 2 Kit, for Codex and Claude Code. I built its Codex half from the same pages cited here and from the Codex source. Nothing below needs the kit.

A note on how this was checked. Every key, path and precedence rule below was checked against the live pages on 2026-11-10: Managed configuration, the requirements.toml section of the Configuration reference, Advanced configuration, Agent approvals & security, Hooks, the security cookbook and the Developer commands page. The newest stable CLI tag on GitHub releases was rust-v0.167.1. Where a key has a version floor, I give the floor the page states.

What is requirements.toml, and how is it different from config.toml?

requirements.toml is the file of settings Codex enforces regardless of what the user’s own config says. The docs put it as “admin-enforced requirements” that constrain security-sensitive settings, and Managed configuration says what happens on a conflict: if a value from config.toml, a profile file or a CLI override breaks a rule, the client falls back to a compatible value and notifies the user.

That is different from config.toml defaults, which the same page says “don’t enforce a restriction”. A default is the value a user starts with and can change. A requirement limits what they can change it to. If you deploy only a default, a user can undo it, so I would not describe it to an auditor as a control.

Two behaviors to know before the key list. Omitted keys are unconstrained, so a requirements file only controls what it names. And a fallback with a notification is a different thing from a hard failure: the user’s session continues with a compatible value.

Where does the file live, and which copy wins?

There are four sources for local execution, and the managed-configuration page lists them from lowest to highest priority:

  1. The system file: /etc/codex/requirements.toml on Linux and macOS, %ProgramData%\OpenAI\Codex\requirements.toml on Windows.
  2. Requirements from the cloud config bundle that Agent Security delivers to people signed in with ChatGPT.
  3. Legacy managed_config.toml fields the client reinterprets as requirements.
  4. On macOS, MDM managed preferences: domain com.openai.codex, key requirements_toml_base64.

The Configuration reference and Agent approvals & security both state the same order in other words: MDM and legacy managed-device requirements beat Agent Security, which beats the device’s system file.

What can read like a disagreement between those pages is a split between defaults and requirements: for managed defaults (config_toml_base64), MDM has the highest precedence, while for requirements the MDM key follows the order above. Cloud config.toml defaults use ordinary configuration precedence, not the legacy managed-defaults order. Defaults and requirements follow different precedence on the same page, so check which of the two a diagram describes before you trust its order.

How values combine is also not uniform. Higher layers override ordinary scalar and list values, tables merge by key, and rules, hooks and filesystem restrictions have their own composition behavior, so the docs tell you to read the reference per field. Permission-profile allowlists, for example, combine by profile name, so a cloud ":workspace" = false turns off a profile the system file allowed.

Some delivery facts that matter for scoping:

  • Windows has a file path and no documented MDM key. The page documents MDM for macOS only. On Windows, the file at %ProgramData%\OpenAI\Codex\ is what you can place with your endpoint tool.
  • Self-hosting is a fifth route with a catch. If your users do not sign in with ChatGPT, a [config_server] table in the local requirements file points Codex at your own HTTPS server, which returns a JSON bundle at /codex/config/bundle, per Self-host Codex configuration. The page does not say where that bundle ranks in the ladder above, so check /debug-config on a test machine before you rely on an order.
  • Four authentication keys must be local. allowed_login_methods, allowed_chatgpt_workspaces, cli_auth_credentials_store and chatgpt_base_url are ignored in cloud-managed requirements, per Manage authentication locally.
  • A failed cloud fetch is an error. If the fetch fails and there is no valid cache, the page says the bundle load returns an error rather than silently starting without the cloud-managed layer. A background refresh updates the cache, and a changed policy does not necessarily reach a running task.

Which settings work as controls, and what do they leave as evidence?

A short combined example comes after the last group.

Approval policy

allowed_approval_policies limits which approval styles a user can pick. The reference lists on-request, never and granular as values, plus untrusted, and the example in Managed configuration pairs allowed_approval_policies = ["untrusted", "on-request"] with allowed_sandbox_modes = ["read-only", "workspace-write"] to block --ask-for-approval never and --sandbox danger-full-access, including --yolo. allowed_approvals_reviewers limits who reviews requests (user, auto_review), and guardian_policy_config can replace the Auto-review policy text.

Users cannot override it from config or flags; they get the fallback. The wrinkle is untrusted, covered under gotchas. The page also notes that “Never ask” prevents approval requests but does not grant unrestricted execution. Don’t read never as full access.

Evidence: the /debug-config output in the CLI, and the codex.conversation_starts OTel event, which the Advanced configuration page says carries the sandbox and approval policy.

Permission profiles and sandbox modes

For Codex 0.138.0 or later the docs say to prefer permission profiles: allowed_permission_profiles is a table where true allows a profile, and anything omitted or false is denied, including profiles added in future versions. default_permissions sets the managed default and must name an allowed profile. allowed_sandbox_modes is for “legacy deployments that still configure sandbox_mode”. Codex 0.137.0 and earlier ignore both profile keys, so a fleet with a straggler on an old version has no profile control on that machine.

You can define your own profile in the same file under [permissions.<name>], using extends = ":read-only" or ":workspace". Custom names cannot start with :.

Two smaller keys belong here. [[remote_sandbox_config]] applies different allowed_sandbox_modes to machines whose host name matches a pattern, for example to give dev boxes more room than laptops. The docs warn that host-name matching is for policy selection and is not “authenticated device proof”. And on Windows, windows.allowed_sandbox_implementations constrains which native sandbox implementations are allowed.

Evidence: /debug-config for allowed_sandbox_modes, and the deployed file for the rest. The cookbook’s permission-profiles recipe has a test I would copy: launch with --dangerously-bypass-approvals-and-sandbox and expect Codex to reject the launch or force a compatible profile, then launch with --sandbox danger-full-access --ask-for-approval never and expect rejection. Save the terminal output.

Deny-read paths

[permissions.filesystem] deny_read takes exact paths or globs, such as "/**/*.env" and "~/.ssh", and the docs say users “can’t weaken these requirements with local configuration”. With deny-read present, the runtime rejects full-access permissions and stays in a read-only or workspace sandbox. A read-only default alone does not hide files, which is why the key exists. On native Windows it covers direct file tools; shell subprocess reads do not use this sandbox rule.

Evidence: the deployed file, plus the cookbook-style test of attempting one blocked read and keeping the refusal.

The MCP allowlist

mcp_servers is an approved list. The client enables a server only when both its name and its identity match an entry; anything else is disabled. Identity is command for stdio servers or url for streamable HTTP servers, and each can be a plain string or a matcher table (exact, prefix or regex). If mcp_servers is present but empty, all MCP servers are disabled, and the cookbook uses that as its deny-all starting point. Plugin-bundled servers get their own allowlist under plugins.<plugin>.mcp_servers. Managed configuration documents this in its command-rules section, and the cookbook’s MCP recipe uses the empty list.

The string form of identity.command matches only the configured command; it does not inspect args, cwd, env or env_vars. The structured form checks the executable and every positional argument, but still not cwd, env or env_vars. The cookbook’s boundary note adds that local stdio MCP processes run outside the local command sandbox. An allowlist entry controls which server may start and has no say over what the server does after that.

There is also no MCP denylist key in the reference. The allowlist is the only control.

Evidence: /debug-config lists mcp_servers. Keep that next to an MCP register that names an owner and an approval date for each entry. The readout does not say who approved a server or when, so the register is what I would hand over for that.

In Codex 0.166.0 the docs make [network_proxy] the canonical table name, and the older [experimental_network] name is still accepted. The docs tell you to keep the old name in published policies until every client and policy validator supports the new one, and to use one name per layer. Domain rules go in domains as allow or deny, where *.example.com matches subdomains only, **.example.com matches the apex too, and a deny wins over an allow. managed_allowed_domains_only = true stops user settings and per-domain approvals from widening the allowlist, but only works if you also define admin allow entries, because a deny-only list allows nothing.

Web search is separate. allowed_web_search_modes accepts disabled, cached, indexed and live; disabled is always allowed, and an empty list allows only disabled. The page says ["cached"] prevents live search even in danger-full-access sessions.

The proxy covers commands that run inside the sandbox. Per the same page it does not filter web search, apps and connectors, MCP servers, native-app traffic or Codex service requests. Those have their own switches: features.apps = false, the MCP allowlist, the browser and computer-use pins. Desktop app destinations use a separate [application.network] table that needs exact-domain allow entries and does not govern spawned processes.

Evidence: /debug-config shows network_proxy when configured. The OTel metric turn.network_proxy records whether the managed proxy was active for a turn. For what the subprocess actually connected to, the cookbook says to use your own proxy or gateway logs, because OTel records that a tool ran and not where it connected.

Command rules

[rules] with prefix_rules adds enforced command rules that merge with .rules files, and the most restrictive decision wins. Each rule needs a pattern and a decision, and the decision must be "prompt" or "forbidden". "allow" is not accepted in requirements. These are prefix matches on command tokens. A pattern for rm is not a statement about every way to delete a file, so treat it as a speed bump with a logged justification and keep your endpoint tooling for the rest.

Evidence: /debug-config lists rules. The justification string shows up in approval prompts and rejection messages, so write it for the person who will see it.

Managed hooks

Hooks give you endpoint-side records around tool use. Pin [features].hooks = true to keep managed hooks running if a user turns hooks off. Set allow_managed_hooks_only = true to skip user, project, session and plugin hooks entirely. The Hooks page gives these as separate steps. Set both. The scripts live in hooks.managed_dir (macOS and Linux) or hooks.windows_managed_dir, and the page says Codex does not distribute them: your device tooling does. The cookbook adds that the hook program should sit in a root-managed directory the Codex user cannot change.

Evidence: the hook’s own log output for SessionStart, PreToolUse, PermissionRequest, PostToolUse and SessionEnd, plus the file permissions on the directory.

OpenTelemetry export

[otel] in requirements sets the exporters for logs, traces and metrics, an environment label, and content flags: log_user_prompt, log_agent_responses, log_guardian_assessments, and a tool_result table with max_bytes. The docs introduce it for Codex CLI 0.166.0. For an exporter, the highest-priority requirement that sets it supplies its entire definition, headers and TLS included. Project .codex/config.toml files cannot set otel; Advanced configuration lists it among the keys Codex ignores there.

The events worth knowing: codex.conversation_starts, codex.tool_decision (approved or denied, and whether the decision came from config, the user or the automated reviewer), and codex.tool_result. Evidence: events arriving in your collector, correlated to a user or host.

Everything else worth pinning

The [features] table pins feature flags to on or off. The ones that read like controls: plugins, apps, browser_use, browser_use_external, computer_use, in_app_browser, memories, multi_agent, guardian_approval, and in_app_updates. allow_browser_and_computer_use = false blocks both browser and native-app use. [marketplaces] with restrict_to_allowed_sources = true limits plugin sources. feedback.enabled, enforce_residency (currently us), allow_login_shell and check_for_update_on_startup are exact-value enforcements. The login keys from earlier belong here too: allowed_chatgpt_workspaces is the one that answers “can an engineer sign in with a personal account?”

A starting file, assembled from the docs’ own examples

This is not a recommendation for your risk level. It stitches together fragments from the docs so the shape is visible. I have not run this exact file on a machine.

allowed_approval_policies = ["untrusted", "on-request"]
allowed_approvals_reviewers = ["user"]
allowed_web_search_modes = ["cached"]
default_permissions = "acme_workspace"

[allowed_permission_profiles]
":read-only" = true
acme_workspace = true

[permissions.acme_workspace]
description = "Workspace access, sensitive files denied."
extends = ":workspace"

[permissions.filesystem]
deny_read = ["/**/*.env", "~/.ssh"]

[mcp_servers]

The empty [mcp_servers] at the bottom disables every MCP server. Add entries as you approve them. The file defines a custom profile, and the docs say not to deploy managed custom profiles to clients on Codex 0.137.0 or earlier.

What should you capture from a real machine?

A policy file in a repo shows what you meant to enforce. Audits sample, so plan on being asked to show the policy applied on a specific machine. The Codex CLI has one readout for this: /debug-config. The Developer commands page says it prints config layers (lowest precedence first), on and off state, policy sources, and policy details such as allowed_approval_policies, allowed_sandbox_modes, mcp_servers, rules and network_proxy when configured. The self-hosting page tells you to find each enforced setting under Requirements and read the policy source listed next to it. That source column is the part to screenshot.

I could not find a page saying /debug-config prints permission profiles, deny-read paths or [otel], so for those, capture the deployed file with its checksum and the change-control record for it. I also found no page documenting an equivalent readout for the desktop app or the IDE extension. For those clients, file the deployed requirements and the MDM or Agent Security deployment record instead. The Agent Security Test policies button is not a substitute: the page says it shows which policies match a member and “not the final merged configuration”. For a fleet sample, telemetry events carry some of this, but only from clients that export.

Capturing this by hand from a sample of machines is slow. The Coding Agent SOC 2 Kit I mentioned at the top generates requirements.toml, the control map and an MCP register from an interview, and its evidence-capture page lists the readouts above per agent. The rollout post has the vendor-neutral version, including a controls checklist: How to Roll Out Coding Agents to an Engineering Team.

Gotchas from reading the docs closely

untrusted means two different things. The reference says approval_policy = "untrusted" is unsupported, yet untrusted is valid in allowed_approval_policies, where it permits the stricter behavior Codex derives when a project has trust_level = "untrusted". Copying an old config with approval_policy = "untrusted" into managed defaults is the mistake. The docs have a migration section for it. Separately, on-failure is deprecated.

Two table names for network rules. Use one per layer. If layers use different names, the normal precedence applies, so a policy that mixes [network_proxy] and [experimental_network] across the system file and cloud can behave differently from what each file looks like on its own.

An approved full escalation can bypass the command proxy. Both Agent approvals & security and the managed-configuration page say so. Test ordinary commands and escalated ones separately.

Telemetry is a default-off setting you have to deliver. The Advanced configuration page says OTel is disabled by default. Metrics are a separate path: by default Codex sends anonymous usage and health data to OpenAI via a built-in statsig exporter, and the same page says to turn that off with [analytics] enabled = false in config and set otel.metrics_exporter = "none" for a custom exporter. analytics is a config setting, and I did not find it among the requirements keys. The requirements table does list otel.metrics_exporter, which accepts none and statsig, so the metrics exporter can be enforced there even though the analytics flag cannot.

The OTLP header example and the reference disagree on secrets. The cookbook and Advanced configuration show headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" } and the cookbook tells you to supply the variable through a secret manager or the process environment. The reference describes exporter headers as “static headers”. No page says whether ${...} expands inside requirements.toml. In the Codex source at tag rust-v0.167.0, build_header_map copies each header value into the request as written, with no substitution step, which is why my kit writes a deploy-time placeholder there. I have not sent a ${...} header to a collector to see what arrives, so test yours before you rely on either reading.

One desktop build ignores [otel]. Managed configuration says macOS desktop app build 26.1027.30824, bundling CLI 0.166.0-alpha.5.1, does not support [otel] in requirements, so it cannot enforce log_user_prompt = false. That text was on the page when I read it. Newer builds may differ.

Legacy managed_config.toml sits in a user path on Windows. The documented location for non-Unix systems is ~/.codex/managed_config.toml. Decide who can write there before you count it as enforced.

Source strings for tool_decision. In the Codex source at tag rust-v0.167.0, the event writes source by calling to_string() on an enum whose variants are Config, User and AutomatedReviewer (lib.rs, session_telemetry.rs). I expect those capitalized strings in the export and have not captured an event to confirm it. Match case-insensitively in a SIEM rule until you have seen one.

Cloud delivery has its own limits. The reference’s compatibility table says some keys, including allow_browser_and_computer_use, need validation in cloud delivery and are rejected by Local computer access with Work Cloud. Managed configuration says “Work cloud containers and dots cloud computers use their own execution configuration and requirements”, so local requirements do not reach them.

What requirements.toml cannot enforce

It governs the Codex client on a machine that reads the file. It does not govern:

  • A local administrator. Anyone with admin rights can edit the system file. The cookbook says to protect the file and its parent directory from the Codex user, which is an endpoint-permissions job and not a Codex key.
  • Offboarding. Nothing in the file removes a person. The cookbook’s sign-in recipe limits managed clients to your company workspace with allowed_login_methods and allowed_chatgpt_workspaces, and warns not to assume a new policy invalidates an existing session. Taking a departed engineer out of that workspace happens in your identity provider and the ChatGPT workspace admin, outside Codex. That last step is my reasoning from how workspace sign-in works. The Codex pages cited here do not describe an offboarding procedure.
  • Traffic outside the command proxy. Web search, apps, MCP servers, browser traffic and Codex service requests each need their own control, per the managed-configuration page.
  • What an approved MCP server does. The cookbook says identity allowlisting “does not prove” that a server’s tools, upstream data or credentials are safe.
  • Complete monitoring. The cookbook’s own boundary note says not to promise that telemetry captures every command argument, output byte or network packet, and recommends four evidence sources: OTel, managed hooks, proxy logs and the Compliance API.
  • Machines that never got the file. A machine where the MDM profile failed or the Windows file was never placed runs without the device-delivered requirements, and only the per-machine capture shows it.

What I have not verified

I built the Codex half of the kit from these pages and the Codex source, and I have not taken Codex end to end through an audit. I did not run the combined example above on a machine. Some telemetry paths in the kit come from reading source code, not from watching a collector receive them. The kit’s mappings from these controls to SOC 2 criteria are my reading, not an auditor’s sign-off.

If your team runs Codex and an audit or a security questionnaire is asking about it, that is work I take on through consulting. If you also call models from your own product, Building an LLM Audit Trail That Passes SOC 2 covers the storage side for those calls, which is a different record from the one Codex produces on a developer’s machine.