Prototype v1 · Open Source

N7 Mandate Clearing Protocol

Signed power of attorney for AI agents — machine-verifiable, rail-agnostic, liability-clear

01 — The Problem

Who is liable when the agent orders wrong?

AI agents purchase on behalf of humans. But who is liable when the agent orders wrong? Who checks the budget? Who stops a manipulated order? Today there is no standard for this.

⚖

Unclear Liability

No protocol defines who is responsible when an agent makes erroneous transactions.

🔒

No Budget Guard

Agents can act beyond the authorized budget — no on-chain check possible.

🎭

Prompt Injection Risk

A manipulated merchant can lure the agent into unauthorized purchases.

$0B
Agent Market 2028
0B
Active Agents (Gartner)
0
Liability Standards Today
02 — The Solution

A signed mandate — before every transaction.

👤
Principal
signs
📝
Mandate
authorizes
🤖
Agent acts
checks
🔍
Verifier
releases
💳
Payment Rail

A signed mandate defines exactly what the agent may do: which merchant, which category, which budget, how many orders, which time window. Before every charge, a verifier checks automatically — no transaction without valid authorization.

Liability Model
Situation Decision Liability
Mandate signature invalid REJECT None (never charge)
Agent not authorized / Attestation invalid / Replay REJECT Agent operator
Order outside constraints (budget, merchant, category) REJECT Agent operator
Order within constraints APPROVE Principal (normal purchase)
03 — Architecture

Three layers. One verifier.

From SDK to blockchain — the same verifier runs everywhere.

SDK

TypeScript SDK

Create, sign, verify mandates. Pure functions, no I/O. Runs in Node.js, Deno, browser and edge workers.

79 Tests
✓ Pure Functions
On-Chain

Solana / Anchor Program

Escrow, Ed25519 introspection, reputation tracking. PDA-based, no upgrade key after audit.

8 Attack tests
✓ Passed
Rail-Adapter

Payment Rail Adapter

x402 (HTTP-native), Google AP2, Mastercard Verifiable Intent, Visa TAP (planned). Same verifier, every rail.

3 Adapters Built · 79 Tests Passing
✓ x402 · AP2 · VI built
04 — Security

9 attack vectors tested.

🔑

Ed25519 Signatures

Principal, agent and merchant sign cryptographically. Forgery computationally impossible.

🛡

Instruction Introspection

On-chain CPI attacks blocked. The verifier checks the signature directly in the Ed25519 precompile.

♻

Replay Protection

Attestation hash prevents replay of intercepted transactions.

🔒

Prompt as Hash

No plaintext on chain or at the merchant. Only a SHA-256 hash as evidence.

💸

Budget Tracking

Cumulative budget across multiple orders. On-chain state, tamper-proof.

⏱

Time Window Enforcement

Mandates expire. No transaction possible outside the signed time window.

05 — Privacy

Why not send the prompt?

✗ Naive Approach

The prompt contains personal intentions, preferences and context. Sending it to the merchant or the blockchain would be a privacy disaster — personal data, purchase behavior and intentions would be permanently publicly accessible.

"Buy me coffee, I prefer roast X,
max budget €30, I drink it daily..."
✓ Agent Mandate Approach

Only a SHA-256 hash of the prompt is transmitted — as cryptographic evidence for disputes. The verifier checks constraints, not intentions. Privacy by design.

promptHash: "a3f7c2e1b8d4f6a9e2c5..."
06 — Live Demo

Interactive Prototype

Click one of the commands to test the verifier live.

mandate.json Valid
{
  "version":    "1.0",
  "mandateId": "mnd_7f3a9c2b",
  "principal": {
    "publicKey":    "Ed25519:4mXp...kR9z",
    "displayName": "Anna Müller"
  },
  "agent": {
    "publicKey": "Ed25519:9nQr...mL2w",
    "name":      "ShoppingAgent/v2"
  },
  "constraints": {
    "allowedMerchants":  ["merchant.kaffeeshop.at"],
    "allowedCategories": ["food_beverage", "grocery"],
    "budgetTotal":      50.00,
    "currency":         "EUR",
    "maxOrdersPerDay":  3,
    "validFrom":        "2026-10-20T00:00:00Z",
    "validUntil":       "2026-10-27T23:59:59Z"
  },
  "promptHash": "a3f7c2e1b8d4...",
  "signature":  "Ed25519:7xKm...4pNq"
}
order.json — Order Pending
{
  "orderId":     "ord_3a8f1c",
  "mandateId":   "mnd_7f3a9c2b",
  "merchant":    "merchant.kaffeeshop.at",
  "category":    "food_beverage",
  "amount":      18.50,
  "currency":    "EUR",
  "items": [{
    "name":  "Kaffee Speciality 250g",
    "qty":   1,
    "price": 18.50
  }],
  "budgetUsed":  0.00,
  "timestamp":   "2026-10-20T11:42:00Z",
  "attestation": "Ed25519:3zRt...8kWx"
}
$ verifier.verify
Waiting for verifier input...
Select a test mode above.
07 — Technical Details

Specification & Implementation

Mandate Schema
JSON Schema 2020-12
Canonical JSON
Keys recursively sorted, no whitespace, safe integers
Verifier
Pure function, no I/O, 18 violation codes
On-Chain
Anchor 0.30.1, Ed25519 Precompile, PDA-basiert
Signature Algorithm
Ed25519 (PKCS#8 + raw)
Test Coverage
79 tests (50 SDK · 7 x402 · 10 AP2 · 12 VI) · 8 attack tests on-chain
Prompt Hashing
SHA-256 (normalized UTF-8)
Payment Rails
x402 · Google AP2 · Mastercard VI · Visa TAP (planned)
Mandate Constraint Object
mandate.schema.json
"constraints": {
  "type":     "object",
  "required": ["budgetTotal", "currency", "validUntil"],
  "properties": {
    "allowedMerchants":  { "type": "array",  "items": { "type": "string" } },
    "allowedCategories": { "type": "array",  "items": { "type": "string" } },
    "budgetTotal":      {
      "type":             "number",
      "exclusiveMinimum": 0,
      "description":     "Max cumulative spend across all orders"
    },
    "currency":         { "type": "string",  "pattern": "^[A-Z]{3}$" },
    "maxOrdersPerDay":  { "type": "integer", "minimum": 1 },
    "validFrom":        { "type": "string",  "format": "date-time" },
    "validUntil":       { "type": "string",  "format": "date-time" }
  }
}