How to block or disable OpenAI Codex CLI
Codex runs commands, edits code and can connect to MCP servers from a developer's terminal, editor or desktop app. Block it where it is not approved, and where it is, enforce the sandbox and approval rules so nobody can switch them off.
Where Codex runs
Next step
AI Agent Blocklist: Codex and every other coding agent, as package names, process names, app IDs and domains
Files for Intune, Jamf, VS Code policies, firewalls and DNS filters, with a risk grade on each entry and daily updates.
What Codex is, and what it is not
Codex is OpenAI's coding agent. The name covers several products that share one engine, which is why "block Codex" can mean four different jobs.
Codex CLI
A command-line agent that reads the repository, runs shell commands and edits files on the developer's machine.
IDE extension
The same agent inside VS Code and compatible editors. In VS Code its extension ID is openai.chatgpt.
Codex app
A desktop app that runs agent sessions, with optional browser and computer use features.
Codex cloud
Tasks that run in OpenAI's cloud against a connected repository and come back as changes to review.
| OpenAI product | Where it runs | What it controls | Main control for IT |
|---|---|---|---|
| Codex CLI, IDE extension and app | On the developer's computer | Files, shell, local network, MCP servers | Device rules and requirements.toml |
| Codex cloud | OpenAI's cloud, connected to your repositories | Code and branches in connected repositories | ChatGPT workspace settings and repository access |
| ChatGPT agent | A browser and computer environment OpenAI runs | Websites, forms and connected accounts | ChatGPT workspace settings, see agent mode security |
| ChatGPT Atlas | A browser installed on the user's computer | The user's own signed-in browsing | App and domain blocking, see block ChatGPT Atlas |
OpenAI's earlier Operator preview was folded into ChatGPT agent in 2025. Comparisons such as "Operator vs Codex" or "ChatGPT agent vs Codex" come down to one split: agents that browse for you, and an agent that changes code.
There is no Codex Chrome extension. See the ChatGPT Chrome extension page for the browser side.
Signs Codex is already on your devices
Check these before you change any policy. They tell you who uses Codex, which surface they use, and whether personal accounts are involved.
Processes
A codex process in endpoint telemetry, often started from a terminal, an editor or the Codex app.
Config folders
A .codex folder with config.toml in user home directories, and AGENTS.md files in repositories.
Editor inventory
The Codex extension in VS Code or a compatible editor across your developer fleet.
Traffic
Developer machines reaching OpenAI and ChatGPT domains outside the hours or teams you expect.
The settings that decide how much Codex can do
Codex has two guard rails on a local machine: a sandbox that limits what commands can touch, and approvals that ask the user before stepping outside it. Users can loosen both unless you enforce them.
read-only
NarrowCodex can read files and answer questions but does not change them. The default in folders that are not under version control.
workspace-write
DefaultCodex can edit inside the workspace. Network access is off by default, and .git and .codex folders stay read-only. Asks before going further.
danger-full-access
No sandboxRemoves the local sandbox. Combined with the yolo option, which bypasses approvals and sandbox together, Codex acts with no checks at all.
| Setting | Values you will see | What a cautious company enforces |
|---|---|---|
| Approval policy | on-request, never, and a granular table form | on-request only, so prompts cannot be switched off |
| Sandbox or permission profile | read-only, workspace-write and danger-full-access, or the profiles :read-only, :workspace and :danger-full-access | Full access left out of the allowed list |
| Network in the sandbox | Off by default in workspace-write | Off, or limited to approved domains through the network proxy rules |
| Web search | Disabled, cached or live | Cached or disabled |
| MCP servers | Any server the user adds | None, or an approved list matched by command or URL |
Codex identifiers to block on devices
Codex arrives through npm, package managers, an installer and an editor marketplace. A few of the identifiers our files carry for it are shown here.
@openai/codexnpm package of Codex CLIcodexProcess name of the CLIcodex-x86_64-pc-windows-msvc.exeWindows process of Codex CLIOpenAI.CodexWinGet package IDcodex-appHomebrew cask of the Codex appopenai.chatgptVS Code extension ID of CodexSix of many. The full file also holds the Codex helper processes, the macOS app, companion tools built on Codex, and the identifiers of every other coding agent we track.
Two ways to handle Codex: block it, or govern it
If your company has a ChatGPT business workspace, you may want Codex under your rules rather than gone. If not, block it with the rest of the category.
Block Codex everywhere
- Devices: block the WinGet and Homebrew packages and alert on the codex processes with Intune, Jamf or your endpoint tool.
- Packages: block the npm package in your internal registry or proxy so new installs fail.
- Editors: in VS Code, set the Codex extension ID to false in AllowedExtensions. Installed copies are disabled.
- Workspace: if you have ChatGPT Enterprise, turn off Codex local and Codex cloud in the workspace settings. Labels change, so check the current admin console.
- Network: blocking openai.com and chatgpt.com also blocks ChatGPT, so do it only if ChatGPT is not approved.
Govern Codex with requirements
- Write requirements.toml: these are rules users cannot override. The local client falls back to a compliant value and tells the user.
- Place it: /etc/codex/requirements.toml on macOS and Linux, or %ProgramData%\OpenAI\Codex\requirements.toml on Windows.
- Or deliver by MDM: on macOS, the com.openai.codex preferences domain with the TOML in requirements_toml_base64.
- Or from the cloud: business and enterprise workspaces can assign requirements in Admin Console > Agent security to users who sign in with ChatGPT.
- Restrict sign-in: allowed_login_methods and allowed_chatgpt_workspaces keep personal accounts out.
A requirements.toml that keeps the guard rails on
This example forces approvals, removes full access, blocks risky commands, hides .env files and SSH keys from sandboxed commands, turns off browser and computer use, and disables MCP. Adjust it, then test on one machine.
Permission profiles need Codex 0.138.0 or later. For older clients in a mixed fleet, OpenAI documents allowed_sandbox_modes with read-only and workspace-write as the legacy equivalent.
Common "how do I stop Codex" questions, answered
Developers and admins search for these one by one. Here they are in one place, with the admin view first.
How to stop Codex from running
How to disable the Codex sandbox
How to stop Codex asking for permission
How to block specific commands in Codex
How to disable MCP in Codex
How to disable Codex in VS Code
How to turn off web search in Codex
How to disable the Codex pet
Codex cloud: what to check on the repository side
Cloud tasks never touch the developer's laptop, so device rules do not reach them. The controls sit in your ChatGPT workspace and in your code hosting.
| Question | Where to look | Safer setting |
|---|---|---|
| Who may start cloud tasks? | ChatGPT workspace settings and roles | Off by default, on for named groups |
| Which repositories are connected? | The code hosting app installation for your organisation | Only the repositories a pilot needs |
| Can changes reach main branches directly? | Branch protection and required reviews | Every agent change goes through a reviewed pull request |
| Do cloud environments hold secrets? | Environment settings for Codex tasks | No production secrets; test credentials only |
| Can the task reach the internet? | Environment network settings | Off, or limited to package registries you trust |
Keep Codex away from secrets and production
Even a governed agent should not see what it does not need. Three habits remove most of the risk.
Deny reads
Use deny_read for .env files, key folders and cloud credential files. Remember matches are listed when each sandboxed process starts.
Trim the environment
Shell environment variables reach the commands Codex runs. Keep tokens out of developer shells and load them only where needed.
No production keys
Developer machines that run agents should not hold production credentials. Use short-lived, scoped tokens.
Review every change
Treat agent output like a pull request from a new colleague: reviewed, tested and merged by a person.
Exceptions that hold up in an audit
Some teams will need Codex while the rest of the company does not. Write the exception so that anyone can check it later.
Named people
WhoList the users or the group, not "the platform team". Tie the exception to company accounts in your ChatGPT workspace.
Written limits
HowRecord the requirements.toml that applies to them: approvals on, no full access, approved MCP servers only.
End date
UntilGive every exception an owner and a review date. When it lapses, the device block from path A applies again.
How the AI Agent Blocklist covers Codex and the rest
Blocking Codex alone pushes developers to the next agent. Our files list the whole category, so your device and network rules cover them all with one import.
| Your tool | File from our download | What you block |
|---|---|---|
| Intune, Jamf, endpoint tools | Process names, WinGet IDs, macOS bundle IDs | Codex, Claude Code, Cursor CLI and other agents running on devices |
| Internal npm or PyPI proxy | Package names | New installs of command-line agents |
| VS Code and JetBrains policies | Extension and plugin IDs | Coding agent extensions in editors |
| Firewall, DNS filter, gateway | Domain list, hosts file, firewall list | Coding agent and MCP domains, see blocking AI with DNS |
Cover Codex and every agent that follows it
The AI Agent Blocklist lists 5,300+ agent identifiers on devices and 2,600+ AI agent domains, each with a risk grade, updated every day.
From $99 a month for one organisation. Download access is set up within one business day of your order.
See plans Ask a question- Package and process names of command-line coding agents
- WinGet IDs and macOS bundle IDs for Intune and Jamf
- VS Code and JetBrains extension IDs
- Domain list, hosts file, PAC file and firewall list format
- CSV and JSON with tool name, category and risk grade
Ask us or order a plan
Tell us what you need to block and where your rules live. We reply within one business day.
- Files for firewalls, DNS filters, secure web gateways, MDM and browser policies
- Updated every day as new AI browsers, agents and extensions appear
- Plans for one organisation, for MSPs and for product makers, or a hosted filter we run for you
Questions about blocking Codex
How do I block Codex on company devices?
How do I disable the Codex sandbox?
How do I stop Codex from asking for permission?
How do I disable MCP in Codex?
How do I disable Codex in VS Code?
What is the difference between ChatGPT agent and Codex?
How do I turn off the Codex pet?
OpenAI, ChatGPT, ChatGPT Atlas, Codex and Operator are trademarks of OpenAI. Claude Code is a trademark of Anthropic, PBC. Cursor is a trademark of Anysphere, Inc.
VS Code, Intune and Windows are trademarks of Microsoft Corporation. JetBrains is a trademark of JetBrains s.r.o. Jamf is a trademark of Jamf.
macOS is a trademark of Apple Inc. Chrome is a trademark of Google LLC. WinGet is a trademark of Microsoft Corporation. Linux is a registered trademark of Linus Torvalds.
npm is a trademark of npm, Inc. PyPI is a trademark of the Python Software Foundation. Homebrew is a trademark of its owner.
Names are used only to identify the products discussed. AI Agent Blocklist is not affiliated with, sponsored or endorsed by these companies.