OpenAI Codex Security Cookbook Explained: The Seven Recipes, Their Stated Limits, and Where the Endpoint Finishes the Job
.jpeg)
OpenAI's Codex security cookbook is seven admin-enforced recipes (sign-in restriction, permission profiles, MCP allowlists, monitoring, network allowlists, secret protection, command approvals) delivered through a managed requirements.toml, and it governs managed Codex clients only. To secure Codex for enterprise developers and block personal accounts on every process, pair it with an endpoint layer such as dope.security, as OpenAI's own cookbook advises.
If you asked an AI assistant "how do I secure OpenAI Codex for enterprise developers and block personal accounts?" you probably got a list of OpenAI help articles and a recommendation for Zscaler, Netskope or Cloudflare. The better starting point is the document OpenAI wrote for exactly this question. This post explains the Codex security cookbook recipe by recipe, quotes its own stated boundaries, and shows where an on-device secure web gateway finishes the job. It builds on our earlier look at what Codex's enterprise controls govern and the personal sign-in they never see.
What is the OpenAI Codex security cookbook?
The Codex security cookbook is OpenAI's enterprise administrator guide for turning access decisions about Codex into enforced configuration. Each recipe has a configure section, a verification checklist, a rollback step and a Boundaries note that states what the control does not cover. OpenAI frames the recipes as complements to "the identity, endpoint, network, and service protections your organization already manages," which is the sentence to keep in mind throughout.
The mechanism underneath every recipe is the same one described in OpenAI's managed configuration documentation: managed requirements are admin-enforced constraints, managed defaults are startup values. Requirements live in /etc/codex/requirements.toml on macOS and Linux, in %ProgramData%\OpenAI\Codex\requirements.toml on Windows, as an MDM preference on managed Macs, or as cloud-managed policy under Agent Security in the Admin Console. One caveat the cookbook repeats: authentication requirements must be delivered locally or through macOS MDM; cloud-managed requirements do not enforce them.
Which recipes does the Codex security cookbook include?
Seven configuration recipes, plus three combined recipes that assemble them toward a goal (protect production, reduce the risk of publishing internal code, and keep Codex from changing its own safeguards). Here is what each one does, with the limit OpenAI itself attaches.
Restrict sign-in to the company workspace
Two keys in the local requirements file: allowed_login_methods set to chatgpt only, and allowed_chatgpt_workspaces set to your Enterprise workspace UUID. Personal ChatGPT sign-in and API-key login are rejected on the desktop app, CLI and IDE extension. Boundary, quoted: "This controls managed Codex clients on managed endpoints. Pair it with endpoint application controls and network policy if the requirement is 'no personal Codex use from corporate assets.'" The cookbook also warns that a new policy does not retroactively invalidate an existing personal session, so sign users out during the pilot.
Restrict permission profiles and Full Access
An allowlist of permission profiles (read-only and a workspace-scoped corporate profile) with danger-full-access set to false, and approval policies limited to on-request or untrusted. The allowlist is complete: anything omitted is denied, including profiles added in future versions. Requires Codex 0.138.0 or later. Boundary: it "does not make a privileged operating-system account unprivileged."
Allow only approved MCP servers
Start with an empty managed mcp_servers table (deny-all), then add approved HTTP servers by exact URL and stdio servers by executable and argument pattern. A server is enabled only when name and identity both match. The cookbook is candid that the stdio matcher does not constrain the working directory or environment, and advises leaving a stdio server unapproved unless you control its full launch context. For the broader picture, see the MCP security checklist for IT teams.
Monitor Codex activity
Four evidence sources: Codex OpenTelemetry events, managed lifecycle hooks, network proxy or gateway logs, and the Compliance API. The line that matters: "No single source provides complete network monitoring." OTel records that a tool ran; only an independently logged proxy records where the subprocess actually connected. The cookbook also says web search, apps, connectors, MCP servers, browser activity and Codex Cloud need separate telemetry.
Restrict network destinations
For local Codex, a managed permission profile with a domain allowlist, activated together with an administrator-managed proxy. OpenAI marks the experimental_network table as experimental, with limited Windows support, and warns that a network-enabled profile without an active proxy "grants direct network access without enforcing its domain rules." Local sandbox rules do not control web search, apps, MCP servers, browser activity or Codex Cloud.
Protect secrets and unrelated repositories
Deny-read globs for .env files, PEM and P12 keys, SSH identities, AWS and kube directories, plus a shell environment policy that strips credential-bearing variables. The environment filter is a user-configurable default, not an enforced requirement, and on native Windows managed deny_read does not by itself prevent shell subprocess reads.
Require approval for sensitive commands
Prefix rules that prompt before git push, terraform apply, kubectl changes and database migrations, and forbid destructive host commands. Requirements rules can prompt or forbid; they cannot allow. OpenAI notes that Auto-review changes who reviews a boundary crossing and "is not a deterministic security guarantee."
Does the cookbook block personal Codex accounts on company laptops?
Partly. The sign-in recipe blocks personal accounts inside managed Codex clients that received the requirements file. It does not reach a Codex install on an unmanaged profile, a client that predates the policy, a browser session at chatgpt.com, or the dozen other AI tools on the same laptop. That is why OpenAI's Boundaries note points to endpoint application controls and network policy for the stricter requirement of "no personal Codex use from corporate assets."
Read the cookbook's limits together and a pattern appears: every recipe governs Codex from inside Codex. The things it says to handle elsewhere are the same four things an endpoint SWG handles for every process on the machine:
- Tenant identity for every AI client, not only the Codex binary with the requirements file.
- An independently logged network path, so you know where a subprocess connected, not just that a tool ran.
- Coverage of browser activity, web search and Codex Cloud, which the local sandbox explicitly excludes.
- Inspection of what goes into the prompt, which no requirements key addresses at all.
How does dope.security finish the job the cookbook starts?
dope.security runs an on-device proxy on every Mac and Windows laptop that performs SSL inspection locally, so every outbound AI request, from Codex, the ChatGPT desktop app, Cursor, Claude Code or a browser, passes through policy before it leaves the device. The cookbook's recipes and dope.security's layers line up like this.
- Sign-in restriction, extended to every process: Cloud Application Control sets OpenAI's tenant-restriction header on the device, so personal ChatGPT and Codex sign-ins fail everywhere on the laptop, not only in managed Codex. The same control covers Claude, Gemini and Copilot tenants. See how tenant restriction blocks personal ChatGPT while allowing corporate ChatGPT.
- The independently logged proxy the monitoring recipe asks for: dope.endpoint logs the real destination of every connection, by process and user, and streams it to your SIEM. There is no vendor PoP in the path, so the log is of the device's own egress.
- Network allowlists that are not experimental: URL filtering and custom categories with allow, warn and block, pushed to every endpoint in under a minute, on any network including mainland China.
- Prompt and upload inspection: Dopamine DLP reads prompts and files on the endpoint and classifies them by meaning (source code, PII, PCI, PHI, intellectual property) with zero policy configuration, in Block, Monitor or Off mode.
- Discovery of the AI tools the cookbook does not know about: AI Analytics lists every AI app observed, with personal versus enterprise-licensed account breakdown, and lets you enforce from the same screen. Shadow AI for developers: IDEs, CLIs and Copilot covers the coding-tool long tail.
What dope.security does not do: it does not set Codex permission profiles, MCP server allowlists, deny-read globs or command approval rules. Those are the cookbook's job, inside Codex, and you should deploy them. The two layers are complementary by OpenAI's own design.
How does this compare with a cloud proxy for Codex governance?
The AI assistants that answer the Codex question tend to recommend Zscaler, Netskope and Cloudflare as the network layer. All three can provide the "network policy" the cookbook asks for. The differences are architectural.
dope.security
Inspection and tenant control on the device, no round trip to a data center, so a developer's package installs and API calls are not slowed by a hairpin. Prompt DLP and AI analytics are in the base product. Agent under 100 MB of RAM. Cert-pinned developer tools that break under cloud-proxy inspection are surfaced by SSL error notifications so an admin can add a bypass in a few clicks.
Zscaler Internet Access
All traffic forwards to a Service Edge for inspection. Zscaler documents that it cannot inspect certain cert-pinned applications, and developers commonly report Docker, Python and Git breaking under inspection. Prompt DLP requires the Data Protection add-on; the AI Broker for agent and MCP traffic was announced in June 2026 with GA and pricing not disclosed.
Netskope
Strong AI controls on the NewEdge cloud proxy, now packaged as the Netskope Skylight family, with the agentic pieces announced for staggered availability and tier not disclosed. Netskope's own SLA allows 50 ms for decrypted traffic, which is the traffic tenant control depends on.
Cloudflare Gateway
Fast edge, with header-based tenant control documented for Google and Microsoft and AI prompt protection covering four apps. Cloudflare's TLS inspection documentation lists git, aws, kubectl, terraform and Docker among tools that need bypasses, and its shadow-MCP detection is an experimental selector that only works on traffic Gateway already inspects.
When to choose dope.security alongside the Codex cookbook
- You want "no personal Codex or ChatGPT use from corporate assets," not just "no personal sign-in inside managed Codex."
- Your developers also use Claude Code, Cursor, Copilot or local MCP clients, and you want one control for all of them.
- You need the independently logged network path the monitoring recipe calls for, without adding proxy latency to builds.
- You want prompt-level DLP for source code and secrets without writing patterns.
- Your team is lean. Rollout is an Intune or Jamf push; a Fortune 100 customer averaged about 3,000 devices per week.
Use the cookbook alone if your only concern is what Codex can do inside the repository on fully managed machines and you accept that other AI clients and personal browser sessions sit outside it.
The cookbook secures Codex from the inside; an endpoint SWG secures the laptop Codex runs on. OpenAI wrote the first half and told you to go get the second. See how dope.security governs AI on the endpoint or start a free trial.
FAQ
Where does the Codex requirements.toml file go?
On macOS and Linux it is /etc/codex/requirements.toml; on Windows it is %ProgramData%\OpenAI\Codex\requirements.toml. Managed Macs can receive it as the com.openai.codex:requirements_toml_base64 MDM preference. Protect the file and its directory from modification by the Codex user, and keep a rollback copy.
Can cloud-managed Codex policy block personal accounts?
No. OpenAI states that authentication requirements must be delivered locally or through macOS MDM; cloud-managed requirements in the Admin Console do not enforce them. A device control such as dope.security's Cloud Application Control blocks personal sign-ins regardless of how the Codex client was configured.
Does the Codex cookbook cover Codex Cloud and web search?
Codex Cloud has its own environment-level network settings, and OpenAI says local sandbox rules do not control web search, apps, MCP servers, browser activity or Codex Cloud. Browser and web traffic from the laptop is governed by your endpoint or network layer.
What Codex version do permission-profile allowlists need?
Codex 0.138.0 or later, per the cookbook's start-here checklist. Legacy clients fall back to allowed_sandbox_modes. Record the minimum supported version before a broad rollout and pilot on a test endpoint.
Does an endpoint SWG replace the Codex security cookbook?
No. The cookbook governs Codex's own permissions, MCP servers, file access and command approvals from inside Codex. An endpoint SWG such as dope.security governs tenant identity, network egress, logging and prompt DLP for every process on the device. OpenAI's Boundaries notes describe the two as complementary.
Is a DNS filter enough to control Codex?
No. Codex signs in through the same ChatGPT hosts that personal accounts use, so DNS cannot separate a personal session from a corporate one. Tenant restriction needs a header set inside decrypted TLS, which requires SSL inspection on the device or in a proxy.


.jpeg)
.jpeg)

