Skip to main content
9 – 17 UHR +49 8031 3508270 LUITPOLDSTR. 9, 83022 ROSENHEIM
DE / EN
Coding agent OpenAI United States Terminal, IDE, Web, Cloud

Codex

Codex is OpenAI's agentic coding harness for the terminal, IDE and cloud. Features, sandbox modes, model access and enterprise use at a glance.

Licence Apache-2.0
First release April 2025 (repository created)
Interfaces Terminal (CLI), VS Code, JetBrains, Web, Desktop app, Cloud
Platforms macOS, Linux, Windows
Instruction file AGENTS.md

The seven building blocks in Codex

How Codex implements the building blocks of an AI harness

  1. 1

    Agent loop

    Codex runs a loop of model call, tool execution and feedback: the model requests an action, Codex executes it in the sandbox and returns the result to the model's context, until the task is complete or an approval is needed. The non-interactive codex exec mode runs the same loop in a scriptable way for CI pipelines.

  2. 2

    Tools and execution environment

    Codex provides tools through a sandboxed execution environment for the shell and file system, plus MCP servers and plugins that, per the documentation, connect team tools and data without leaving the console.

  3. 3

    Context management

    Codex reads AGENTS.md files before every task and combines them hierarchically from the project root down to the current directory, with closer files overriding earlier guidance; images such as screenshots or diagrams can also be brought into context.

  4. 4

    State and memory

    Sessions are stored as rollouts and can be resumed or forked from an earlier checkpoint; for CI runs, persistence can be suppressed via a dedicated ephemeral option per the documentation.

  5. 5

    Permissions

    Permissions combine a sandbox level (read-only, workspace-write or danger-full-access) with an approval policy (such as on-request or never); risky actions like network access or edits outside the workspace trigger an approval prompt per the documentation.

  6. 6

    Verification and feedback

    Codex offers a dedicated review command (`/review`) that produces prioritised findings against commits, uncommitted changes or a base branch without changing the working tree; its review pane lets you stage, unstage or revert changes there. Per the documentation, Codex does not create checkpoints automatically before and after a task — the quickstart guide instead recommends creating your own Git checkpoints before and after a task.

  7. 7

    Orchestration

    Through subagents, defined as separate configuration files, Codex can run specialised subtasks in parallel; per the documentation, their results flow back into the main context in consolidated form to avoid context noise in the main agent.

Models and model access

Which models the harness uses and how they are obtained

Models and model access
Models OpenAI GPT models, including reasoning variants optimised for Codex
Access routes OpenAI API (ChatGPT plan or API key), Azure OpenAI, Amazon Bedrock, custom OpenAI-compatible endpoints
Free choice of model Yes
Custom endpoint / LLM gateway Yes
Custom model endpoints are set in the config.toml file under a model_providers entry with the fields base_url, env_key and wire_api, or via openai_base_url directly on the built-in OpenAI provider; per the configuration reference, wire_api currently supports only the value responses.
Features
MCP servers Sub-agents Hooks Skills Plugins / extensions Sandbox Headless / CI SDK IDE integration Resume sessions
Running it with herdr
Supported by herdr Yes
State detection Screen manifest
Integration Session
herdr detects Codex sessions via its screen-manifest mechanism and, per herdr's documentation, provides native session identity for restore, though its hooks do not cover the whole lifecycle.
More about herdr →

Enterprise use

Data processing, controls and pricing model according to the vendor

Data processing and training

For ChatGPT Business, Enterprise and Edu workspaces, OpenAI states that business data is not used to train its models by default; data is documented as encrypted in transit and at rest.

EU relevance and data residency

Per the documentation, data residency applies only to eligible content and workloads; connected apps, external model providers and individual processing steps can follow separate location rules and should be checked in advance.

Admin controls

Workspace owners enable and restrict local and cloud Codex use separately through Enterprise settings, including role-based access control and dedicated security and analytics ownership.

Telemetry and traceability

Compliance logs for supported prompts and responses are documented as available for a limited period through a dedicated compliance logs platform; not every shell action or tool invocation is guaranteed to appear in it.

Pricing model

