Skip to main content
Version: v0.12.4

Agent Protocols

PEAC provides mappings for major agent communication protocols. Each mapping is a pure transform -- it takes protocol-specific input and produces a standardized PEAC extension object that you attach to a receipt.

Supported protocols

ProtocolPackageDescriptionStatus
MCP@peac/mappings-mcpModel Context Protocol (tool calls, resources)Stable
ACP@peac/mappings-acpAgentic Commerce Protocol (commerce evidence)Stable
A2A@peac/mappings-a2aAgent-to-Agent metadata and Agent Card discovery (v1.0.0 compatible)Stable
TAP@peac/mappings-tapVisa Trusted Agent ProtocolStable
UCP@peac/mappings-ucpUniversal Commerce ProtocolStable
RSL@peac/mappings-rslRights Specification LanguageStable
AIPREF@peac/mappings-aiprefIETF AI Preferences vocabularyStable

MCP (Model Context Protocol)

Map MCP tool calls to PEAC receipts. The mapping captures tool identity, call arguments (hashed for privacy), result metadata, and timing information.

Terminal
pnpm add @peac/mappings-mcp
mcp-mapping.ts
import { fromMcpToolCall } from '@peac/mappings-mcp';

const evidence = fromMcpToolCall({
toolName: 'search',
toolServer: 'https://tools.example.com',
arguments: { query: 'AI safety' },
result: { hits: 42 },
});

The mapping extracts:

  • Tool identity -- tool name and server origin
  • Call arguments -- hashed by default for privacy
  • Result metadata -- response shape and size
  • Timing -- call duration and timestamps

MCP Server

The @peac/mcp-server package is a complete MCP server that exposes PEAC verification, inspection, and issuance as MCP tools. See the MCP Server guide for setup and usage.

ACP (Agentic Commerce Protocol)

Map ACP session lifecycle and payment observation events to PEAC receipts. The mapping enforces a strict two-function boundary: session lifecycle evidence is separate from payment observation evidence.

Terminal
pnpm add @peac/mappings-acp
acp-session.ts
import { fromACPSessionLifecycleEvent } from '@peac/mappings-acp';

// Session/access evidence only
const sessionEvidence = fromACPSessionLifecycleEvent({
sessionId: 'session_abc',
event: 'completed',
});
acp-payment.ts
import { fromACPPaymentObservation } from '@peac/mappings-acp';

// Commerce evidence requires explicit observed_payment_state
const paymentEvidence = fromACPPaymentObservation({
sessionId: 'session_abc',
observed_payment_state: 'settled',
});

A2A (Agent-to-Agent Protocol)

Carry verifiable evidence through A2A metadata in TaskStatus, Message, and Artifact objects. The mapping uses the Evidence Carrier Contract to attach receipt references and JWS signatures to A2A interactions. Compatible with A2A v1.0.0 and v0.3.0 via a dual-version transition normalizer.

Terminal
pnpm add @peac/mappings-a2a
a2a-mapping.ts
import { extractA2aCarrier, attachA2aCarrier } from '@peac/mappings-a2a';

// Attach evidence to an A2A artifact
const artifact = attachA2aCarrier(originalArtifact, {
receipt_ref: 'sha256:abc123...',
receipt_jws: 'eyJhbGciOiJFZERTQSIs...',
});

// Extract evidence from an A2A message
const carrier = extractA2aCarrier(incomingMessage);

Agent Card Discovery

A2A agents advertise PEAC support via the Agent Card capabilities.extensions array:

Agent Card (excerpt)
{
"capabilities": {
"extensions": [
"https://www.peacprotocol.org/ext/traceability/v1"
]
}
}

See the A2A integration page for the full discovery flow and metadata examples.

How mappings work

Pure transforms

Mappings are pure functions with no I/O, no side effects, and no dependencies on protocol SDKs. They take protocol-specific input and return a PEAC extension object. This makes them safe to run in any environment -- server, edge, or browser.

The data flows through three stages:

Mapping Data Flow
Protocol event
|
v
Mapping function (pure transform)
|
v
PEAC extension object
|
v
Receipt (via issue or issueWire02)

Extension objects use reverse-DNS namespaced keys. In Wire 0.2, extensions are top-level under extensions:

Wire 0.2 Extension Object
{
"extensions": {
"org.peacprotocol/correlation": {
"trace_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"workflow_id": "mcp-tool-call-123"
}
}
}

Extension registry

PEAC maintains advisory registries for tool call metadata. These registries define standard vocabularies so that different implementations describe the same operations consistently.

  • toolcall_op_types -- types of tool call operations (read, write, execute, query, subscribe)
  • toolcall_resource_types -- types of resources accessed (api, database, file, network, compute)

See Registries for the full registry specification.