Open-source tool · Apache 2.0 · v0.1.0

Agent Action Gate

A free, open-source safety gate and evidence trail for AI agents that take real actions. It sits in front of any MCP server and, for every tool call, applies your policy, holds high-impact actions for a separate approver, blocks duplicate writes, and writes a signed, tamper-evident record. Then it proves the controls work with repeatable tests and audit-ready reports.

Only needs Node.js · no other dependencies · Windows, macOS, Linux · by Ramesh Varanganti

Why it exists

Agents now call tools that create payments, change master data and send messages. Three things go wrong again and again: a retry after a timeout runs the same write twice; a high-impact action happens without a second person; and when auditors ask what the agent did, there is no trustworthy record. Agent Action Gate handles all three in one small component you control, in front of any MCP server, whichever vendor built it.

What it controls

ControlHowWhat it stops
PolicyDefault deny, per-tool effects and argument rulesAgents calling tools they should not, or with values outside limits
Payload-bound approvalsA different person approves the exact payload, once, before it expiresHigh-impact actions without a second person, or changed after approval
Duplicate-write protectionIdempotency keys required on writes; duplicates replayed or blocked; timeouts handled safelyA retry creating a second payment, order or ticket
Header/body checkMcp-Method and Mcp-Name headers must match the request bodyAuthorizing one call and executing another
Filtered discoveryDenied tools are removed from tools/listAgents seeing tools they may never call
Signed evidenceHash-chained, Ed25519-signed record of every decisionUndetected edits to the audit trail
Control tests and reportsNine repeatable tests; Markdown and HTML reports with a framework evidence map“We think it works” instead of evidence

See it work

One command runs the full demo: a sample ERP-style MCP server, the gate, an agent scenario, nine control tests and an evidence report.

node bin/actiongate.js demo
create_payment 250 USD
  -> Payment 5100000001 created: 250 USD to vendor V100.
create_payment 250 USD again (agent retry after a timeout)
  -> Payment 5100000001 created: 250 USD to vendor V100.  [replayed by the gate: no second payment]
create_payment 48,000 EUR
  -> Approval required (payments over 10,000 need a second person). Approval ID: apr_...
update_bank_details(V100)
  -> Blocked by policy: tool "update_bank_details" effect=deny.

Control tests: 9/9 passed
Evidence: 20 records, ledger verified

How it works

  1. AI agent / MCP clientClaude, Copilot, ChatGPT, your own agent: any client that speaks MCP over Streamable HTTP.
  2. Agent Action GateHeader check, then policy, then duplicate check, then approval, then forward, then a signed evidence record for every decision.
  3. MCP serverAny MCP server on Streamable HTTP, for example SAP Integration Suite MCP Gateway endpoints, Salesforce, ServiceNow or in-house servers.
  4. Business systemsERP, HR, finance and supplier systems behind the MCP server.

Duplicate checks run before approval, so retrying an approved, completed action returns the stored result instead of asking again. Details in the architecture document.

Step-by-step guide

From nothing to a governed MCP server with an evidence report. The same guide, with troubleshooting and production tips, is in the repository as docs/getting-started.md.

  1. Install Node.js

    Install Node.js 22 LTS (or any version from 20.10) from nodejs.org. Check it:

    node --version
  2. Get Agent Action Gate

    Clone the repository. There is nothing else to install.

    git clone https://github.com/rameshvaranganti/agent-action-gate.git
    cd agent-action-gate

    Commands below use actiongate. From a clone, run them as node bin/actiongate.js <command>, or install the command once with npm install -g .

  3. Run the demo

    actiongate demo

    It starts a sample ERP-style MCP server and the gate, plays an agent scenario, runs nine control tests and writes an evidence report. You should see 9/9 passed. Open actiongate-demo/.actiongate/reports/evidence-report.html to see the report you will produce for your own systems.

  4. Create your configuration

    In a new folder for your deployment, point the gate at your MCP server:

    actiongate init --upstream https://your-mcp-server.example.com/mcp --port 8787

    This creates actiongate.config.json, actiongate.policy.json and a signing key in .actiongate/keys/. Keep private.pem secret and backed up; share public.pem with anyone who must verify evidence.

  5. Write your policy

    Open actiongate.policy.json and list your tools:

    • Read-only tools: "effect": "allow", "class": "read"
    • Tools that change data: "class": "write" plus "idempotencyKeyArg", the argument that identifies one business action
    • Tools agents must never use: "effect": "deny"
    • Limits as rules, for example approval above an amount
    • Sensitive argument names in "redact"

    Then check it with actiongate policy check. See the policy example below.

  6. Start the gate

    actiongate start

    It listens on http://127.0.0.1:8787/mcp. Policy edits apply without a restart. Health check: http://127.0.0.1:8787/actiongate/health.

  7. Point your agent at the gate

    Change the MCP server URL in your client to the gate. For example:

    claude mcp add --transport http my-erp http://127.0.0.1:8787/mcp

    Send X-ActionGate-User (and optionally X-ActionGate-Agent) so actions are attributed to people. Make the gate the only network path from agents to the server.

  8. Approve high-impact actions

    When a call needs approval, the agent receives an approval ID. A different person approves it:

    actiongate approvals list
    actiongate approvals approve apr_XXXX --by jane.smith --note "Matches PO 4500012345"

    The agent retries the identical call with _meta["io.actiongate/approvalId"]. If anything changed, a new approval is needed. Each approval works once.

  9. Run control tests on a test system

    Copy policies/demo-controls.json, change it to your own test tools, then:

    actiongate controls --spec my-controls.json

    Never run control tests against production: they perform real writes.

  10. Verify and report

    actiongate verify
    actiongate head
    actiongate report

    Store the head output somewhere independent (a ticket or write-once storage) so later truncation can be detected. Give evidence-report.html to security, quality or audit.

