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
| Control | How | What it stops |
|---|---|---|
| Policy | Default deny, per-tool effects and argument rules | Agents calling tools they should not, or with values outside limits |
| Payload-bound approvals | A different person approves the exact payload, once, before it expires | High-impact actions without a second person, or changed after approval |
| Duplicate-write protection | Idempotency keys required on writes; duplicates replayed or blocked; timeouts handled safely | A retry creating a second payment, order or ticket |
| Header/body check | Mcp-Method and Mcp-Name headers must match the request body | Authorizing one call and executing another |
| Filtered discovery | Denied tools are removed from tools/list | Agents seeing tools they may never call |
| Signed evidence | Hash-chained, Ed25519-signed record of every decision | Undetected edits to the audit trail |
| Control tests and reports | Nine 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
- AI agent / MCP clientClaude, Copilot, ChatGPT, your own agent: any client that speaks MCP over Streamable HTTP.
- Agent Action GateHeader check, then policy, then duplicate check, then approval, then forward, then a signed evidence record for every decision.
- MCP serverAny MCP server on Streamable HTTP, for example SAP Integration Suite MCP Gateway endpoints, Salesforce, ServiceNow or in-house servers.
- 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.
Install Node.js
Install Node.js 22 LTS (or any version from 20.10) from nodejs.org. Check it:
node --versionGet 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-gateCommands below use
actiongate. From a clone, run them asnode bin/actiongate.js <command>, or install the command once withnpm install -g .Run the demo
actiongate demoIt 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.htmlto see the report you will produce for your own systems.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 8787This creates
actiongate.config.json,actiongate.policy.jsonand a signing key in.actiongate/keys/. Keepprivate.pemsecret and backed up; sharepublic.pemwith anyone who must verify evidence.Write your policy
Open
actiongate.policy.jsonand 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.- Read-only tools:
Start the gate
actiongate startIt 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.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/mcpSend
X-ActionGate-User(and optionallyX-ActionGate-Agent) so actions are attributed to people. Make the gate the only network path from agents to the server.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.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.jsonNever run control tests against production: they perform real writes.
Verify and report
actiongate verify actiongate head actiongate reportStore the
headoutput somewhere independent (a ticket or write-once storage) so later truncation can be detected. Giveevidence-report.htmlto 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:
| Framework | Areas |
|---|---|
| EU AI Act | Art. 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 guide | Data integrity; ongoing state of control |
| OWASP Top 10 for Agentic Applications | ASI02 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 headoutput 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.