Codex is included in ChatGPT plans (Plus, Pro, Business, Edu, Enterprise) or billed on a usage basis via a separate API key – see the vendor for current terms.

Strengths
  • One tool spanning terminal, IDE (VS Code, JetBrains) and cloud tasks with shared configuration
  • Open-source CLI under Apache-2.0 with documented sandbox behaviour per operating system
  • Freely configurable model endpoints, documented for example for Azure OpenAI and Amazon Bedrock
  • Extensible via MCP servers, skills, plugins and parallel subagents
  • Non-interactive codex exec mode with structured JSON output for CI pipelines
  • Review pane with granular Git actions (stage, unstage, revert) before committing
Limitations
  • Per the documentation, Codex does not create checkpoints automatically before and after a task; the guide instead recommends creating your own Git checkpoints so changes can be reverted if needed
  • Custom model endpoints must speak the OpenAI Responses API per the configuration reference; endpoints that only expose Chat Completions need a translating proxy
  • The Amazon Bedrock connection currently excludes, per the documentation, Fast Mode, cloud tasks, and image, voice and web search features, and is unavailable in AWS GovCloud regions

Use cases

Typical tasks for this harness

Bug fixing and running tests in your own repository
Code reviews against uncommitted changes, commits or a base branch
CI/CD automation via the non-interactive mode
Direct use inside VS Code, Cursor, Windsurf or JetBrains IDEs
Delegated cloud tasks, for example from Slack or Linear integrations
Programmable automation of your own tools via the TypeScript SDK

AI harnesses are the software wrapped around a language model that makes it capable of work. Codex is OpenAI’s agentic coding harness: a command line, an IDE extension, a web and desktop interface, and an SDK that let GPT models read files, run commands, execute tests and change code – locally, in the cloud, or embedded in ChatGPT. As of 20 September 2026.

What is Codex?

