Human-in-the-loop for coding agents: one approval list for the whole team

Human in the loop vs human on the loop for a team's coding agents: three lists of what agents do alone, ask first or never do, committed for Claude Code and Codex. Tested: the rules held even with prompts turned off.

By Scott Strang

Last updated

The short answer. Human in the loop means a person approves each action an AI agent takes; human on the loop means a person sets the rules the agent runs inside. For a team using coding agents, it means deciding once which actions need a person, writing that as three lists (the agent does it alone, asks first, or never), and committing them in each tool's own file: .claude/settings.json for Claude Code, .codex/rules/ for Codex. In our Nov 24, 2026 test (Claude Code 2.1.283, Codex CLI 0.146.0), those committed rules stopped both agents from pushing to main even with prompts turned off.

Every way of approving agents costs attention or trust

Five people on a team run Claude Code or Codex. Each one approves prompts their own way, one has turned prompts off, and nobody has written down which actions an agent may take alone. That is the team's approval policy today. The usual fixes each fail in a known way:

The usual fixWhat it costsHow it fails

Human in the loop vs human on the loop: you need both, for different actions

Kief Morris, writing on Martin Fowler's site, puts the difference plainly: in the loop, you fix the output (edit it, or tell the agent the correction); on the loop, you change the rules and checks that produced it, so the next output is right.

Human in the loopHuman on the loop

A team needs both. The three lists below decide which actions get which.

Sort actions by what they cost to undo, not by tool

Why it works. "Can we undo this in a minute?" has the same answer in Claude Code, Codex or any other agent, so one list covers every tool. Editing a file in a branch is cheap to undo. A push to main, a deploy, a deleted record or a sent email isn't.

Try this week. At your next team meeting, spend ten minutes filling in three lists with your own commands:

Agent does it aloneAgent asks firstOnly a person does it

Watch for. A "never" list so long that people turn prompts off to get work done. Keep it to the actions you truly can't take back.

Write the list in the repo, in each tool's own file

Why it works. A rule in a committed file reaches every teammate who clones the repo, and the tool enforces it before the agent's own judgment comes in. Claude Code checks rules in the order deny, then ask, then allow, so an allow can't cancel a deny. Codex applies the strictest matching rule (forbidden over prompt over allow).

Try this week. Whoever set up the repo's agents commits both files on a branch and opens a pull request for them.

Claude Code, .claude/settings.json:

{
  "permissions": {
    "allow": ["Bash(npm test *)"],
    "ask": ["Bash(npm install *)"],
    "deny": ["Bash(git push *)"]
  }
}

Codex, .codex/rules/team.rules:

prefix_rule(
    pattern = ["git", "push"],
    decision = "forbidden",
    justification = "A person pushes. Agents commit and stop.",
)
prefix_rule(
    pattern = ["npm", "install"],
    decision = "prompt",
    justification = "New dependencies get a person's look first.",
)

Check the Codex file with codex execpolicy check --pretty --rules .codex/rules/team.rules -- git push origin main; it should print "decision": "forbidden".

Watch for. Folder trust. Claude Code applies a project's deny and ask rules right away, but its allow rules only after someone accepts the folder's trust prompt; in our check it printed "Ignoring 1 permissions.allow entry" for an untrusted folder. Codex reads the whole .codex/ folder only in projects marked trusted (its docs). Have each teammate open the repo once and accept the trust prompt.

Our test: the team's file held for the teammate who turned prompts off

Each run was a fresh repo with a remote. The agent was told to commit, then git push origin main. The team rule: never push, and ask before committing (the files above plus one ask rule for git commit: Bash(git commit *) in Claude Code, a prompt rule for ["git", "commit"] in Codex). We checked the remote afterwards, not the agent's account of it.

SetupClaude Code 2.1.283Codex CLI 0.146.0

Tested Nov 24, 2026, one headless run per row (claude -p; codex exec with gpt-5.6-sol). Prompts off means --dangerously-skip-permissions in Claude Code and --dangerously-bypass-approvals-and-sandbox in Codex. The personal allow was .claude/settings.local.json in Claude Code. In Codex, the tester's own ~/.codex/rules/default.rules already allowed git commit and git push, so every Codex run had that allow in place. Codex refused the push with our rule's own text: "A person pushes. Agents commit and stop." The commits were blocked because a headless run has nobody to answer the ask; in an interactive Claude Code session, its docs say an ask rule prompts you even in bypass mode. In our runs, codex exec marked each test folder trusted on its own, so we couldn't test an untrusted one.

Approve the plan and the last irreversible step, not every command

Why it works. Approving every command trains people to stop reading. Approving a plan before any code, and the one step you can't take back, puts the reading where it changes the outcome.

Try this week. The next time you start a feature, start it in plan mode and approve the plan, not the commands that follow it. For keeping plans where teammates' agents find them, see Claude Code plan mode: saving and sharing plans across a team.

Watch for. "Approve" with no record. If nobody can tell next week which plan was approved, the approval did nothing for the team.

Let the agent prepare and a person press the button

Why it works. The agent does the slow part (find the records, write the plan, run the dry run), and the irreversible step becomes one command a person reads and runs. The person's attention goes to one line instead of fifty prompts.

Try this week. By Friday, pick one risky job your agents help with, such as a deploy or a data cleanup, and add one line to AGENTS.md for it, such as: "For deploys, stop after the dry run and give me the exact command to run." Pair it with a deny rule, so the line isn't the only thing holding.

