HTTP + SSE wrapper for codex app-server --listen stdio:// with strict workspace isolation, API-key auth, and server-side ChatGPT Pro bootstrap auth.
- One Codex subprocess per wrapper session.
- HTTP endpoints:
POST /v1/sessionsGET /v1/sessions/{sessionId}/events(SSE)POST /v1/sessions/{sessionId}/rpcDELETE /v1/sessions/{sessionId}GET /healthzGET /readyz
- Built-in API key auth (
Authorization: Bearer ...) with constant-time SHA-256 key checks. - Role model:
userandadmin. - Request policy enforcement:
- strict allow/block method matrix
- fixed
cwdto configuredworkspace_root - sandbox defaults for
thread/*andturn/* - admin-only danger override via
X-Codex-Danger: true
- Skills APIs are allowed (
skills/*). - Dedicated service
CODEX_HOMEbootstrap auth probe (account/read) requiringplanType=pro. - Per-session isolated
CODEX_HOMEclones seeded from service home auth.
export CODEX_HOME=/var/lib/codex-proxy/service-home
codex login --device-authCopy config.example.json to config.json, then set real values.
To create SHA-256 key hashes:
printf 'your-secret-key' | shasum -a 256Use the hex digest in api_keys[].hash (optionally prefixed with sha256:).
go run ./cmd/proxy -config ./config.jsongo test ./...readyzreturns503when bootstrap auth is missing/invalid or plan type is not the configured required plan.- Session homes are created under
<data_dir>/sessions/<sessionId>/home. - Each session is idle-reaped by
session_idle_ttl.
- UI handoff guide:
docs/UI_HANDOFF.md