What it takes to run Codex harness in production
Think of the model as the brain that decides what to do next. The harness gives it hands and a workspace. It runs the tools, keeps track of the results, and applies the permissions you set. Put them together and you have an agent that can work through a task and act on it.
You can build on an existing harness and integrate it into your product. There are several open-source options on GitHub, including Codex, Hermes Agent, Pi, OpenCode, and goose. You still decide what the agent can access, what it can change, and how you’ll check its work.
Why build around Codex?
You may wonder why you’d use the Codex harness when you can already use Codex directly in the CLI or the app. When you’re working on an issue yourself, you give Codex the context and decide what to do with the result. When your team handles the same kind of work repeatedly, you can build Codex into that workflow. Your app can start a run when an issue or alert comes in and send the result to the right person for review.
In just over three months, OpenAI’s first Performance Factory workflow tracked more than 1,700 investigations and found the root cause in over 600 cases. That’s about 17 automated investigations a day. OpenAI’s Performance Factory write-up

A developer can ask Codex to investigate a well-scoped issue, draft a fix, and run tests. A dedicated app lets the team automate the workflow at scale. It can queue requests from multiple services, give each run the right repository and context, and run independent jobs in parallel. If one run hits a temporary failure, the app can retry it while the others keep going. Finished patches and test results go to the right reviewer. It’s worth building when the time your team gets back on recurring work justifies the cost of running and maintaining the app.
What Codex handles for you
Agent loop. When the model requests a tool, the harness runs it and returns the result. The model uses that result to choose its next step.
Session memory. You can pick up a session from its saved messages and tool activity. Tickets and incident records stay in their source systems.
Context management. The model receives instructions, conversation history, and tool results with each request. As a session grows, the harness can condense older context to make room.
Tool execution. Your app chooses which repositories, services, and data sources to expose. During a run, the agent can read and edit files, run commands, and call connected tools.
Sandboxing and approvals. The sandbox limits what local commands can access. Your team decides when the agent must ask for approval and what its external tools can access.
Progress and run controls. With App Server, you can show progress as it happens, send new instructions while the agent works, or stop the run.
These capabilities work together over the course of a run. Codex can call a tool, use the result to choose its next step, and keep the context it needs to resume later. Your app can follow that progress and step in when the run needs new instructions or has to stop.
Application control plane
When you build an agent that makes decisions or takes action, your app needs controls to keep its work secure and reliable. Together, those controls make up the application control plane. It accepts requests, queues jobs, and tracks each run. Connect the data and tools each job needs, then set permissions, sandbox rules, and approval requirements. Decide when to retry failed jobs and how to verify the results before your app uses them. The right controls depend on what the agent does, what it can access, and what happens if it gets something wrong.
Codex harness
Codex runs the agent loop and carries context between turns. Your app decides what starts the work, what the agent can access, and when the result is ready to use.
What you can automate with Codex
Think about a task your team repeats. Someone gathers information from a few tools, makes sense of it, and prepares something another person can act on. That pattern shows up well beyond writing code.
- Software engineering. Investigate a performance regression, propose a fix, and check whether the service recovered after deployment. OpenAI’s Performance Factory uses Codex for this workflow. Performance Factory
- Customer support. Give a support agent access to relevant account history, product logs, and help docs so it can investigate a ticket and draft a reply for the support team to review. OpenAI’s support workflow example
- Operations. Compare options when a shipment is delayed and ask an operator to approve a rebooking. OpenAI’s Relay sample app shows this with Codex App Server and fictional shipment data. OpenAI’s Relay sample