OpenAI Codex in the Enterprise: Introducing a Coding Agent
Codex is OpenAI's coding agent. It goes well beyond autocomplete: it takes a task, reads the codebase, plans a change, edits files, runs tests and hands back a diff or pull request. For an IT leader, the interesting question is not whether it works but how to introduce it under control. Who gets access, what may the agent do on a developer's machine, and where does the source code go? This overview answers those questions as of November 2026.
What is OpenAI Codex, and what do teams use it for?
OpenAI Codex is a software engineering agent available in several places: a command-line tool, an IDE extension, desktop and web apps, and a cloud service that works through tasks in a remote environment. Teams use it to fix bugs, refactor, write tests and documentation, and pre-review pull requests.
The Codex documentation lists CLI, desktop app, mobile, web, IDE extension and cloud as available surfaces. In day-to-day engineering work, the common jobs look like this:
- Tracking down bugs: paste a stack trace, let Codex find the cause in the repository, propose a fix and run the affected tests.
- Repetitive changes: replacing a deprecated library call across dozens of files, migrating configuration formats, adding type hints.
- Tests and docs: writing missing unit tests for a module, bringing the README and comments back in line with the code.
- Review groundwork: catching obvious defects in a pull request before a colleague spends time on it.
Set expectations early. Codex works on your code with your tooling. Results depend heavily on whether the repository builds cleanly, whether tests exist, and whether team conventions are written down anywhere.
How does Codex work? The building blocks
Think of Codex as three layers: the model hosted by OpenAI, an agent runtime (local or cloud) that reads files and executes commands, and a control layer made of sandbox modes, approval rules and AGENTS.md files. The control layer is where IT leadership has real influence.
Local agent. The Codex CLI runs in a developer's terminal. According to the GitHub repository, you install it with npm install -g @openai/codex or brew install --cask codex, and the code is published under the Apache-2.0 licence. The IDE extension brings the same agent to VS Code, Cursor and Windsurf, while Xcode and JetBrains IDEs have their own integrations.
Cloud agent. With Codex cloud, a task runs in an OpenAI-hosted environment that has a copy of the repository. Developers hand off the task and later receive a diff or pull request. This frees up laptops, but it also means source code is processed outside your own infrastructure.
Sandbox and approvals. The approvals and security page describes three sandbox modes: read-only, workspace-write and danger-full-access. A separate approval_policy setting decides when the agent has to ask before acting. Locally, network access is off by default.
AGENTS.md. Per the documentation, Codex reads AGENTS.md files before doing any work: a global one in the Codex home directory (~/.codex) and project files from the Git root down to the current folder. They hold build commands, test commands, coding conventions and explicit don'ts. The default size limit is 32 KiB.
# Start Codex inside a project (sign in with the workspace ChatGPT account)
cd ~/projects/order-service
codex
Which ways of using Codex exist?
In practice there are four usage patterns: locally in the terminal, inside the IDE, as cloud tasks, and as a reviewer on pull requests. They differ mainly in where the code is processed and how closely a developer supervises each step. Most organisations begin locally and add cloud tasks and automated review later.
Local, in CLI and IDE. The agent works in the checked-out repository, sees what the developer sees and runs commands inside the sandbox. Every step is visible and approvals happen in the conversation. This suits the first months and repositories with sensitive configuration.
Cloud tasks. Several tasks can run in parallel without tying up a laptop. Internet access for the cloud environment is configurable, per the cloud environments documentation: full public access, package manager domains only, or a list of additional allowed domains. The admin setup guide notes that Codex cloud is off by default for Enterprise workspaces.
Pull request review on GitHub. Commenting @codex review on a pull request starts a review, according to the GitHub integration docs, and automatic reviews can be enabled in settings. In GitHub, Codex flags only P0 and P1 issues. Team-specific review rules go into a ## Code Review Rules section in the nearest AGENTS.md.
Automation. For CI pipelines OpenAI offers a non-interactive mode, a GitHub Action and an SDK. These typically use an API key and are billed at API rates.
Separate guides will cover team setup (CLI, cloud environments, repository access) and a head-to-head comparison with Anthropic's agent. If you are weighing the alternative now, see Claude Code in the enterprise. What changes with Codex instead of Claude Code is mostly administration: access, permissions and cloud execution all sit in the ChatGPT workspace, managed alongside ChatGPT itself. For running several coding agents in one team, read agentic software development in teams.
Local or cloud: how should IT leadership decide?
The choice comes down to three questions: may source code be processed in an external environment, how many tasks should run in parallel, and can the repository be built without internal services? Local use is the cautious start; cloud tasks suit teams with stable builds and clear data approval.
Local use keeps the agent limited to what already sits on the developer's machine, and every approval happens in the conversation. Cloud tasks add parallelism, but they need an environment where dependencies install and tests run. Repositories that depend on private package registries, VPN access or local databases often struggle there until those dependencies are reproduced properly.
A workable rule is to sort repositories into three groups (cloud allowed, local only, excluded) and document that list next to the admin settings, so enabling a new repository becomes a deliberate decision rather than a side effect.
A lean AGENTS.md for the pilot repository might look like this:
# AGENTS.md
## Build and tests
- Install: `npm ci`
- Tests: `npm test` must pass before a change counts as done
## Rules
- Never run database migrations
- Ask before adding new dependencies
- Do not read or modify files under `config/secrets/`
## Code Review Rules
- Flag missing error handling around external calls as P1
What does an organisation need before rolling it out?
Three prerequisites matter: a ChatGPT plan with a managed workspace, agreed rules on how source code and data may be processed, and repositories an agent can actually build and test. Without the third, Codex still produces changes but cannot verify them, and the checking work lands back on people.
Access and licensing. According to the plans page, Codex is included in the ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise plans. For organisations, Business and Enterprise are the relevant tiers because admins can manage them centrally. Developers choose "Sign in with ChatGPT" in the CLI, so workspace policies apply rather than personal accounts.
Admin controls. The admin setup guide separates enabling local use from enabling cloud use. There is a permission for managing workspace environments, a Compliance API for audit and investigation records, and centrally distributed requirements via a requirements.toml file. The managed configuration page shows how these requirements can restrict the allowed sandbox modes and approval policies.
Data, privacy and works councils. Agree with your data protection officer which repositories an external service may process, whether personal data sits in test fixtures, and how logs are retained. Where employee representatives such as a works council exist, involve them early. The admin guide also points out that some local access options do not provide strict zero data retention. This is orientation, not legal advice; OpenAI's contract terms and your own review are what count.
Technical baseline. A build that runs with one command, tests that start locally, and an AGENTS.md that lists both. Without these, the agent is guessing.
How do you roll Codex out step by step?
A five-step rollout works well: set the frame, equip a pilot team, fix the configuration centrally, adapt the review process, then expand. Each step has a clear outcome you can judge before moving on. That keeps risk low and shows which kinds of tasks actually work in your codebase.
- Set the frame. Which repositories are in scope, and which are excluded (for example those containing customer data or key material)? Is cloud execution allowed, or local only for now?
- Equip a pilot team. Three to eight engineers with workspace seats and one repository with decent test coverage. Enable local use, leave cloud off.
- Fix the configuration. Default to
workspace-writewith on-request approvals and network off. Add one AGENTS.md per repository with build and test commands, style rules and explicit prohibitions such as "never run database migrations" or "ask before adding dependencies". - Adapt review. Every agent contribution goes through normal pull request review. Optionally add
@codex reviewas a first pass, never as a replacement. - Evaluate and expand. After four to six weeks, look at which task types were merged without rework and which needed heavy correction. Then enable cloud tasks for suitable repositories and more teams.
In our own operations, the AGENTS.md file has turned out to be the single biggest lever: a maintained file with the test command and clear don'ts prevents more correction loops than any choice of model.
# ~/.codex/config.toml - cautious default for a pilot
sandbox_mode = "workspace-write"
approval_policy = "on-request"
[sandbox_workspace_write]
network_access = false
What are the limits and risks?
The biggest risks are mundane: permissions set too wide, changes merged without checking, and source code reaching an external service without anyone noticing. On top of that, the agent only knows your business domain to the extent it is captured in code and in AGENTS.md.
- Privilege creep. The
danger-full-accessmode and the command-line flag that bypasses both sandbox and approvals remove the safety layer. Use managed configuration to disallow them outside isolated environments. - Prompt injection. When the agent reads web pages, tickets or third-party packages, hidden text can carry instructions. Keeping network access off locally and allowing only required domains in the cloud reduces the exposure.
- Plausible but wrong changes. A diff that compiles is not necessarily correct. Without tests nobody checks the business logic, so review stays mandatory.
- Secrets.
.envfiles, certificates and credentials belong neither in the repository nor in cloud environments an agent can read. - Vendor dependency. Models, plans and surfaces change quickly; OpenAI announced new models for Codex as recently as November 2026, per its documentation overview. Keep build commands, test commands and rules in the repository rather than in one tool's settings, so switching agents stays possible.
- Usage limits and cost. Usage is tied to plan allowances or API pricing. Check the current plans page before opening cloud tasks to many teams.
Codex is a poor fit when repositories do not build, when confidentiality rules forbid any external processing of source code, or when the team has no review culture. Fix those foundations first.
How do I get started?
Start small and observable: one repository, one pilot team, local use with a cautious sandbox and a well-maintained AGENTS.md. After a few weeks of real pull requests, decide whether cloud tasks and automatic review should follow. The frame the agent works in matters more than the tool itself.
A practical first week:
- The workspace admin checks how local and cloud use are enabled and switches on local use only.
- One engineer installs the CLI, signs in with the workspace account and writes the first AGENTS.md for the pilot repository.
- The team picks ten typical backlog items (bug fixes, missing tests, small refactors) and lets Codex work on them.
- Every change goes through normal review, and the team records what was merged without rework.
If you want to embed coding agents in a wider AI strategy, with rules, roles and training across several teams, the page on a fractional Head of AI explains how part-time AI leadership can support that.
Frequently asked questions
Do developers need an API key to use Codex?
No. The standard route is signing in with the workspace's ChatGPT account. OpenAI positions API keys mainly for automation in shared environments such as CI pipelines, billed at API rates.
Which sandbox mode should a pilot team start with?
Most teams start with workspace-write plus on-request approvals and network access off. That lets the agent edit the checked-out repository while anything beyond it needs explicit approval.
Can Codex review pull requests automatically?
Yes. Commenting @codex review on a GitHub pull request triggers a review, and automatic reviews can be switched on in the code review settings. Codex only reports P0 and P1 issues there, so human review still covers design and domain logic.
Is the Codex CLI open source?
The openai/codex repository on GitHub is licensed under Apache-2.0. The models it calls still run on OpenAI's infrastructure.
Sources
- OpenAI: Codex documentation overview learn.chatgpt.com
- OpenAI: Codex CLI learn.chatgpt.com
- OpenAI: Codex IDE extension learn.chatgpt.com
- OpenAI: Codex cloud learn.chatgpt.com
- OpenAI: Codex plans and access learn.chatgpt.com
- OpenAI: Codex enterprise admin setup learn.chatgpt.com
- OpenAI: Managed configuration (requirements.toml) learn.chatgpt.com
- OpenAI: Agent approvals and security learn.chatgpt.com
- OpenAI: Cloud environments learn.chatgpt.com
- OpenAI: AGENTS.md learn.chatgpt.com
- OpenAI: Codex and GitHub code review learn.chatgpt.com
- GitHub: openai/codex github.com