Skip to content

Add PEAC to A2A

Carry signed interaction records through A2A metadata on TaskStatus, Message, or Artifact objects.

Install

pnpm add @peac/protocol @peac/crypto @peac/schema

Attach a record to A2A metadata

import { issueWire02 } from '@peac/protocol'
import { generateKeypair } from '@peac/crypto'
import { computeReceiptRef } from '@peac/schema'

const { privateKey } = await generateKeypair()

// Issue a record for the A2A interaction
const { jws } = await issueWire02({
  iss: 'https://agent.example.com',
  kind: 'evidence',
  type: 'org.peacprotocol/access',
  pillars: ['access', 'attribution'],
  privateKey,
  kid: 'peac-2026-03',
})

const ref = computeReceiptRef(jws)

// Attach to A2A TaskStatus metadata
const taskStatus = {
  state: 'completed',
  metadata: {
    'https://peacprotocol.org/a2a': {
      carriers: [{
        receipt_jws: jws,
        receipt_ref: ref,
      }],
    },
  },
}

The @peac/mappings-a2a package provides type-safe helpers for embedding and extracting records from A2A metadata.