Policy example

Unlisted tools are denied. Reads are allowed. Payments need an idempotency key and, above 10,000, a second person. Bank changes are never allowed. Full reference: policy reference.

{
  "defaultEffect": "deny",
  "redact": ["iban", "password"],
  "tools": {
    "get_order_status": { "effect": "allow", "class": "read" },
    "create_payment": {
      "effect": "allow", "class": "write", "idempotencyKeyArg": "requestId",
      "rules": [
        { "id": "large-payment", "when": { "arg": "amount", "gt": 10000 },
          "effect": "approval_required", "reason": "payments over 10,000 need a second person" }
      ]
    },
    "update_bank_details": { "effect": "deny" }
  }
}

Evidence and frameworks

Every decision becomes a record with time, agent, user, the policy version that applied, the decision and the outcome. Records are hash-chained and Ed25519-signed, so editing, deleting or reordering one is detected by actiongate verify. Reports map the evidence to:

FrameworkAreas
EU AI ActArt. 12 record-keeping; Art. 14 human oversight
FDA 21 CFR Part 11§11.10(e) audit trails; §11.10(g) authority checks
ISPE GAMP 5 and GAMP AI guideData integrity; ongoing state of control
OWASP Top 10 for Agentic ApplicationsASI02 tool misuse, ASI03 identity, ASI08 cascading failures, ASI09 human-agent trust

This is an evidence aid, not a compliance certificate. See the framework mapping and the readiness assessment.

Limitations to know

  • It only governs traffic that passes through it. Block direct network paths from agents to the systems behind it.
  • User identity comes from a header unless you run it behind an authenticating gateway. In production, take identity from validated tokens.
  • Verification detects edited, deleted or reordered records, not records removed from the end. Store actiongate head output somewhere independent.
  • Version 0.1 is a single process with file storage. Get an independent security review before production use.

Use it, improve it

Agent Action Gate is free for everyone under Apache 2.0. Report issues, suggest controls or contribute policy examples for SAP, Salesforce, ServiceNow and other systems on GitHub. Related: human approval gate pattern, safe write pattern, central MCP gateway pattern.

Frequently asked questions

What is Agent Action Gate?

An open-source proxy that sits in front of any MCP server. For every tool call an AI agent makes, it applies your policy, holds high-impact actions for a separate approver, blocks duplicate writes, and writes a signed, tamper-evident evidence record. It also runs control tests and produces audit-ready reports.

Is it free?

Yes. It is released under the Apache 2.0 license, so anyone can use, change and run it, including commercially, at no cost.

Which MCP servers does it work with?

Any MCP server that uses the Streamable HTTP transport, built with any SDK or platform. It handles MCP protocol versions 2025-11-25 and 2026-07-28 and both JSON and streamed (SSE) responses, and has been tested end to end with the official MCP TypeScript SDK. stdio-only servers need an HTTP bridge in front.

Does it make my system compliant with the EU AI Act or 21 CFR Part 11?

No tool can do that on its own. Agent Action Gate produces evidence (records, approvals, control-test results) mapped to those frameworks. Whether a system complies is a judgement for your quality, legal and audit teams.

What does it need to run?

Only Node.js 20.10 or later. It has no other dependencies, so it runs on Windows, macOS, Linux and in containers.

How is it different from logging tools?

Logging tools record what happened. Agent Action Gate also enforces controls before anything happens (deny, approval, duplicate protection, header checks) and proves they work with repeatable control tests.

Get Agent Action Gate on GitHub →