Skip to content
Aventail™ co-founder speaks to BBC Radio Wales on AI safety and AI agents.Read the story
Aventail™
All guides

Is Codex safe for work?

14 min read

Is Codex safe for work? What OpenAI does with your code by sign-in (Plus, Business, Enterprise, API key), plus sandbox modes, cloud tasks and managed config.

It depends on how Codex is signed in. OpenAI Codex (the CLI, the IDE extension and Codex cloud tasks) takes its data terms from the account behind it: a personal ChatGPT plan, a Business or Enterprise workspace, or an API key. The sandbox and approval settings then decide what the agent can do on the machine. The short answer, as of 15 November 2026:

How Codex is signed in

Safe for company code?

Why

ChatGPT Free, Go, Plus or Pro

No

Content can train OpenAI's models unless each person turns it off. No admin, no audit trail, and nothing stops a developer from signing in this way on a work laptop unless you block it.

ChatGPT Business

Yes, for most code

No training by default, SAML SSO and MFA, admin control of retention. The Compliance API, SCIM, residency and key management are Enterprise features.

ChatGPT Enterprise or Edu

Yes

Role-based access to Codex Local and Codex Cloud, managed configuration, Compliance API records for CLI, IDE and cloud use, retention and residency settings. Cloud access is off until an admin enables it.

API key

Yes, with approval

Follows your API organisation's settings: no training by default, logs for up to 30 days, zero data retention on approval. No cloud tasks. Suits CI.

A local or self-hosted model

For model requests, yes

Codex can use Ollama, LM Studio or any Responses API endpoint, so prompts and code stay where that endpoint runs. The agent still acts on your files and shell.

Everything below comes from OpenAI's documentation and help centre and from named security research, read on 15 November 2026 and listed at the end. The plan facts match our ChatGPT guide and were checked again for this page.

What OpenAI does with your code, by sign-in

OpenAI's authentication page states it plainly: "Your sign-in method also determines which admin controls and data-handling policies apply."

Free, Go, Plus, Pro

Business

Enterprise and Edu

API key

Trains on your content by default

Yes. "Conversations may be used to improve models unless you turn off training"

No

No

No. API organisation owners can opt in to share data

How to turn training off

Settings › Data controls › Improve the model for everyone, or the Privacy Portal. Either covers "ChatGPT conversations and Codex tasks". A separate Include environments setting in Codex settings governs training on full environments

Not needed

Not needed

Not needed

Retention on OpenAI's side

Follows the ChatGPT account

Admins control retention. Deleted conversations are removed within 30 days

"ChatGPT Enterprise retention and residency settings" apply

Inputs and outputs for up to 30 days. Zero data retention for eligible endpoints on request

Codex cloud tasks

Plus and Pro, where eligible. Not Free or Go

Yes

Yes, once an admin turns cloud access on

No. "Codex cloud requires signing in with ChatGPT"

Admin controls

None

Workspace roles, SAML SSO, MFA, plugin controls

RBAC for Codex Local and Codex Cloud, SCIM, model defaults, Agent security policies, Enterprise Key Management

API organisation and project settings

Audit trail

None

Admins can view and export member conversations in ChatGPT. OpenAI lists Compliance API audit logs under Enterprise

Compliance API: "Codex usage, including local clients such as the CLI and IDE extension as well as web or cloud-delegated usage"

Opt-in OpenTelemetry export from the client

Certifications

Not stated per product

SOC 2 Type 2

SOC 2 Type 2

SOC 2 Type 2

Price

$0, $8, $20, and $100 to $500 a month

$20 per user a month billed annually, $25 monthly, two users minimum

Contact sales

Standard API rates

Encryption is the same wherever OpenAI states it: AES-256 at rest and TLS 1.2 or higher in transit. OpenAI's help pages name Free, Plus and Pro when they describe training; Go is also a personal plan and we treat it the same way.

Two points apply to every column. "Local" describes where commands run. The prompts, the files Codex reads and the command output are still sent to OpenAI's models unless you point Codex at another provider. And Codex keeps data on the developer's machine: session transcripts are saved under ~/.codex by default, and login details are cached in ~/.codex/auth.json in plain text or in the operating system's credential store.

Sandbox and approval modes

Local Codex has two layers. The sandbox mode sets what it can do technically. The approval policy sets when it must stop and ask.

Sandbox mode

What the agent can do

read-only

Read files. No edits and no commands without approval

workspace-write

