Skip to content

About

Put a human in the path of risky AI agent actions. Policy, approval and verifiable audit for MCP tool calls, as an agentgateway extension.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

agent-gate

Put a human in the path of risky AI agent actions.

Policy, approval and verifiable audit for MCP tool calls, as an agentgateway extension.

Compatibility test Licence Status

Go agentgateway MCP gRPC Kubernetes Helm Docker GitHub Actions

Vision · Architecture · Decisions · Roadmap

Why

Organisations want agents that act on real systems. Three questions stop them:

  • What may this agent do?
  • Who approved the risky action?
  • Can we prove it afterwards?

Gateways route, authenticate and rate-limit agent traffic. agent-gate adds the human decision and the record that a third party can check.

It does How
Decides each MCP tool call Policy returns allow, deny or needs approval
Holds risky calls for a human The approver decides in an inbox, and cannot be the requester
Passes an approved call once The approval is bound to the caller, the tool and the exact arguments
Proves what happened A hash-chained audit log with signed checkpoints outside the cluster

Status

Note

Phase 1 of the roadmap is next. Phase 0 is complete. The integration with agentgateway is proven by a compatibility test, with a stub in place of the gate. The gate does not exist yet.

How it works

agent-gate is not a gateway. agentgateway carries the traffic and asks the gate for a decision on each tools/call. The gate cannot hold a connection open for hours, so it denies with an approval reference, and the agent replays the identical call after a human approves it.

sequenceDiagram
  autonumber
  participant A as Agent
  participant G as agentgateway
  participant X as agent-gate
  participant H as Approver
  participant S as MCP server
  A->>G: tools/call with token
  G->>X: CheckRequest with tool, arguments and claims
  X-->>G: deny with approval reference
  G-->>A: tool error with approval reference
  H->>X: approve
  A->>G: tools/call, identical replay
  G->>X: CheckRequest
  X-->>G: pass, approval is now used
  G->>S: tools/call
  S-->>G: result
  G->>X: CheckResponse with result
  G-->>A: result
Loading

ADR 0002 records why the gate is an extension. ADR 0009 records the deny and replay contract.

What is proven today

The compatibility test runs 11 scenarios against real agentgateway v1.7.0 on kind. A stub gate and a stub MCP server take the place of the real services.

Contract Scenario
An ungated call reaches the upstream server Ungated tool
A gated call is denied with an approval reference, and the upstream server receives nothing First call to a gated tool
An approved call passes once, in a new session with a new token Replay after approval
A used approval does not pass again Second replay of a used approval
An approval is bound to the arguments Replay with changed arguments
An approval is bound to the caller Replay by a different caller
The gate receives the tool, the arguments and a validated identity claim, and never the token Call with a valid token
The gateway rejects a bad token before the gate and the upstream server Call with a token that fails validation, Call with no token
The gate receives the result of a passed call Result of a passed call
A gate outage fails closed Gate unavailable

The full contract is in the spec.

Run the checks

Required tools: Go, uv and make. The check tools run through go run, pinned in versions.env.

make check    # lint and unit tests, no cluster
make vuln     # govulncheck
make secrets  # gitleaks on the history of HEAD

AGENTS.md lists each command and what it needs.

Run the compatibility test

Required tools: Go, Docker, kind, kubectl, Helm 4 and make. Versions are pinned in test/extmcp/versions.env.

make e2e

The command creates the kind cluster agent-gate-extmcp, deploys the pinned agentgateway with both stubs, and runs each scenario. It exits 0 only when every scenario passes. It takes about one minute, and keeps its kubeconfig in test/extmcp/.kube/.

--- PASS: TestE2E (1.68s)
    --- PASS: TestE2E/Ungated_tool (0.01s)
    --- PASS: TestE2E/First_call_to_a_gated_tool (0.00s)
    --- PASS: TestE2E/Replay_after_approval (0.01s)
    --- PASS: TestE2E/Second_replay_of_a_used_approval (0.01s)
    --- PASS: TestE2E/Replay_with_changed_arguments (0.01s)
    --- PASS: TestE2E/Replay_by_a_different_caller (0.01s)
    --- PASS: TestE2E/Call_with_a_valid_token (0.00s)
    --- PASS: TestE2E/Call_with_a_token_that_fails_validation (0.00s)
    --- PASS: TestE2E/Call_with_no_token (0.00s)
    --- PASS: TestE2E/Result_of_a_passed_call (0.00s)
    --- PASS: TestE2E/Gate_unavailable (1.62s)
make clean

This deletes the cluster.

Where it fits

Concern Owner
MCP and LLM traffic, routing, token budgets agentgateway
Agent and human identity Microsoft Entra ID and Entra Agent ID
Policy decision, approval, audit agent-gate

A team that does not run agentgateway or Entra should look at Preloop first. The vision compares agent-gate with the prior art.

Roadmap

Phase Ships State
0 Foundations Repo, conventions, CI, and the agentgateway spike Done
1 Core on kind Policy engine, approvals, replay, hash-chained audit, verifier CLI, minimal inbox Next
2 Azure Terraform, AKS, keyless deploy, Entra token checks Planned
3 Agent and demo Python ops agent with one real action, guest sign-in, guided tour Planned

The roadmap holds every phase and its exit test.

Repo layout

Path Content
test/extmcp/ The compatibility test: stub gate, stub MCP server, kind manifests, pinned versions
agents/azure-ops/ The Python project of the ops agent. Scaffold only until Phase 3
docs/ Vision, architecture, decision records, roadmap, cost model, conventions
openspec/ The proposal, design, specs and tasks of each change

Licence

Apache-2.0

About

Put a human in the path of risky AI agent actions. Policy, approval and verifiable audit for MCP tool calls, as an agentgateway extension.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages