Freeload OpenAI's Top Agent Foundation: The Codex Harness Integration SOP - a Three-Stage Rocket from One Command to a Production Runtime
The integration SOP for freeloading OpenAI's top agent foundation: a three-stage rocket. Stage 0 authentication (login_chatgpt / login_api_key; keys in env vars, never prompts) -> Stage 1 codex exec, one command for CI/scripts -> Stage 2 the Codex SDK as a callable function (startThread/run, outputSchema structured output, thread persistence in ~/.codex/sessions with resumeThread breakpoint resume, runStreamed event streams, sandbox and filesystem-granularity permission config examples) -> Stage 3 codex app-server as a production runtime (JSON-RPC 2.0, generate-json-schema, first-class Approvals semantics, -32001 overload retry, /readyz /healthz probes). Includes a 10-item pre-launch checklist and five classic pitfalls (keys in prompts, trusting sandbox defaults, non-Git directories, re-running instead of resuming, jumping to app-server on day one). All examples from the official repo docs; not legal or security-compliance advice.