Read files, edit inside the workspace and run routine commands there. Network access is off unless you enable it. This is the default for version-controlled folders

danger-full-access

No filesystem or network boundary

The approval policies are on-request, where Codex asks when it needs to leave the sandbox, and never. OpenAI retired the untrusted policy, and a config file that still sets it can stop the client from starting. Approval requests go to the user by default. approvals_reviewer = "auto_review" sends eligible requests to a reviewer agent first.

The sandbox is enforced by the operating system: Seatbelt on macOS, bwrap with seccomp on Linux, and a native sandbox on Windows. Inside a writable workspace, .git, .codex, .agents and .aws stay read-only.

Three things weaken it:

  • Full access. --sandbox danger-full-access with --ask-for-approval never, or the --dangerously-bypass-approvals-and-sandbox flag, removes both layers. OpenAI's own wording is "Use caution".

  • Containers. OpenAI warns that on Linux inside Docker "the sandbox may not work" if the host blocks the features it needs.

  • Bugs. Two sandbox escapes were fixed in August 2026. They are covered below.

Network access

By default the agent runs with network access off. In workspace-write you turn it on with:

[sandbox_workspace_write]
network_access = true

Once it is on, commands have unrestricted outbound access unless you also enable the network_proxy feature and list allowed domains. In that mode nothing is reachable until you add an allow rule, and deny always wins.

The proxy has a stated limit. It filters commands the agent runs. It "does not filter web search, app or connector tool calls, MCP server connections, browser or Computer Use activity, Codex cloud tasks, or the client's model and authentication requests". Web search defaults to a cached index kept by OpenAI, which lowers exposure to injected instructions on live pages. With full access it defaults to live results.

What Codex cloud tasks store

Cloud tasks run on OpenAI-managed machines. OpenAI currently documents two generations.

Current Codex Cloud. Each task has its own VM and workspace. A task's saved VM state, which includes uncommitted changes and installed tools, "is recoverable for up to seven days after you last start a turn or resume the task". Internet access is set per environment: all public internet, or an allowlist of package managers and named domains. Credentials can be stored as network secrets: "Programs receive a placeholder; the proxy substitutes the real value for allowed destinations."

Codex Cloud (Legacy), still used for code review and the GitHub and Linear integrations. Codex checks out the repository into a container, runs your setup script with internet access, then runs the agent with internet access off by default. Secrets are available only to setup scripts and are removed before the agent phase. Container state is cached for up to 12 hours, and for Business and Enterprise "caches are shared across all users who have access to the environment".

For both, OpenAI requires MFA on email and password accounts before Codex cloud can be used. The risk it names for agent internet access is the one to plan for: "Prompt injection from untrusted web content" and "Code or secret exfiltration".

Managed configuration

Admins can constrain Codex in three ways.

Agent security in the Admin Console. Enterprise admins set requirements, which users cannot override, and defaults, which they can. OpenAI says this is available "on supported plans" and does not list them on the pages we read.

A requirements file on the device. Codex reads /etc/codex/requirements.toml on Linux and macOS and %ProgramData%\OpenAI\Codex\requirements.toml on Windows. macOS MDM can deliver the same content. The file is read on the device, before credentials load. OpenAI's examples:

allowed_approval_policies = ["on-request"]
allowed_sandbox_modes = ["read-only", "workspace-write"]

allowed_web_search_modes = ["cached"] # "disabled" remains implicitly allowed

To stop personal accounts on work machines, restrict the login method and workspace. These fields are read only from the local file or MDM, before any cloud policy loads:

allowed_login_methods = ["chatgpt"]
allowed_chatgpt_workspaces = ["00000000-0000-0000-0000-000000000000"]
cli_auth_credentials_store = "keyring"

A configuration server you host. For teams that do not sign in with ChatGPT, a [config_server] entry in the same file points Codex CLI and the desktop app at an HTTPS endpoint you run.

Running Codex against a local or self-hosted model

Codex is not tied to OpenAI's models. codex --oss runs it against a local provider, Ollama or LM Studio, chosen with --local-provider or with oss_provider = "ollama" in config.toml. Any other endpoint can be added under model_providers with its own base_url. Amazon Bedrock and Google Cloud are built-in providers.

One constraint decides what works: the endpoint must speak the Responses API. OpenAI states that current releases "don't support wire_api = "chat" or a Chat Completions-only endpoint". OpenAI does not say on the pages we read which other connections the client makes in this mode, so check on your own network before you call a machine offline. The step-by-step is in our guide to Codex with Ollama.

