apprval.md human approval for agent actions
A harness-agnostic, open-source framework for approving agent actions with a human in the loop
npm install -g approval-md
Latest features / contribute
Use a source checkout to contribute or to run unreleased work.
git clone https://github.com/approval-md/approval.md && cd approval.md && npm ci && npm run build && npm link
An action travels from the agent, stops at the gate until a tap on the phone approves it, then continues to the world, while an autonomous read action passes straight through.
-
Install.
npm install -g approval-mdNode 20 or newer.
-
Scaffold. In your project:
approval initWrites
APPROVAL.mdand an empty.approval/. -
Configure your APPROVAL.md.
Specify agent autonomy across classes of actions.
{ autonomy: autonomous } # actions flow freely through the gate { autonomy: supervised-retro } # actions flow, a sample is reviewed afterwards { autonomy: supervised-live, live_rate: 0.01 } # a declared fraction pauses at the gate for approval { autonomy: manual } # every action pauses at the gate for approval { autonomy: human-only } # the human performs the action; agents cannot request itAdd human values to inform agent judgement across the gate. Specify what you love, like, dislike, and how you give feedback.
An APPROVAL.md file being typed into a terminal: a yaml approval-policy block giving each class of action an autonomy level, and a yaml approval-values block stating what the operator loves, dislikes and wants.
-
Sign it.
approval setup identity approval policy attest --as human:<you>The gate only functions while the latest policy has been attested.
-
Turn it on.
eval "$(approval env)" approval upRun
approval setup channel telegramfirst if you want the tap on your phone. -
Harness-agnostic. Put the gate in front of whichever agent you run.
Each one classifies every shell command and file edit against your policy.
- Claude Code: a PreToolUse hook in
.claude/settings.jsonrunningapproval hook claude-code. - Cursor: a preToolUse hook in
.cursor/hooks.jsonrunningapproval hook cursor, withfailClosed: true. - Claude Agent SDK: a HookMatcher that pipes the event to
approval hook claude-code. - Any MCP client:
approval mcp serve. - Codex:
approval codex preparewrites the config templates; native enforcement is still experimental.
- Claude Code: a PreToolUse hook in
-
Release your approved agents.
Tweak your
APPROVAL.mdto find good human-agent harmony: loosen the gate for some actions, tighten it for others, re-attest, keep going.An agent sends an email: the message is held at the gate, a tap approves it, it lands in the inbox as delivered, and two lines appear in the log.
Alternatively run approval quickstart for a walkthrough.