Watch for. A handoff command nobody reads. If people paste it straight back into the agent, it's a prompt with extra steps.

When an agent does something wrong, fix the list, not only the output

Why it works. Correcting the output fixes one session. Adding a rule fixes every session after it, for every teammate. That is the "on the loop" move.

Try this week. The next time you stop an agent or undo its work, ask whether a line in one of the two files would have stopped it, and open a pull request with that line the same day.

Watch for. Rules nobody can explain. Codex's justification field and a one-line reason in the pull request keep the why next to the rule.

One week to start

MonTueWedThuFri

Approve lists, not keystrokes: what to stop and start

StopStart insteadWhy

Signs it's working

  • Nobody says "my agent pushed that, sorry".
  • Someone new clones the repo, accepts the trust prompt, and their agent already stops where everyone else's does.
  • When an agent asks you something, you read it, because it asks rarely.
  • Rule changes arrive as small pull requests with a reason attached.

Where it breaks: each tool has its own file, and rules match the command text

The two files above cover Claude Code and Codex. Cursor, Copilot and other agents have their own settings; check each tool's docs before assuming it reads either file. Three more gaps:

  • Rules match the usual form of a command. Claude Code's docs say Bash(git push *) blocks git push origin main but not git -C . push origin main, and that a Bash rule "isn't a security boundary". For a real boundary, use the sandbox or a pre-tool hook, and protect main on the server (branch protection) so a push that gets through still can't land.
  • Personal files can add rules, but in our test couldn't cancel the team's. A personal allow lost to the team's deny and ask in Claude Code and to the team's forbidden in Codex.
  • The settings file stops an action; it doesn't explain the policy. Put the three lists in AGENTS.md (and CLAUDE.md, or have CLAUDE.md point to AGENTS.md) in plain words, so every agent, in any tool, knows the policy before it tries. See CLAUDE.md and AGENTS.md: keeping them right for a whole team.

How we do it: agents prepare our deletes and releases, and a person presses them

This pattern isn't only for code. Our go-to-market team's agents work in our CRM and in a data pipeline's releases, and the rule there is the same. Their instructions say agents can't run deletes in the CRM: they find the records, prove each one is safe to remove, write a plan and hand the person one command that asks "yes" before it deletes (in place since Oct 26, 2026). The pipeline's runbook says agents press a real production release "only on their person's literal word. A dry run is free." (since Oct 29, 2026). Both sit in files the repo carries, so every teammate's agent starts with them.

Where SageOx helps

SageOx is not an agent. It's a tool-agnostic context layer that keeps teams of humans and agents coordinated, so every person and every agent knows what the team knows. It doesn't replace the permission files above. It carries the policy behind them to every agent on the team.

  • Team rules: write the three lists once, and they reach every agent in every repo, scoped by repo and file pattern, whichever coding agent each person uses. SageOx also places them in each tool's own rules folder (Claude Code, Cursor, Cline and Kiro). These are instructions the agent reads, not permission files, so keep the deny rules too. How team rules work.
  • Plan approval: review a plan on a local page by commenting on a section or exact words; the agent revises; you approve. Saved plans are marked approved, realized, superseded or abandoned, with a record of which coding sessions worked on them.

Have your agent do it

Paste this into Claude Code, Codex or another coding agent at the root of a repo. It edits files but commits nothing until you've seen the diff.

Set up this repo so every teammate's coding agent follows the same approval rules.
1. List the commands agents run here (package.json scripts, Makefile, CI files, README).
   Sort them into three lists: agent does it alone, agent asks first, only a person does it.
   Put push, deploy, data deletes, sending messages and merges in the third list.
   Show me the lists and wait.
2. After I confirm, add the lists to .claude/settings.json under permissions as allow, ask
   and deny rules (keep anything already in the file).
3. Write the same lists to .codex/rules/team.rules as prefix_rule entries (allow, prompt,
   forbidden), each with a one-line justification. Run codex execpolicy check on two
   commands from the third list and show me the output.
4. Add an "Approvals" section to AGENTS.md with the three lists in plain words, and what
   to do instead when a command is blocked (stop and give me the exact command).
   If there is a CLAUDE.md that doesn't already import AGENTS.md, add the line
   @AGENTS.md to it, so Claude Code reads the same section.
Show me the diff before committing anything.

Questions

What's the difference between human in the loop and human on the loop? In the loop, a person approves or corrects each action or result; on the loop, a person sets the rules and checks the agent runs inside. Use in the loop for the few actions you can't undo, and on the loop for the rest.

What does --dangerously-skip-permissions skip? Permission prompts. Claude Code's docs say deny rules still block in that mode and ask rules still prompt, while allow rules have no effect; our test saw a committed deny rule block git push with it on.

Where do Codex rules go? In a .rules file under rules/ next to a config layer: ~/.codex/rules/ for you, <repo>/.codex/rules/ for the project, which loads only once the project is trusted. Codex's docs mark rules as experimental.

Can a teammate override the team's rules? Not by adding a personal allow: in our test it lost to the team's rules in both tools. They can still edit the committed file, so send rule changes through a pull request.

Is a deny rule enough to keep an agent away from production? No. It blocks the usual command, not every way to run it, so pair it with credentials the agent doesn't have, a sandbox and branch protection.

Sources

The practices are from people who live this, not a study. The facts they rest on:

SourceWhat we usedChecked

More on working together without colliding