Human-in-the-Loop Approval for Coding Agents
Human-in-the-loop approval is the practice of making an agent wait for a person before certain actions. For coding agents it is usually experienced as a permission prompt, and usually disliked: too many prompts, in the wrong place, at the wrong time. Done well, it is the opposite. Few questions, each one worth reading, sent to the person who can answer. This guide covers what should need a person, what should not, how to route and time requests, and what to do when no one answers.
Why human-in-the-loop approval goes wrong
Anthropic has published two numbers about its own product that frame the problem. Claude Code users approve 93% of permission prompts. And its sandboxing post names the consequence, approval fatigue: people who click approve constantly stop reading what they approve.
A control that is answered yes 93% of the time carries little information. The aim is not to remove people from the loop. It is to remove the questions that did not need them, so the remaining ones get real attention.
LangChain describes three kinds of interaction between background agents and people: notify, question and review. For coding agents a fourth is common: permission to run a specific command. Each needs different handling.
Decide what needs a person
Sort actions into three groups before writing any rules.
Never needs a person. Reading files, running tests, linting, building, formatting. These should be allowed by rule or contained by a sandbox.
Sometimes needs a person. Installing dependencies, deleting files, running scripts, network access. Whether to ask depends on the repository, the branch and the arguments.
Always needs a person. Anything that touches production, secrets or money. Deploys, migrations against live data, key rotation, publishing packages, commands that spend.
The third group should be a hard category, not a default that a clever rule can override. In Forkit these requests always reach a person: no allow rule and no orchestrator agent can answer them, a person can only allow them once, and they are never merged with similar requests.
Put cheaper deciders in front of the person
A person is the most expensive decider. Put cheaper ones first.
- A sandbox removes the need to ask about anything that cannot escape it.
- Permission rules answer the routine. An allow rule for
npm test*, a deny rule forrm -rf /. A matching deny should always win. - A delegate can answer a bounded set. Forkit lets a workspace owner name one agent as an orchestrator and tick the tools it may answer for.
- A person gets what is left.
Forkit's documentation describes exactly these layers after the sandbox: rules, orchestrator, person, and then a timeout.
Send the request to the right person
A prompt in the terminal reaches whoever is running the agent. That is often the wrong person.
- The agent's own person knows the task and can answer most things.
- The owner of the area should answer for sensitive paths. "Ben signs for
*.sql." - A workspace owner can answer for someone who is away.
For approvals of finished work, approval rules map path globs to approvers. For permission requests, Forkit sends them to the agent's person or a workspace owner, and a member's rules cover only that member's agents.
Make the request answerable in ten seconds
A person can decide quickly only if the request carries its context. Include:
- Which agent, on whose machine.
- The repository and branch.
- The exact command, file path or URL. Not a summary.
- How long it has been waiting.
Offer answers that match real intentions:
- Allow once. For the unusual.
- Allow for an hour. For a burst of similar commands during one task.
- Always. Which should create a rule, so the question never returns.
- Deny, with a note. The note goes back to the agent, so it can try something else instead of asking again.
Those are the four options in Forkit's inbox and in forkit watch. The "always" option matters most over time: every answer that becomes a rule is a question nobody sees again.
Group identical requests
When several agents ask the same thing, one answer should settle all of them. Forkit merges pending requests with the same fan-out, tool, subject and repository into one question. Two hundred workers asking to run the same pnpm install produce one item in the inbox, not two hundred.
Decide what happens on timeout
Every design needs an answer to "what if nobody replies". There are three honest options.
- Fall back to the local prompt. For an agent in a terminal, Forkit's hook waits 90 seconds by default, then withdraws the request and prints nothing, so Claude Code asks in its own terminal as it always did. The remote queue is an addition, never a trap.
- Deny. For agents with no terminal, such as CI jobs, an unanswered request is recorded as denied. Any agent can be given the same behaviour with
FORKIT_ON_TIMEOUT=deny. - Escalation. Notify someone. Forkit's notification sweep tells people about a permission request that has waited 20 seconds or more, and about questions, reviews and blocked threads after two minutes, once per need. Slack webhooks are supported as a channel.
What you should not do is allow on timeout. Silence is not consent.
Questions and reviews
Permission is one kind of interruption. Two others deserve the same care.
Questions. When an agent is unsure which of two approaches to take, it should ask and offer options. Forkit lets an agent set its thread to waiting with up to five one-click answers and then wait with wait_for_reply. With the Claude Code hook, a turn that ends in a question is sent to the inbox automatically, and a person's reply continues the turn.
Review. Finished work needs a decision by someone who owns the files, tied to the state they looked at. See how to review agent pull requests.
Keep agents from approving for people
One rule holds the whole design together: only a person's action counts as a person's decision. If an agent can send a message that reads "approved by the user" and another agent acts on it, approval is meaningless.
Forkit stores messages between agents in a separate table from people's events, so an agent's message cannot answer a permission request, decide a review or resolve a thread. Anthropic's agent teams have the same rule: a teammate cannot supply consent on your behalf.
A checklist
- List the actions that must always reach a person. Make that list unoverridable.
- Turn on a sandbox.
- Write allow rules for everything you approve without reading.
- Write deny rules for what must never run.
- Route the rest to a queue that reaches people where they are.
- Choose a timeout behaviour per kind of agent.
- Review the queue weekly, and turn repeated answers into rules.
Related: agent permission rules, ways to approve agent commands compared and what is an agent inbox.
Where Forkit fits
Forkit implements this design for Claude Code and other coding agents: rules, an optional orchestrator, a person, a timeout, and a hard category for production, secrets and money. It is free to try, and npx forkit-cli init sets it up. More at forkit-mcp.com.