Sidian Labs

MAP

Every action authorized. Every decision signed.

An open protocol that enforces policy, triggers human approvals and signs a receipt for every agent decision.

Released

How MAP works

Policy, handlers and receipts. No envelopes or tokens to hand-build.

  1. 1. map({ policy })

    Write rules as a JSON document that lives outside your code.

  2. 2. agent.can()

    Register a handler or built-in adapter for each capability.

  3. 3. agent.run()

    MAP checks policy: allow, require approval, or deny.

  4. 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

  1. 1Agent → MAPDispatchRequest · payment.execute $5,000
  2. 2MAPevaluate policy · payment.* amount_gt 1000
  3. 3MAP → Humanrequire approval · execution stops
  4. 4Human → MAPapprove() · or via webhook
  5. 5MAP → Adapterexecute · payments adapter
  6. 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..."

One install. One map() call.

Policy is a JSON document, hot-swappable at runtime.

WhenConditionDecision
payment.*amount over $1,000require approval
db.writeenv is productiondeny
*anything elseallow

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'

Excerpted 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.

Put a policy gate in front of every agent action.

$ npm install @sidianlabs/map