NewThe Mac app is out for Apple SiliconGet it →
Fenzi
blog, permissions

What does human in the loop mean for AI agents?

It means a person decides before an agent does something that cannot be undone or reaches past what it was given. Coding agents ask at three points: before a tool call, before a plan runs, or when the agent needs more access than its boundary allows. Asking at every step fails in practice, because people approve without reading, so the loop works best when a boundary handles the routine and the person sees only the requests that would widen it.

By Boris Kwemo, , six-minute read

Most writing on human in the loop is about business workflows: a person signs off on a refund or a contract the model drafted. This post is about the AI agent a developer runs, such as Claude Code, Codex or OpenCode, where the action is a shell command, a file write or a call to a host. The question there is narrower: when does the agent stop and wait for you, and does your answer still mean anything by the fortieth time?

Three places a person can sit

Before each action. The agent shows a command or an edit and waits for yes or no. This is the classic prompt, and Claude Code, Codex and OpenCode all have it.

Before a plan. The agent reads the code, writes down what it intends to change, and edits nothing until you approve the plan. You judge the direction once instead of every step.

At the boundary. The agent works freely inside limits set in advance, such as the project folder and a short list of hosts, and asks only when it needs to cross them. You answer fewer questions, and each one is about access rather than about a single command.

How today's agents ask

Each vendor exposes the same idea with different names. The table reads from each one's own docs or source.

AgentAsks before actingAsks lessNever asks
Claude CodeManual modeacceptEdits, plan, autodontAsk denies what would prompt; bypassPermissions allows it
Codexuntrustedon-request, the defaultnever
OpenCodeRules set to askalways on a prompt, for the sessionRules set to allow, the default for most tools

Claude Code's permission modes page says Manual mode stops and asks before most actions that edit files, run shell commands or reach the network, and that explicit ask rules prompt in every mode. Our notes on how Claude Code permissions work cover the rules that sit on top of those modes.

In Codex, the default approval policy hands the timing to the model. The Codex source describes on-request in one line: "The model decides when to ask the user for approval." With never, failures go straight back to the model and are never escalated to you; Codex's yolo flag turns that on together with no sandbox.

OpenCode's permissions docs give each prompt three answers: once, always for matching requests in the rest of the session, and reject. Out of the box most tools are set to allow, and only reads of .env files, paths outside the project and the same call repeated three times ask. Our notes on how OpenCode permissions work go through those defaults.

Why asking at every step stops working

A prompt protects you only if someone reads it. On a long task the agent asks dozens of times, most requests are harmless, and the hand learns to press yes. Anthropic calls this approval fatigue, and its engineering post on how it built auto mode measured it on its own users.

Manual prompts sit in the middle, and in practice users accept 93% of them anyway.Anthropic Engineering, How we built Claude Code auto mode

The usual escape is to turn the questions off entirely. That removes the person without adding anything in their place, which is why our notes on whether dangerously skip permissions is safe come down to the boundary around the agent.

When a second model stands in for the person

Claude Code's auto mode replaces most prompts with a classifier that reviews each action before it runs. The design is careful: the classifier sees your messages and the agent's tool calls but not the agent's own prose, so the agent cannot argue its way past it. After three denials in a row or twenty in a session, it stops and hands back to a person, and a headless run simply ends.

Anthropic publishes the miss rate too. On a set of real overeager actions from its own staff, the full pipeline let 17% through, and the post says that in most misses the classifier saw the danger but read something said earlier in the session as consent for it. Its docs carry the warning in plain words: "Auto mode reduces permission prompts but does not guarantee safety."

That is an honest trade, and a better one than no review at all. It also means a model now judges another model, and some of what a person would have refused gets through.

"Human in the loop means a person approves every action."

Revision 1: a person approves what widens the agent's reach, and a boundary holds the rest.

Put the person at the boundary

Anthropic's post on sandboxing Claude Code takes the third seat. Its sandbox limits writes to the working directory and sends network traffic through a proxy that allows listed domains and asks the user about new ones. Inside those limits commands run without prompts, and Anthropic reports far fewer of them in its own use.

The same post says both halves are needed: without network limits a compromised agent can send your SSH keys out, and without file limits it can escape to reach the network. When both hold, the question a person answers changes from "may it run this command" to "may it reach this host", which is rarer and easier to judge.

The permission modes page makes the same pairing in its table of goals, matching each mode with the isolation it needs. It is a good map even if you use another agent.

What a good approval looks like

It names what changes. A host, a method and a path, or a folder, with the agent's reason beside it. "Allow Bash" is not a decision anyone can make well.

The agent cannot answer its own request. A rule the agent can edit, or an approval it can click through a tool, puts it back in charge of its limits.

One yes is not a pattern. Approve the narrow thing that was asked. Keep "always" for hosts you would have listed yourself.

Irreversible actions always ask. Force pushes, deletes outside the project and anything touching production deserve an explicit ask rule, whatever mode the agent runs in, because Claude Code's rewind cannot take them back.

Headless runs need limits, not prompts. In CI there is nobody to ask, so use an exact allowlist and a mode that denies the rest, such as Claude Code's dontAsk. That list of who decides what is the core of agentic AI security as we see it, and our page on AI agent security risks covers what happens when nobody does.

A side note on how we do it

We build Fenzi, which starts the agent inside an OpenShell sandbox where a blocked host becomes a request that waits for a person, and the agent never approves itself; the requests and approvals sheet shows the flow. It is one way to put the person at the boundary, and a vendor's own sandbox or a proxy with an allowlist can do it too.

So, what does it mean?

Human in the loop for an AI agent means a person, not the agent and not another model alone, decides when the agent's reach grows. Asking about every command turns into a reflex, so set the boundary first, let the agent run inside it, and keep your attention for the few requests that cross it. Claude Code's permission modes page is a good next read for matching how often you are asked to how much the agent can reach.

One line to install.
One command to run.

curl -fsSL https://fenzi.dev/install.sh | sh

Then fenzi run claude. Ask it to open a pull request with the GitHub API, and watch the deny land.