Checkpoint Docs
Govern

Proof Verification

Verify MCP-I cryptographic proofs from AI agents

What Are MCP-I Proofs?

An MCP-I (Model Context Protocol with Identity) proof is a cryptographic assertion that an AI agent attaches to every request. It proves:

  1. Identity — The agent is who it claims to be (verified via DID)
  2. Authorization — The agent has a valid delegation for the requested action
  3. Freshness — The proof was recently created and hasn't been replayed

Proofs are signed with the agent's private key and verified by Checkpoint's infrastructure.

Proof Structure

An MCP-I proof consists of three parts (JWS Compact Serialization):

{
  "protected": {
    "alg": "EdDSA",
    "typ": "JWT"
  },
  "payload": {
    "sub": "did:key:z6Mk...",
    "aud": "https://api.example.com",
    "iat": 1706745600,
    "exp": 1706749200,
    "nonce": "random-unique-nonce",
    "delegationRef": "del_abc123",
    "scopeId": "files:write"
  },
  "signature": "<ed25519-signature>"
}
FieldDescription
subAgent DID (Decentralized Identifier)
audTarget API audience
iatIssued-at timestamp
expExpiration timestamp
nonceUnique value to prevent replay attacks
delegationRefReference to the authorizing delegation
scopeIdSpecific scope being exercised

Server-Side Verification

Using the Middleware

The recommended approach is @kya-os/bouncer-middleware, which handles proof extraction and verification automatically:

import express from 'express';
import { createBouncerMiddleware } from '@kya-os/bouncer-middleware';

const app = express();
app.use(express.json());

// Protect an endpoint — proofs are verified automatically
app.post(
  '/api/files',
  createBouncerMiddleware({
    apiKey: process.env.CHECKPOINT_API_KEY!,
    projectId: process.env.CHECKPOINT_PROJECT_ID!,
    requiredScopes: ['files:write'],
    reputationThreshold: 60,
  }),
  (req, res) => {
    // Verified agent data is available on req.bouncer
    const { agentDid, scopes, reputation, delegation } = req.bouncer;

    console.log(`Agent ${agentDid} with reputation ${reputation}`);
    console.log(`Granted scopes: ${scopes.join(', ')}`);

    res.json({ message: 'File created', agent: agentDid });
  }
);

The middleware performs these steps:

  1. Extracts the proof from the X-MCP-Proof header
  2. Verifies the Ed25519 cryptographic signature
  3. Checks the proof hasn't expired
  4. Validates the referenced delegation with Checkpoint
  5. Enforces required scopes
  6. Checks agent reputation against the threshold
  7. Validates any delegation constraints (IP, origin, time)
  8. Attaches verified data to req.bouncer

Verified Request Data

After successful verification, req.bouncer contains:

interface BouncerRequest extends Request {
  bouncer: {
    /** Verified MCP-I proof payload */
    proof: MCPIProofPayload;

    /** Agent DID (Decentralized Identifier) */
    agentDid: string;

    /** Delegation information */
    delegation?: Delegation;

    /** Agent reputation score 0-100 */
    reputation?: number;

    /** Granted scopes from delegation */
    scopes: string[];
  };
}

How Agents Send Proofs

AI agents attach proofs via the X-MCP-Proof header:

curl -X POST https://api.example.com/api/files \
  -H "Content-Type: application/json" \
  -H "X-MCP-Proof: <base64url-encoded-proof>" \
  -d '{"filename": "report.txt", "content": "..."}'

Error Handling

When proof verification fails, the middleware returns a structured error:

{
  "error": {
    "code": "INSUFFICIENT_SCOPES",
    "message": "Required scopes: files:write. Granted: files:read",
    "details": {
      "required": ["files:write"],
      "granted": ["files:read"]
    }
  }
}

Error Codes

CodeHTTP StatusDescription
MISSING_PROOF401No X-MCP-Proof header provided
INVALID_PROOF400Malformed proof structure
EXPIRED_PROOF401Proof has passed its expiration time
INVALID_SIGNATURE401Ed25519 signature verification failed
DELEGATION_NOT_FOUND404Referenced delegation does not exist
DELEGATION_EXPIRED403Delegation has passed its expiration
DELEGATION_REVOKED403Delegation was explicitly revoked
INSUFFICIENT_SCOPES403Agent lacks required scopes
REPUTATION_TOO_LOW403Agent reputation below threshold
CONSTRAINT_VIOLATION403Delegation constraint not satisfied

All proof verification errors are logged to the Checkpoint dashboard under Project → Proofs for audit purposes.

Proof Lifecycle

1. Agent requests delegation (via OAuth or API)
2. Agent creates proof for a specific request
3. Proof is sent with the request (X-MCP-Proof header)
4. Middleware extracts and sends proof to Checkpoint
5. Checkpoint verifies signature, delegation, scopes, constraints
6. Result is returned to middleware
7. Request proceeds or is rejected
8. Verification event logged to dashboard

Proof Expiration

Proofs have a short TTL (typically 5 minutes) to prevent replay attacks. The iat and exp timestamps in the proof payload define the validity window. Each proof should include a unique nonce.

Monitoring Proofs

View proof verification activity in the Checkpoint dashboard:

  1. Navigate to Project → Proofs
  2. See recent verification attempts (success and failure)
  3. Filter by agent DID, error code, or time range
  4. Drill into individual verification events for debugging

Next Steps