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
v0.3.0
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.

  1. Install.

    npm install -g approval-md

    Node 20 or newer.

  2. Scaffold. In your project:

    approval init

    Writes APPROVAL.md and an empty .approval/.

  3. 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 it

    Add 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.

  4. Sign it.

    approval setup identity
    approval policy attest --as human:<you>

    The gate only functions while the latest policy has been attested.

  5. Turn it on.

    eval "$(approval env)"
    approval up

    Run approval setup channel telegram first if you want the tap on your phone.

  6. 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.json running approval hook claude-code.
    • Cursor: a preToolUse hook in .cursor/hooks.json running approval hook cursor, with failClosed: true.
    • Claude Agent SDK: a HookMatcher that pipes the event to approval hook claude-code.
    • Any MCP client: approval mcp serve.
    • Codex: approval codex prepare writes the config templates; native enforcement is still experimental.
  7. Release your approved agents.

    Tweak your APPROVAL.md to 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.