Skip to content

Codex

Run OpenAI's Codex CLI autonomously within approval-gated Cloudflare Sandboxes.

Updated

Shiba packages OpenAI’s Codex CLI inside the container image, providing fast, automated execution for tasks optimized for OpenAI coding models.

Agent Overview

Attribute Specification
Harness ID codex
CLI Binary codex
Pinned Version 0.157.1 (in Dockerfile)
Default Model openai/gpt-5.3-codex
Supported Models openai/gpt-5.3-codex, openai/o3-mini, openai/gpt-4o, openai/gpt-4.5-preview
Credential Model AI Gateway BYOK (dummy key inside sandbox; real key injected at egress)
Invocation codex exec --json --dangerously-bypass-approvals-and-sandbox "<task>"

How It Works

Developer Request
  └── CodingOrchestrator generates delegate_coding_task({ harness: "codex" })
      └── Human signs off on exact prompt & repository
          └── Ephemeral Cloudflare Sandbox boots
              ├── Clones repository via scoped git token
              ├── Executes: codex exec --json "<task>"
              ├── Streams structured JSON output to the Worker
              └── Emits diff and pull request receipts

Configuration & Deployment

1. Configure the Provider Key in AI Gateway

Store your OpenAI API key in your Cloudflare AI Gateway under the provider ID openai. Egress traffic to api.openai.com is intercepted and authorized at the Cloudflare edge.

2. Set Default Model

In your environment or wrangler.jsonc:

# Set default harness to Codex
pnpm wrangler secret put AGENT_HARNESS --config apps/backend/wrangler.jsonc # enter "codex"

# Set default model for Codex
pnpm wrangler secret put CODEX_MODEL --config apps/backend/wrangler.jsonc # enter "openai/gpt-5.3-codex"

Selecting Codex in a Task

Specify harness: "codex" in any task request:

{
  "repoUrl": "https://github.com/acme/frontend",
  "task": "Add optimistic UI updates to the checkout mutation",
  "baseBranch": "main",
  "harness": "codex",
  "codingModel": "openai/gpt-5.3-codex"
}

Event Parsing & Safety

Codex runs non-interactively with codex exec --json. Each emitted line is parsed for:

  • Command and execution steps
  • Modified files and staged changes
  • Structured error envelopes (surfaced directly as honest failures)

Type to search…

↑↓ navigate↵ selectEsc close