The red list: what Codex should never be run on

  • A repository opened under a personal ChatGPT account, if the code is not public

  • A working copy that holds .env files, private keys or production credentials

  • A shell whose environment carries cloud or database credentials the task does not need

  • Customer data in fixtures, dumps or logs

  • An untrusted repository with full access on, or with approvals set to never

The risks that stay, whatever plan you buy

Malicious repositories. In 2025 Check Point found that Codex CLI ran MCP server commands defined in a repository's own configuration as soon as a developer ran codex inside it (CVE-2025-61260, fixed in version 0.23.0 on 20 August 2025). On 12 August 2026 Accomplish AI reported two sandbox escapes. Heapjack ran commands on the host from the strictest read-only mode when a user opened someone else's repository and asked a question about it. Overpatch widened a workspace-write grant to the whole filesystem. OpenAI fixed them within eight days, in Codex Desktop build 26.818.21641 and Codex CLI 0.149.0.

Cloud task setup. TechRadar reported on 31 March 2026 that BeyondTrust Phantom Labs had found a way to inject commands through a crafted Git branch name during Codex task creation and steal GitHub OAuth tokens. OpenAI fixed it with stronger input validation and tighter token scope.

Prompt injection. An issue, a README or a web page that Codex reads can carry instructions. Network access, live web search, MCP servers and connectors each widen what a hijacked agent can reach.

Unreviewed changes. Codex writes code that compiles and is wrong. Every plan. Changes go through the same review and tests as a colleague's.

Settings to change today

Every personal account used for work (until you move people off it):

  1. Settings › Data controls › turn off "Improve the model for everyone". Check the Include environments setting in Codex settings as well.

  2. Turn on multi-factor authentication.

  3. Keep the default sandbox. Do not use full access.

  4. Update Codex CLI and the desktop app to the current release.

Business workspace:

  1. Turn on SAML SSO and enforce MFA at the identity provider.

  2. Ship a requirements.toml that allows ChatGPT login to your workspace only.

  3. Decide whether cloud tasks are allowed, and restrict each environment's internet access to named domains.

Enterprise workspace:

  1. Grant Codex Local and Codex Cloud by role. They are separate permissions.

  2. Set approval, sandbox and web search requirements in Agent security.

  3. Connect the Compliance API to your SIEM. Compliance Logs Platform records are available for 30 days.

  4. Set workspace retention and, if you need it, residency.

API key sign-in:

  1. Use it for CI and scripts. OpenAI's advice is "Don't expose Codex execution in untrusted or public environments".

  2. Leave data sharing off, and ask for zero data retention if your use case qualifies.

Our guide to shadow AI and acceptable use policies covers the policy wording.

Keep sensitive code on approved models

Managed configuration controls what Codex may do, and on Enterprise the Compliance API records what it did. Neither keeps one team's code on models you run, or stops the request when those models are unavailable.

Aventail™ Connect configures Codex to send its model requests through Aventail™ Link, an inference engine and gateway that runs on each machine, under routing rules set in Aventail Control. The Codex CLI, the editor extension and Codex in the ChatGPT desktop app share one connection: choose Codex in Link's Connected apps and select Connect. There is no endpoint or key to enter. The connection uses the Responses API. The reviewed route supports local models, other machines running Link, and OpenAI. Other cloud providers are not supported for Codex on this path. Sessions already open keep their model until they end, and Disconnect restores the settings Link changed.

A rule can permit only On device. If no allowed destination can serve the request, it fails with an error. It is not sent to a disallowed destination. Prompts and responses do not pass through the hosted Control service; it receives management, device and routing events. In practice that gives you two lanes:

  • Codex on a Business or Enterprise workspace for general code, with the settings above.

  • Codex routed by Aventail™ for repositories on the red list: a local model on the developer's machine, with a Requests view in Control that shows where each request ran.

Connect governs model requests only. File access, shell commands, MCP servers and Codex's own telemetry keep their own controls, so the sandbox settings above still apply. Routing policies need Control for Enterprise, and peer and hosted routing are in beta. The free plan covers three connected devices, including business use.

Frequently asked questions

Does OpenAI train on my Codex code?
On Free, Plus and Pro, it can unless you turn off "Improve the model for everyone". On Business, Enterprise, Edu and the API, not by default.

