MAP
Every action authorized. Every decision signed.
An open protocol that enforces policy, triggers human approvals and signs a receipt for every agent decision.
How MAP works
Policy, handlers and receipts. No envelopes or tokens to hand-build.
1. map({ policy })
Write rules as a JSON document that lives outside your code.
2. agent.can()
Register a handler or built-in adapter for each capability.
3. agent.run()
MAP checks policy: allow, require approval, or deny.
4. result.receipt
Every decision returns a signed, tamper-evident receipt.
Allow. Require approval. Deny.
Every agent action is checked against policy before it runs.
One gated payment, step by step
- 1Agent → MAPDispatchRequest · payment.execute $5,000
- 2MAPevaluate policy · payment.* amount_gt 1000
- 3MAP → Humanrequire approval · execution stops
- 4Human → MAPapprove() · or via webhook
- 5MAP → Adapterexecute · payments adapter
- 6MAPsign and log receipt · typ MAPSIG
allow
Runs through built-in adapters: HTTP, payments, db.read.
require approval
Execution stops until a human approves.
deny
Blocked immediately; nothing executes.
Every path ends in a signed receipt.
HS256/RS256 JWS, typ MAPSIG, with operator-managed keys.
Receipt
- action_taken
- "npm.publish"
- policy_checks
- ["strict-release-gate"]
- approval_used
- "approval_998"
- signature
- "eyJhbGciOiJIUzI1NiIs..."
| When | Condition | Decision |
|---|---|---|
| payment.* | amount over $1,000 | require approval |
| db.write | env is production | deny |
| * | anything else | allow |
Run it where your agents run.
In-process as a library, or as an HTTP server in front of every agent.
npm install @sidianlabs/map
import { map } from '@sidianlabs/map';
const agent = map({
policy: [
// Payments: require approval above $1000
{ when: 'payment.*', amount_gt: 1000, require: 'approval' },
// Database: block all writes to production
{ when: 'db.write', env: 'production', require: 'deny' },
// Everything else: allow
{ when: '*', require: 'allow' },
],
});
agent.can('payment.execute', async (input) => {
return await stripe.charges.create({ amount: input.amount });
});
const result = await agent.run('payment.execute', {
amount: 5000,
currency: 'USD',
vendor_id: 'vendor_abc',
});
// result.status → 'executed' | 'denied' | 'approval_required'MAP_POLICY_PATH=./policy.json \
MAP_APPROVAL_WEBHOOK_URL=https://your-app.com/approvals \
MAP_SIGNING_SECRET=your-secret \
npm run dev:server
# Dispatch an intent
curl -X POST http://localhost:8787/dispatch \
-H "Content-Type: application/json" \
-d '{ "capability": "payment.execute", "envelope": { ... } }'
# Hot-swap policy
curl -X POST http://localhost:8787/policy -d @policy.json
# Query audit trail
curl http://localhost:8787/audit-events# Python (preview: source install today)
pip install -e packages/python# Go (preview: source package)
go get github.com/SidianLabs/micro-agent-protocol/packages/go/mapprotoExcerpted from the README.
Works with
- TypeScript
- Python (preview)
- Go (preview)
- Any HTTP client
- Stripe-compatible payments
- PostgreSQL reads
- Webhook approvals
Sub-millisecond policy evaluation.
~1 µs
policy eval, 5 rules (synthetic)
~20 µs
policy eval, 100 rules
~4 µs
full execution, no I/O
~6 µs
policy hot-swap
One reference. Two previews.
Conformance program defined; no implementations certified yet. Not a compliance certification.
- TypeScript13/15Released
- Python12/15Preview
- Go9/15Preview
Read the source.
Part of one research program.
Declare, authorize, enforce and prove: three layers of one design for boundary control. They are not yet integrated at runtime.
Questions, answered honestly.
Does MAP stop prompt injection?
No. MAP evaluates the action an agent proposes; it does not inspect or sanitize the request that produced it.
Does it govern every action my agent takes?
Only actions routed through a registered adapter with a policy rule. Anything the host runs outside MAP is not gated or receipted.
Are receipts verifiable after a restart?
Only with a persistent signing key. The default HMAC key is ephemeral, so configure your own key for production.
What happens to pending approvals if the process restarts?
The core wrapper holds them in memory, so a restart drops them. Production deployments need a durable approval backend.
Does MAP make me EU AI Act compliant?
No. It records tamper-evident audit artifacts that may support audit-trail requirements; it is not a compliance certification.
How real are the benchmark numbers?
They are synthetic no-I/O microbenchmarks that exclude HTTP, signing and persistence. End-to-end dispatch is slower.