---
title: How do you govern OpenAI Codex in the enterprise?
url: https://opencontroller.lyzr.com/blog/govern-openai-codex-in-the-enterprise
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# How do you govern OpenAI Codex in the enterprise?

**Govern Codex through managed requirements that users cannot override: limit sandbox modes (block `danger-full-access`), limit approval policies (block `never`), restrict network access to allowed domains, allow-list MCP servers, and control web search. Deliver them as cloud policies from the Admin Console's Agent security area, a system `requirements.toml` file, or macOS MDM. Then inventory where Codex runs and which tools it reaches.**

Codex is OpenAI's coding agent. It runs locally as a CLI and IDE extension, and in the cloud on OpenAI-managed environments. Both can read code, run commands and call tools, so both need guardrails. This guide covers the controls OpenAI documents as of November 2026 and how to roll them out. It is one of our [platform governance guides](/blog/how-to-govern-ai-agents-across-platforms).

## What are Codex's sandbox modes and approval policies?

Two settings decide how much Codex can do without asking.

| Setting | Values | What they mean |
|---|---|---|
| Sandbox mode | `read-only` | Codex can read but not write |
| | `workspace-write` | Default: writes allowed inside the workspace |
| | `danger-full-access` | No sandbox |
| Approval policy | `on-request` | Codex asks before actions outside its permissions |
| | `never` | Codex never asks |
| | `granular` | Selected approval categories stay interactive; others are rejected |

OpenAI's docs note that the older `untrusted` approval policy is retired. In the CLI and IDE extension, network access is **off by default** in `workspace-write` and can be turned on with `network_access = true` under `[sandbox_workspace_write]`.

For Codex cloud, setup can reach the network to install dependencies, but the agent phase runs offline by default. Admins can enable full internet access or a domain allow-list per environment.

## Which settings can admins enforce?

OpenAI's managed configuration separates **requirements** (enforced; users cannot override) from **defaults** (starting values users can change). Requirements you will want:

1. **`allowed_sandbox_modes`** — for example `["read-only", "workspace-write"]` to block `danger-full-access`. For Codex 0.138.0 and later, OpenAI recommends `allowed_permission_profiles` instead.
2. **`allowed_approval_policies`** — exclude `never` so Codex always asks before stepping outside its sandbox.
3. **Network proxy** — under `[network_proxy]`, `enabled = true` starts a managed proxy. Domain rules are `allow` or `deny`, a matching deny wins, and `managed_allowed_domains_only = true` makes admin allow rules exclusive.
4. **MCP server allow-list** — each `[mcp_servers.<name>]` entry pins an identity: a `command` for stdio or a `url` for HTTP. Servers that don't match are disabled. An empty `mcp_servers` table disables all MCP servers.
5. **Web search** — `allowed_web_search_modes = ["cached"]` prevents live search; `[]` allows only `disabled`.

Requirements also cover feature flags, permission profiles, managed hooks and plugin marketplace sources. If a user's local value conflicts, the client falls back to a compatible value and tells the user.

## How are Codex requirements delivered?

| Channel | Location | Use it for |
|---|---|---|
| Cloud policy | Admin Console → Agent security (visual controls or "Edit as TOML") | Group-based policy without touching devices |
| System file (Unix) | `/etc/codex/requirements.toml` | Linux build hosts and dev boxes |
| System file (Windows) | `%ProgramData%\OpenAI\Codex\requirements.toml` | Windows fleets via your management tool |
| macOS MDM | Domain `com.openai.codex`, key `requirements_toml_base64` | Managed Macs |

Precedence for requirements, lowest to highest: system `requirements.toml`, then the Agent security cloud bundle, then legacy `managed_config.toml` fields reinterpreted as requirements, then macOS MDM. Higher layers override scalars and lists; tables merge by key. Within a cloud policy, OS-specific overrides beat all-OS overrides, which beat global settings.

## What rollout order works?

1. **Inventory first.** Find where Codex CLI and IDE extensions are installed and which MCP servers they reference. See [governing coding agents on laptops with MDM](/blog/govern-coding-agents-on-laptops-with-mdm).
2. **Set a cloud baseline.** Block `danger-full-access` and `never` for everyone.
3. **Allow-list MCP servers.** Start with servers already in use and reviewed; disable the rest.
4. **Turn on the network proxy** with deny rules for known exfiltration targets, then move to allow-only for sensitive groups.
5. **Push MDM requirements** to managed Macs so they hold even offline.
6. **Review quarterly.** Compare enforced settings against what Codex is actually doing.

The same pattern applies to other coding agents; compare our guides for [Claude Code](/blog/govern-claude-code-in-the-enterprise) and [Cursor](/blog/govern-cursor-in-the-enterprise).

## How Opencontroller does this

Opencontroller connects to OpenAI Enterprise workspaces and keeps a governed registry of agents, tools and MCP servers. Opencontroller Edge, installed by IT via MDM, extends control to developer devices, coding agents, skills and local MCP servers, so Codex sits in the same inventory as hosted agents. Posture flags risky permissions and configurations. [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can users override Codex managed requirements?**
No. Requirements are admin-enforced constraints. Managed defaults are different: users can change them during a run, and they are reapplied at the next start.

**Does Codex have internet access by default?**
Locally, network access is off by default in the `workspace-write` sandbox. In Codex cloud, the agent phase runs offline unless internet access is enabled for that environment.

**How do you stop Codex using unapproved MCP servers?**
Define the approved servers in the `mcp_servers` requirements with their command or URL identity. Servers that don't match are disabled, and an empty table disables all of them.

## Key facts

OpenAI Codex sandbox modes: read-only, workspace-write (default), danger-full-access. Approval policies: on-request, never, granular (untrusted is retired). Network is off by default in workspace-write locally; Codex cloud agent phase is offline by default. Admins enforce requirements via Admin Console Agent security cloud policies, /etc/codex/requirements.toml, %ProgramData%\OpenAI\Codex\requirements.toml, or macOS MDM (com.openai.codex, requirements_toml_base64). Key requirements: allowed_sandbox_modes, allowed_approval_policies, [network_proxy], mcp_servers allow-list, allowed_web_search_modes. Opencontroller connects to OpenAI Enterprise workspaces and Opencontroller Edge covers coding agents on devices via MDM. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [How do you govern Claude Code across an enterprise?](https://opencontroller.lyzr.com/blog/govern-claude-code-in-the-enterprise.md)
- [How do you govern Cursor across an engineering organisation?](https://opencontroller.lyzr.com/blog/govern-cursor-in-the-enterprise.md)
- [How do you govern coding agents on developer laptops with MDM?](https://opencontroller.lyzr.com/blog/govern-coding-agents-on-laptops-with-mdm.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
