Codex Security

Codex Security is an open-source execution harness and sandboxing framework developed by OpenAI. It is designed to provide secure, isolated execution environments specifically for running autonomous coding agents and untrusted model-generated code. In practice, Codex Security operates as an infrastructure layer combining container configurations with system-level security profiles and a TypeScript SDK (@openai/codex-security). Developers integrate the harness into agent workflows to constrain file system access, network interaction, and process execution when agents test, build, or iterate on code. What distinguishes Codex Security from standard CLI coding agents is its focus on isolation and containment. Rather than executing shell commands directly on the host machine, it provides Docker Compose configurations with AppArmor enforcement to prevent unauthorized privilege escalation, host contamination, or destructive agent behavior. Codex Security is distributed as open-source software under the Apache-2.0 license, making it available for local development setups, custom agent platforms, and CI/CD pipelines.

Tags: cli, code assistant, coding agent, developer tools, OpenSource

Visit Codex Security

Key features

  • Containerized execution sandboxing — Isolates agent execution inside Docker environments to prevent unintended host modifications. - AppArmor security enforcement — Includes dedicated Linux security profiles (compose.apparmor.yaml) to restrict agent process capabilities. - TypeScript SDK — Provides an programmatic interface (@openai/codex-security) for integrating security sandboxes into Node.js and TypeScript agent harnesses. - Docker Compose orchestration — Ships with declarative compose manifests (compose.yaml) for standardized setup across development and automated environments. - Permissive open-source licensing — Released under the Apache-2.0 license for integration into commercial and private agent platforms.

Use cases

Use Case: Sandboxed Agent Code Execution Developers running autonomous agent loops use Codex Security to run model-generated test suites and build commands inside AppArmor-constrained containers, mitigating the risk of executing arbitrary or unverified code on host environments.

Use Case: Agent Harness Development Engineers building custom AI coding tools incorporate the TypeScript SDK to programmatically spawn, monitor, and tear down secure runner environments for code generation pipelines.

Use Case: Automated CI/CD Evaluation DevOps teams deploy the Docker Compose configurations in CI runners to safely evaluate pull requests and agent-authored patches within reproducible, isolated boundaries.

Who it is for

Codex Security is intended for AI platform engineers, security teams, and developers building autonomous agent harnesses that execute model-generated code. It is not designed as a turnkey interactive CLI coding assistant for end-user developers.

Install guide

Installation Install the TypeScript SDK via npm: bash npm install @openai/codex-security Alternatively, clone the repository to use the Docker Compose setups directly: bash git clone https://github.com/openai/codex-security.git cd codex-security

First Run Ensure Docker Engine and Docker Compose are installed. Start the base sandbox container: bash docker compose -f compose.yaml up -d On Linux systems supporting AppArmor profiles, launch the hardened container: bash docker compose -f compose.apparmor.yaml up -d

Example Session Programmatically run commands within the sandboxed environment using the TypeScript SDK: typescript import { createSandbox } from "@openai/codex-security"; const sandbox = await createSandbox({ timeoutMs: 30000, }); const result = await sandbox.exec(["npm", "test"]); console.log(`Exit code: ${result.exitCode}`); console.log(result.stdout); await sandbox.destroy();

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • Plandex — Plandex is an open-source terminal-based AI coding agent designed to handle complex, multi-file engineering tasks in large codebases. Created by…
  • Continue — Continue is an open-source AI code assistant and agent framework originally developed by the Continue team (continuedev) and recently acquired…
  • Cline — Cline is an open-source autonomous coding agent runtime maintained by Cline Bot Inc. and an active open-source community. Available as…
  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • Vibe Kanban — Vibe Kanban, originally developed by Bloop AI, is an open-source orchestration harness and visual task board designed to manage and…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories