class LittleGhost::Harnesses::Codex

Runs Codex with codex exec --json.

In :isolated mode Codex’s own command sandbox is disabled (--sandbox danger-full-access) because it cannot nest inside an isolating Sandbox; the LittleGhost Sandbox that runs the harness is the boundary, and OPENAI_API_KEY is the placeholder. In :native_guards mode Codex runs commands in its own sandbox (--sandbox workspace-write) without network access, and authenticates from the inherited environment, such as OPENAI_API_KEY or CODEX_API_KEY.

Approval prompts are disabled in both modes, so a command that needs more access than Codex’s sandbox allows fails instead of asking. The update check is off, MCP servers are replaced by the request’s mcp_servers, notification commands are cleared on the command line, and configuration lives under home. Other settings in a persistent home’s config.toml still apply.

defaults accepts:

:base_url

An OpenAI-compatible Responses API base URL, for example a Network::Facade address ending in /v1. The harness registers it as a model provider on the command line.

:api_key

Placeholder sent as OPENAI_API_KEY. A gateway replaces it.

:model

Model used when the request does not name one.

:effort

Reasoning effort used when the request does not name one.

Codex reports token usage but not cost, so budget_usd cannot stop it. One exec usually completes a single turn that contains every command and edit, so max_turns does not bound its work either; rely on timeout.