AgentGate
Runtime authorization, containment and audit for AI agents. Every privileged tool call is authenticated, scoped to a task, checked against deterministic policy, executed through a credential-injecting proxy and written to a keyed, hash-chained audit log.
AI proposes. Policy decides. Automation enforces. Humans approve exceptional risk. Audit records everything.
AUTHORIZED BY: POLICY · AI AUTHORIZATION: NEVER
Live gateway
Counters for the synthetic tenant Northwind, read from this server's running gateway.
Try the policy engine
Pick a request an agent might make, or edit the JSON. The simulator runs the same decision chain the gateway uses (identity → task → tool → schema → resource → sequence → destination → rate → budget → risk) without executing anything. No model is consulted.
How it works
An AI agent never talks to a tool directly. Every call goes through the gateway, which answers ALLOW, ALLOW_WITH_LIMITS, REQUIRE_APPROVAL or DENY using fixed rules, in this order:
- IdentitySigned, short-lived token; signed request; no replayed nonce.
- TaskThe token is bound to one task. Expired or cancelled tasks stop here.
- ToolIs this tool allowed for this agent and this task, and is it enabled?
- SchemaExact arguments only. Unknown parameters are refused.
- ResourceThe repo, folder or ledger must be inside the task's scope, and in the agent's own tenant.
- SequenceReading a secret and then sending data out is blocked, even to an allowlisted host.
- DestinationAllowlisted hosts only, checked after DNS. Metadata IPs and private ranges are refused.
- RateA sudden burst is throttled, and a runaway agent is suspended.
- BudgetEach task has a cap on actions and requests.
- RiskCritical operations need an explicit grant and a human with the right role.
If the call is allowed, a proxy runs it and injects credentials server-side, so the agent never holds a secret. Known secrets are redacted from what comes back. Every decision goes into a keyed, hash-chained audit log, and serious ones open an incident and can suspend the agent and revoke its tokens.
All data here is mock-up data. Agents, tenants, repositories, invoices and credentials are synthetic, and the tools are simulated: nothing reaches GitHub, the internet or a real ledger.
Run a story live
Each story resets the demo, then plays a synthetic agent: the server signs each call as the agent would, and the real gateway decides.
Pick a story.
Full demo run
Output of python -m agentgate.demo.run: five scenarios, including prompt-injection exfiltration and a runaway agent.
Design decisions worth knowing
Sequence before allowlist
Reading .env then POSTing to an allowlisted host is still blocked, and the agent is suspended with its tokens revoked.
Critical ≠ needs approval
A critical op needs an explicit per-task grant and SECURITY_ADMIN approval. Without the grant it's denied outright.
Keyed audit chain
HMAC-keyed, so someone with DB write access can't recompute a plain SHA-256 chain after tampering.
Credentials stay server-side
The proxy injects secrets at execution time and redacts them from anything the agent or the audit log sees.
API
The demo API is open at /v1/… full reference in the API docs and interactive docs at /docs. Demo auth is an X-Demo-User header; production swaps this for OIDC. State is in memory and resets when the service restarts.
| Demo user | Role | Tenant |
|---|---|---|
USR-A-VWR | VIEWER | Northwind |
USR-A-ANL | ANALYST | Northwind |
USR-A-APR | APPROVER | Northwind |
USR-A-SEC | SECURITY_ADMIN | Northwind |
USR-A-OWN | OWNER | Northwind |
USR-B-SEC | SECURITY_ADMIN | Contoso |
