Single-agent baseline that gives one Codex CLI session the complete search loop inside the task's own image: Codex edits and evaluates, while Galapagos independently scores every observed checkpoint.
For the default Docker evaluation mode, this scaffold follows the same installed-agent topology as `claude_code`: it resolves the task's own image, layers `@openai/codex` onto that image, and starts one shared container. The agent runs as the host's non-root uid with `/workspace` writable. The trusted runner, evaluator, and task data are provisioned under root-owned `/eval`, so the agent can use the scorer but cannot rewrite it. The evaluator that records the result attaches to this same container, which keeps the score Codex sees and the score Galapagos records in the same runtime.
For a task explicitly scored in local mode, Codex runs as a host subprocess instead. This passes `--dangerously-bypass-approvals-and-sandbox`, so local mode gives model-generated commands the permissions of the current user. Use it only with tasks and prompts you trust. A Docker task that itself needs the host Docker socket (for example ALE-Bench) can also reach the host daemon and is not a host-security sandbox.
The CLI boundary is Codex-specific:
- `codex exec --json` provides machine-readable JSONL events. - `general.max_iterations` is communicated as the improvement budget in `TASK.md`. - Codex has no `--max-turns`, so `proposer.codex_cli_max_steps` is a harness safety cap over completed command, file-change, MCP, web-search, plan, and agent-message items. - `turn.completed.usage` supplies input, cached-input, output, and reasoning-output token counts. - Native rollouts under `$CODEX_HOME/sessions/**/*.jsonl`, the combined CLI log, and `run_summary.json` remain in the run directory.
The six components this scaffold snaps together. Each block names its concrete implementation.
The set of candidate solutions in play — the gene pool the search evolves over.
Decides which genomes survive and reproduce — tournament, elitism, novelty, or your own policy.
Assembles the context handed to the model — parents, feedback, instructions, examples.
The LLM-driven variation operator — proposes new candidates by mutation and crossover.
Scores each candidate against the task — the fitness signal that drives selection.
Galapagos synthesis of its Claude Code controller and Harbor's installed Codex agent: codex exec --json runs beside a root-owned trusted evaluator in the task container
galapagos run --scaffold codex --task circle_packing \
--proposer.model_name openai/gpt-4o-mini \
--proposer.api_base openrouter