Codex CLI is an open-source project by OpenAI, maintained since April 2025 in the public openai/codex repository under the Apache-2.0 licence. It can be installed via an install script (curl -fsSL https://chatgpt.com/codex/install.sh | sh), via npm install -g @openai/codex, or via Homebrew; Windows uses a PowerShell script. After installation, Codex signs in either with a ChatGPT account (Plus, Pro, Business, Edu, Enterprise) or with an API key. Alongside the CLI, OpenAI offers an extension for VS Code and compatible editors such as Cursor and Windsurf, a native integration in JetBrains IDEs, a desktop app for macOS and Windows, and Codex Web and Codex Cloud at chatgpt.com/codex for delegated tasks that run on OpenAI-managed infrastructure.

Codex as an AI harness

Codex combines the classic building blocks of a harness in one tool: a loop of model call, sandboxed tool execution and feedback to the model; project-specific instructions via AGENTS.md files, which Codex reads hierarchically from the project root down to the working directory; permissions via a combination of sandbox level (read-only, workspace-write, danger-full-access) and approval policy (on-request, never); and subagents for parallel subtasks, whose results flow back into the main context in consolidated form. Codex is extensible through MCP servers, packaged skills (SKILL.md under .agents/skills), and plugins that connect team tools and data sources. For automation there is the non-interactive codex exec mode, which streams progress to stderr, prints the final message to stdout, and, with --json, provides a structured event stream for CI pipelines.

Models and model access

By default, Codex uses OpenAI’s GPT models, including reasoning variants optimised for coding tasks with adjustable reasoning effort. For more on the model family, see our overview of OpenAI GPT. The model_provider field in config.toml switches between the built-in OpenAI provider, Azure OpenAI and Amazon Bedrock; for Azure OpenAI, OpenAI documents a concrete [model_providers.azure] example with base_url, env_key and an API version, while Amazon Bedrock only requires model_provider = "amazon-bedrock" together with AWS credentials. Beyond that, arbitrary custom endpoints can be defined under [model_providers.<id>] with base_url, env_key and wire_api, or via openai_base_url directly on the built-in provider. This lets Codex run through a central, OpenAI-compatible proxy such as the AI Gateway, provided that endpoint speaks the OpenAI Responses API – per the configuration reference, responses is currently the only supported value for wire_api.

Enterprise use: data protection and governance

For ChatGPT Business, Enterprise and Edu workspaces, OpenAI documents that business data is not used for training by default and that data is encrypted in transit and at rest. Per the documentation, data residency applies only to selected, supported content and workloads; connected apps and external model providers can follow separate location rules. Cloud tasks run on OpenAI-managed infrastructure without access to local files, desktop apps or browser sessions. Workspace owners control local and cloud use separately through Enterprise settings with role-based access control; a compliance logs platform retains prompts and responses for supported workflows for a limited period, though per the documentation it does not necessarily capture every shell action or tool invocation. Regardless of provider, source code and prompts go to the chosen model provider (OpenAI, Azure or Amazon Bedrock) and should be reflected in your record of processing activities beforehand.

Orchestrating Codex with herdr

herdr is a terminal multiplexer and runtime for coding agents. Per herdr’s documentation, herdr detects Codex sessions via a screen-manifest mechanism, reading the visible terminal state rather than relying on lifecycle hooks. In the “session” integration role, Codex thereby provides a native session identity for restore, without herdr covering the entire session lifecycle through its own hooks.

Where it fits: developer harness and enterprise harness

Codex is a harness for a clearly bounded environment: a repository, a terminal or an IDE, a developer. Business users outside development need a different harness – one connected to line-of-business systems, company knowledge and role-based permissions – and that role is filled by CompanyGPT. Both layers can run through the AI Gateway as a shared cost and governance layer, keeping budgets, provider choice and logging consistent across developer and enterprise harnesses. For other harnesses, see our AI harness overview. If you would like to assess how Codex and CompanyGPT complement each other and how to govern both through the AI Gateway, we are happy to walk through this with one of your own use cases.

From developer harness to enterprise harness

Coding harnesses are tools for developers. Business users, cost control and governance need two more layers.

CompanyGPT – the harness for business users

CompanyGPT gives any language model tools via MCP servers, integrations and n8n, company knowledge via companyRAG, roles from Entra ID or Keycloak, and audit logs – operated in your Azure environment or sovereignly on STACKIT.

Discover CompanyGPT
AI Gateway – cost and governance for every agent

The AI Gateway bundles the model access of your tools and coding agents behind an OpenAI-compatible API: authentication via Entra ID, budgets and cost centres per team, user and agent, guardrails and complete logging.

View the AI Gateway

Frequently Asked Questions

What is Codex?

Codex is OpenAI's agentic coding harness: a CLI, an IDE extension, a web and desktop interface, and an SDK that turn a GPT model into a coding agent by adding tools, a sandbox, context management and permissions. Codex runs locally, in the cloud, or embedded in ChatGPT.

Is Codex open source?

The Codex CLI is published in the public openai/codex repository under the Apache-2.0 licence. Cloud features, the desktop app and parts of the enterprise controls, however, run on OpenAI's own, non-public infrastructure.

Which models does Codex support?

By default, Codex uses OpenAI's GPT models; the documentation also covers Azure OpenAI and Amazon Bedrock as providers, plus freely configurable custom endpoints. Per the configuration reference, a custom endpoint must be compatible with the OpenAI Responses API.

Can Codex be used in a GDPR-compliant way?

OpenAI documents that, for ChatGPT Business, Enterprise and Edu workspaces, business data is not used for training by default, and that data residency applies to selected content. Whether a specific deployment meets GDPR requirements depends on the chosen model provider, the workspace contract and the data category, and should be clarified in your record of processing activities.

What is the difference between Codex CLI, Codex Cloud and the IDE extension?

The Codex CLI runs locally in the terminal, the IDE extension embeds the same functionality in VS Code, compatible editors and JetBrains IDEs, and Codex Cloud runs delegated tasks on OpenAI-managed infrastructure without taking over local files or sessions. Per the documentation, all three share configuration and MCP connections.

Does Codex work with herdr?

Yes. Per its own documentation, herdr detects Codex sessions via a screen-manifest mechanism and provides native session identity for restore, without covering the whole session lifecycle through hooks.

Introduce coding agents safely in your company

We support selection, model access in the EU, permission design and cost control.