Does Codex send my code to OpenAI?
Yes, when it uses OpenAI's models. Running the CLI locally means commands run on your machine; the context still goes to the model. Only a local or self-hosted model keeps model requests off OpenAI's servers.

Can Codex access the internet?
Not by default. Local commands run with network access off, and legacy cloud tasks run the agent phase offline. You can turn access on, and you can limit it to named domains.

Is the Codex CLI open source?
Yes. Codex CLI, the SDK and the app server are developed in the openai/codex repository on GitHub. The IDE extension and Codex cloud are not open source.

Can I use Codex without a ChatGPT account?
Yes. Sign in with an OpenAI API key, or run codex --oss against Ollama or LM Studio. Cloud tasks need a ChatGPT sign-in.

Is full access mode safe?
No. It removes the sandbox and the approval prompts together. Use it only in a disposable environment with no credentials.

Can my employer see what I do in Codex?
In an Enterprise workspace, yes: Codex usage from the CLI, the IDE extension and cloud tasks is available to admins through the Compliance API. On a personal account, nobody at your company can.

Sources

All read on 15 November 2026.

  1. OpenAI, Codex docs, Authentication: https://learn.chatgpt.com/docs/auth

  2. OpenAI, Codex docs, Agent approvals and security: https://learn.chatgpt.com/docs/agent-approvals-security

  3. OpenAI, Codex docs, Sandbox: https://learn.chatgpt.com/docs/sandboxing

  4. OpenAI, Codex docs, Windows sandbox: https://learn.chatgpt.com/docs/windows/windows-sandbox

  5. OpenAI, Codex docs, Cloud environments: https://learn.chatgpt.com/docs/environments/cloud-environments

  6. OpenAI, Codex docs, Codex Cloud (Legacy): https://learn.chatgpt.com/docs/environments/cloud-environment

  7. OpenAI, Codex docs, Codex Cloud (Legacy) internet access: https://learn.chatgpt.com/docs/cloud/internet-access

  8. OpenAI, Codex docs, Managed configuration: https://learn.chatgpt.com/docs/enterprise/managed-configuration

  9. OpenAI, Codex docs, Self-host Codex configuration for your team: https://learn.chatgpt.com/docs/enterprise/configuration-server

  10. OpenAI, Codex docs, Advanced configuration: https://learn.chatgpt.com/docs/config-file/config-advanced

  11. OpenAI, Codex docs, Models: https://learn.chatgpt.com/docs/models

  12. OpenAI, Codex docs, Pricing: https://learn.chatgpt.com/docs/pricing

  13. OpenAI, Codex docs, Open source: https://learn.chatgpt.com/docs/open-source

  14. OpenAI, Codex docs, ChatGPT Work cloud security (retention table): https://learn.chatgpt.com/docs/enterprise/chatgpt-work-cloud-security

  15. OpenAI Help, Using Codex with your ChatGPT plan: https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan

  16. OpenAI Help, How your data is used to improve model performance: https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance

  17. OpenAI, Enterprise privacy (updated 8 January 2026): https://openai.com/enterprise-privacy/

  18. Check Point Research, CVE-2025-61260, Codex CLI command injection (1 December 2025): https://research.checkpoint.com/2025/openai-codex-cli-command-injection-vulnerability/

  19. TechRadar, BeyondTrust finds command injection flaw in OpenAI Codex (31 March 2026): https://www.techradar.com/pro/security/not-just-development-tools-security-experts-discover-critical-flaw-in-openais-codex-which-could-compromise-entire-enterprise-organizations

  20. BleepingComputer, Researchers escape OpenAI Codex sandbox to run commands on host (20 September 2026): https://www.bleepingcomputer.com/news/security/researchers-escape-openai-codex-sandbox-to-run-commands-on-host/

  21. Cloud Security Alliance, Research note on the Codex sandbox escapes (22 September 2026): https://labs.cloudsecurityalliance.org/research/csa-research-note-openai-codex-sandbox-escapes-20260922-csa/

  22. Aventail™, Connect overview: https://docs.aventail.co.uk/docs/connect/overview

  23. Aventail™, Routing: https://docs.aventail.co.uk/docs/fleet/routing

  24. Aventail™, Pricing: https://aventail.co.uk/#pricing

We use optional cookies and tracking to identify visiting companies, load our contact form, measure Google Ads download clicks and understand page use with PostHog on our homepage, Connect and How it works pages, Ollama and LM Studio comparison guides and campaign pages. Cookie policy