Codex can review code, edit files and run tools. In a corporate environment, the question is how to give it useful work while keeping production systems, credentials and the internal network outside its reach.
This guide proposes a conservative starting architecture: a dedicated development VM, a sanitised repository, no route to corporate systems, command networking disabled, and an organisation-managed account. Administrators own the enforcement. The article focuses on local Codex CLI and supported local desktop execution; cloud execution requires its own policy.
Execution and connectivity: sandbox policy, disabled tools and an external network boundary determine what actions are possible. Model training: account and workspace data controls determine whether supplied content can be used to improve models. Both need attention.
1. Define the corporate boundary
Write down the intended outcome before configuring a client: Codex may inspect an approved copy of code, but it must have no authorised path to execute actions against corporate systems. If the requirement is zero command execution even inside the development VM, remove command tools as well.
A read-only sandbox still permits commands that can read allowed files. A sandbox is a technical boundary around the tools it governs; a prompt such as “never touch the corporate network” is an instruction the model can misinterpret. OpenAI documents sandboxing and approvals as separate controls. Source: sandboxing.
Use a separate, non-administrator account in the VM. Provide only the repository and tools required for the task. Leave out corporate VPN clients, mounted file shares, SSH agent forwarding, cloud CLI sessions, browser sign-ins, Kubernetes contexts, deployment keys and container-engine sockets. An isolated environment with no corporate credentials offers a much smaller blast radius.
Disable device remote control and application snapshots where supported, and do not configure SSH remote hosts or local computer access for this baseline. Keep source import and result export deliberate: a trusted process supplies an approved snapshot, a person reviews the resulting diff, and normal CI and change controls handle integration. Don’t give this review VM a production deployment role.
2. Block internet and corporate network access
A cloud-backed Codex session needs a connection to its model service. Blocking every external connection prevents that workflow. The practical target is no network from agent commands, plus narrowly approved client service connectivity. Local execution can still send relevant task content to OpenAI. Source: local execution and data handling.
For a hard corporate boundary, place the VM in a dedicated subnet or security zone with firewall policy enforced by infrastructure the VM account cannot change. Our recommended rule set is:
| Traffic | Recommended policy |
|---|---|
| Agent shell commands and subprocesses | Network disabled in Codex; remove shell tools entirely for review-only use. |
| VM → corporate services | Deny internal prefixes, VPN and peered routes, management interfaces, internal public addresses and private DNS destinations. |
| VM → general internet | Deny by default. Prevent direct egress around the managed gateway, including alternate DNS, IPv6 and UDP paths. |
| Codex client → model/authentication service | Allow only the current endpoints required by the approved authentication and client configuration, through a managed gateway. |
| Downloads, package installation and updates | Use a separate trusted image-building process and approved mirrors; provide dependencies before starting the agent. |
| Inbound traffic and host integration | Restrict to the approved administration path; disable unnecessary shared folders, host bridges and local privileged sockets. |
Blocking RFC1918 alone is insufficient: organisations can use public address space internally, IPv6, cloud management endpoints and public SaaS administration interfaces. Maintain the organisation’s actual destination inventory and apply the same boundary to DNS resolution and resolved addresses.
A proxy environment variable only tells cooperative software where to connect. Enforce egress at the firewall or gateway, and ensure the agent cannot modify those controls. If the client and commands share a VM, retain both the command sandbox and the external gateway policy: a whole-VM endpoint allowlist alone does not stop commands using an allowed endpoint.
Web search, apps, MCP servers, browsers and native application tools have separate access paths. Turn them off for this baseline and remove existing connections. For an approved cloud workflow, configure and test cloud permissions independently; local settings do not establish its boundary. Source: cloud capability boundaries.
3. Apply the Codex configuration
The following is a proposed strict local review baseline. Permission profiles are beta. Managed profile allowlists require Codex 0.138.0 or later, but that minimum does not establish support for every newer key below. Pin an approved release and validate the complete policy on each operating system before deployment. Source: permission profiles; configuration reference.
Deploy the administrator-owned requirements.toml through device management or a supported managed-policy channel. The documented local locations are /etc/codex/requirements.toml on Unix systems and %ProgramData%\OpenAI\Codex\requirements.toml on Windows. Users must not be able to edit the policy or substitute an unmanaged client. Check the effective merged policy, including any higher-priority workspace or MDM settings. Source: managed configuration.
Administrator policy: requirements.toml
Download the proposed requirements.toml
# Administrator-managed local Codex policy.
# Validate every key on your approved client version and operating system.
allowed_approval_policies = ["never"]
allowed_web_search_modes = []
default_permissions = "corp_review"
allow_appshots = false
allow_remote_control = false
[allowed_permission_profiles]
corp_review = true
[permissions.corp_review]
description = "Review the approved workspace without command networking."
extends = ":read-only"
[permissions.corp_review.filesystem]
":root" = "deny"
":minimal" = "read"
[permissions.corp_review.filesystem.":workspace_roots"]
"." = "read"
[permissions.corp_review.network]
enabled = false
[features]
shell_tool = false
apps = false
plugins = false
browser_use = false
browser_use_external = false
browser_use_full_cdp_access = false
in_app_browser = false
computer_use = false
hooks = false
# An explicitly empty approved list disables local MCP servers.
[mcp_servers]
# Feedback submission is separate from the account's training preference.
[feedback]
enabled = false
This allowlist selects only the corporate review profile. The profile makes the approved workspace readable and disables command networking; supported capability switches remove shell, browser and integration paths. approval_policy = "never" prevents approval requests—it does not grant extra permissions. Keep full access unavailable. The effective behaviour must be tested on the selected client. Source: approvals and sandbox boundaries.
User defaults: config.toml
Pair the policy with these defaults in the user’s ~/.codex/config.toml. The profile definition above must already be installed. Download the matching config.toml.
# User defaults paired with the administrator-managed policy.
# This file alone is not an enforced corporate boundary.
approval_policy = "never"
web_search = "disabled"
default_permissions = "corp_review"
Migration: remove old sandbox_mode, [sandbox_workspace_write] and --sandbox selections when adopting permission profiles. Keep the two configuration systems separate. Filesystem rules govern the documented local tool scope; they are not a promise that every plugin or application shares the same restrictions. Source: profile migration and scope.
Older clients using legacy sandbox settings
Use these as a compatibility example only while upgrading. They restrict sandbox and approval choices; they do not replace the VM, firewall, integration restrictions or a supported no-command policy.
Legacy user config.toml:
# Legacy configuration only; do not combine with permission profiles.
sandbox_mode = "read-only"
approval_policy = "never"
web_search = "disabled"
Legacy administrator requirements.toml:
allowed_sandbox_modes = ["read-only"]
allowed_approval_policies = ["never"]
allowed_web_search_modes = []
Read-only still allows sandboxed commands. For any separately authorised legacy workspace-write workflow, explicitly set [sandbox_workspace_write] with network_access = false and enforce the surrounding controls. Source: legacy sandbox settings.
4. Allow builds only inside the isolated environment
Some teams need compilation and tests. Introduce that as a separately approved policy: enable command tools, use an administrator-defined workspace-write profile with command networking still disabled, and permit only the intended writable workspace and required temporary paths. Keep the VM detached from corporate routes and credentials.
Builds and test suites execute repository code, including dependency hooks. Treat the repository as untrusted input. Preinstall vetted dependencies, inspect build scripts and use disposable VM snapshots. Review files before anyone executes them on a connected machine.
If the business requirement is no generated code execution anywhere, keep command tools disabled and use a workflow limited to reviewing supplied text. A sandbox cannot make code execution disappear; it limits where execution can act.
On Windows, validate the selected sandbox implementation and policy coverage rather than assuming every fallback has identical isolation. Keep VM segmentation in place regardless of the client’s operating system. Source: platform enforcement limits.
5. Disable use of data for model training
Choose the account and data policy before supplying work material.
Personal ChatGPT accounts
- Open ChatGPT on the web or mobile and go to Settings → Data controls.
- Disable the option allowing your content to improve models. If your interface shows “Improve the model for everyone”, set it to Off.
- Review any separate Codex model-improvement or data-sharing controls offered to your account and leave optional sharing disabled.
- Confirm the effective setting before supplying company information. UI wording and available controls vary by account and client; a personal opt-out alone is insufficient for corporate approval.
The official browser documentation identifies the Settings → Data controls location. The exact personal-account labels and any separate Codex opt-in should be checked in your current interface. Source: ChatGPT data controls location.
ChatGPT Business, Enterprise and Edu
Covered business workspace data is not used to train OpenAI models by default. For corporate deployment, prefer the organisation-managed workspace, confirm its applicable agreement and settings, and prevent sign-in to an unapproved personal workspace. Separate account/workspace access controls from execution permissions. Source: business data protections.
OpenAI API
API data is not used to train or improve OpenAI models unless you explicitly opt in. Keep optional organisation/project data sharing disabled. Retention remains a separate decision: default abuse-monitoring logs may be retained for up to 30 days, and some features persist application state. Zero Data Retention and Modified Abuse Monitoring require eligibility and have feature-specific limits. Source: API data controls.
The service still processes the content needed to answer. Training preferences do not create an air gap, redact secrets, configure all retention periods or govern third-party services. Classify and minimise input, and review the actual product, endpoint and connected-service policies.
The sample’s [feedback] enabled = false disables supported feedback submission. It is not an account-level training opt-out. Likewise, disabling analytics or local history is not a replacement for the workspace data policy. Source: feedback setting.
6. Verify the guardrails before rollout
Use a disposable, authorised test environment with synthetic data and administrator-controlled test destinations. The following is an acceptance plan; it is not a claim that these controls have been tested on your network.
| Check | Required evidence |
|---|---|
| Approved client and policy | Record client version, OS, applied requirements and effective permissions. Unknown or unsupported security keys stop the rollout. |
| Strict review tools | Shell execution, browser/computer use, web search, apps, plugins and MCP are unavailable under the intended baseline. |
| File access | Approved source is readable. Workspace modification and reading a dummy file outside permitted roots fail through each enabled file-access path. |
| Sandboxed build variant | When separately enabled, a harmless command runs locally; attempted internet and controlled internal connections fail from inside the sandbox. |
| External VM boundary | IT verifies blocked corporate routes and unapproved egress independently of Codex, including IPv6, DNS and any proxy bypass paths. Use controlled test listeners, not production scans. |
| Escalation and policy changes | Full-access selection, a network permission request and conflicting local overrides cannot expand the effective boundary. Retest after restart and policy refresh. |
| Separate cloud capabilities | Unauthorised cloud execution and local remote-access paths are unavailable under workspace/device policy. Test cloud separately if it is approved. |
| Data controls | Record the approved workspace, training/data-sharing status, retention decision and evidence of the effective account configuration. |
Monitor policy drift, client updates and unexpected egress. Retain enough operational evidence for review while limiting prompts, source code and secrets in logs. An allowed model connection can carry authorised task content, so data minimisation remains necessary even with perfect command isolation.
Begin with review-only access to a sanitised code copy in a segmented VM. Add execution or connectivity only when a concrete workflow needs it, with a reviewed policy change and repeatable acceptance checks.
Official documentation
Documentation checked on 4 November 2026. Product settings, policy schemas and platform support can change. The examples are proposed deployment baselines and require validation against the approved fleet.
- Sandboxing across ChatGPT and Codex clients
- Agent approvals and security
- Permission profiles and platform limits
- Administrator-managed configuration
- Configuration reference
- Local execution and business data protections
- Cloud security and separate capability controls
- ChatGPT browser and data-controls location
- OpenAI API data controls
Planning a corporate AI pilot?
Discuss network segmentation, identity, data handling and practical guardrails for your environment with Global SOC.
Contact Global SOCCybersecurity services