Codex model vs harness: what decides what the AI may do

By Christophe Paka · Facts checked on 23 October 2026

You type “always approve everything” into Codex. It reads the line and carries on. Then, at the next command, it stops and asks you again. Readers report this often, and the next thought is to blame the model.

Switching to another model does not fix it, because the model never decided when to ask. That job belongs to the harness. Once you split codex model vs harness in your head, odd behaviour gets easy to place. The figure below cuts one Codex surface open and names each layer between you and the model.

The Codex CLI cut open: system prompts and context feed the model; the model and its tools sit inside a dashed sandbox; approvals sit on the right edge; checkpoints, git snapshots around each task, sit at the bottom.
Figure 2.1 Harness anatomy: instructions and project files feed the model, its tools run inside walls the system enforces, approvals decide when you are asked, and checkpoints bracket each task.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start with the frame. The figure opens one place you run Codex, here the CLI, the command line tool in your terminal. The model is the trained AI that decides the next step. Everything else in the frame is the harness: what Codex wraps around it.

  2. Left: what the model is told. System prompts are the standing instructions the harness gives the model before your prompt, plus your AGENTS.md briefing file. Context is what the model sees of your project and history, compacted to fit. Both arrows feed the model, and a big context costs usage on every turn.

  3. Centre: the model and its tools. The model reasons, plans and decides. Below it sit its tools, the actions the harness lets it take: run commands, edit files and search the web. The figure also lists MCP servers. Think of them as add ons that connect Codex to an outside system, such as a database. An add on is someone else's code running with your permissions, so add only ones you trust.

  4. The dashed line: the sandbox. The sandbox is what is physically possible. The operating system builds its walls, the way a locked door stops you whatever you promised. The model and its tools both sit inside those walls, so a rule there holds even if the model gets it wrong.

  5. Right edge: approvals. Approvals decide when the agent must pause and ask you before acting. You set them with a setting, not in the prompt: type /permissions in a session, or use the permissions control below the chat box in the app. For most work, pick Ask for approval. That is why “always approve” changed nothing. See approvals vs sandbox.

  6. Bottom: checkpoints. Checkpoints are git snapshots before and after each task. Git is the tool that saves versions of your files. Your real undo is a commit you make before the task starts.

Key takeaways

  • Name the two parts when results surprise you: the model thinks, the harness decides what it sees, may touch and must ask.
  • Change Codex's behaviour with settings such as /permissions, never by asking the model in the prompt.
  • Compare tools by their harness, not only by the AI inside them.

Worked example: one prompt, three harnesses

The prompt is the same each time: “run tally's tests and fix the first failure.” tally is the small invoicing app the book builds. Only the harness changes.

  1. Codex in the terminal on your laptop gets your real files, a shell, no internet, and a rule to ask before reaching past the project folder. You see each step, and a question each time it wants to go further.
  2. Codex on OpenAI's computers gets a copy of tally in a container: a sealed box that holds the app and everything it needs to run. Internet comes only as your settings allow. You see nothing while it works, then a summary and a diff.
  3. Another tool with the same OpenAI model gets that tool's own instructions and tools. You get a different plan and a different diff.

Result: Same model, same prompt, three results. When two tools disagree, look at the harness first, then at the model.

Questions readers ask

Why does Codex keep asking for approval when I told it to approve everything?

The model read your request, but the model does not decide when to ask. The harness does. Type /permissions and pick a permission mode. Ask for approval asks before anything outside your project. Approve for me lets an automatic reviewer answer most of those questions for you. The chapter on approvals shows when each one is sensible.

Can I just use Claude Code with Codex models?

Where a tool offers OpenAI's models, yes. But you get that tool's harness, so you get its results, not Codex's. Readers who compare them keep posting threads titled “harness matters” for this reason.

Do I need to set up the harness before I start?

No. The harness comes ready. You need the idea at two moments: when results differ between tools, and when Codex keeps asking before it acts and you want it to stop.

Do harness settings change how fast my Codex usage drains?

Some do. Your plan meters Codex work, and a full context window costs on every turn, because the model rereads it all. So one huge test log keeps costing on later turns. The model you pick and how long it thinks also set the pace. Read /status before a heavy prompt.

Sources: Codex CLI guide (OpenAI); Codex documentation hub (OpenAI).

This figure is from OpenAI Codex Made Crystal Clear, chapter 2.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams