codex

A connection between OpenAI Codex, a command-line coding assistant, and agentkernel, a tool that runs code in isolated sandboxes.

In plain words
What is it for?
Use it to give Codex sandbox controls, run commands in temporary or persistent sandboxes, or run Codex itself inside an isolated sandbox.
Why use it?
It lets Codex run commands away from the main computer, reducing the risk of generated or untrusted code affecting the host system.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/thrashr888/agentkernel/codex
Clone the repo
git clone --depth 1 https://github.com/thrashr888/agentkernel
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00651
Opus 5 $0.00000 $0.00326
Sonnet 5 $0.00000 $0.00130
Haiku 4.5 $0.00000 $0.00065

Measured yesterday against content hash 3eb88b6cd27b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/codex.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenAI Codex

Use OpenAI's Codex CLI with agentkernel for isolated code execution.

Integration Levels

Level How It Works Setup
MCP Tools Codex calls agentkernel MCP tools for sandbox control agentkernel plugin install codex
Full Isolation Run Codex itself inside an agentkernel sandbox agentkernel sandbox create + agentkernel attach

Codex has its own native sandbox using OS-level primitives (Seatbelt on macOS, Landlock + seccomp on Linux). That sandbox cannot be replaced with a custom runtime. The MCP plugin gives Codex access to agentkernel sandboxes as tools it can call.

Codex runs locally, code execution is sandboxed via MCP:

# Install the MCP config into your project
agentkernel plugin install codex

# This adds the agentkernel MCP server to .mcp.json
# Codex will have access to: run_command, create_sandbox, exec_in_sandbox, list_sandboxes, remove_sandbox

For global installation:

agentkernel plugin install codex --global

Sandbox Mode

Run Codex itself inside an isolated sandbox:

# Create sandbox with Codex pre-installed
agentkernel sandbox create codex-dev --config examples/agents/codex/agentkernel.toml

# Start the sandbox
agentkernel sandbox start codex-dev

# Run Codex with your API key
agentkernel attach codex-dev -e OPENAI_API_KEY=$OPENAI_API_KEY

# Inside the sandbox:
codex

API Key

Codex requires an OpenAI API key. Get one from platform.openai.com.

# Interactive session
agentkernel attach codex-dev -e OPENAI_API_KEY=$OPENAI_API_KEY

# One-off command
agentkernel exec codex-dev -e OPENAI_API_KEY=$OPENAI_API_KEY -- \
  codex "Write a hello world function"

Configuration

The example config at examples/agents/codex/agentkernel.toml:

[sandbox]
name = "codex-sandbox"

[build]
dockerfile = "Dockerfile"

[agent]
preferred = "codex"
compatibility_mode = "codex"

[resources]
vcpus = 2
memory_mb = 1024

[security]
profile = "moderate"
network = true      # Codex needs network for API calls
mount_cwd = true    # Mount project directory

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 100 lines · 0 tokens per session scan A 3eb88b6cd27b

Subscribe to this mod's changes

codex is an agent published in the GitHub repository thrashr888/agentkernel (58 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 651 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.