Sign In

@peac/adapter-runtime-governance

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peac/adapter-runtime-governance

Runtime governance adapter for PEAC interaction records with AGT mapper

next
latest
Source
npmnpm
Version
0.16.4
Version published
Weekly downloads
241
569.44%
Maintainers
1
Weekly downloads
 
Created
Source

@peac/adapter-runtime-governance

Runtime governance adapter for PEAC interaction records. Records governance decisions, audit entries, authority scope changes, lifecycle transitions, trust signals, and compliance assessments as signed, portable Interaction Records.

Installation

pnpm add @peac/adapter-runtime-governance

What It Does

@peac/adapter-runtime-governance is a Layer 4 adapter that records runtime governance artifacts as signed, portable Interaction Records. It provides a generic runtime-governance surface with source-specific mappers. Microsoft AGT is the first mapper; the architecture supports additional mappers for other runtimes.

PEAC validates the structure and signature of the PEAC record, not the truth of the upstream governance decision or the operating effectiveness of the upstream control plane. PEAC does not verify upstream Merkle chain integrity or ML-DSA-65 signatures.

How Do I Use It?

Map and issue a governance record

import { generateKeypair, verifyLocal } from '@peac/protocol';
import { issueRuntimeGovernanceRecord, mapAgtEvent } from '@peac/adapter-runtime-governance';

const kp = await generateKeypair();

const event = mapAgtEvent({
  family: 'policy_decision',
  event: 'policy.evaluated',
  data: { action: 'allow', matched_rule: 'default-allow' },
  source: { system: 'microsoft-agt' },
});

const result = await issueRuntimeGovernanceRecord(event, {
  privateKey: kp.privateKey,
  kid: 'gov-key-1',
  issuer: 'https://governance.example.com',
  sessionId: 'sess-001',
  agentId: 'agent-001',
  provider: 'example-runtime', // caller-supplied, never hardcoded
});

const verification = await verifyLocal(result.jws, kp.publicKey);

Build a session summary

import { buildSessionSummary } from '@peac/adapter-runtime-governance';

const summary = buildSessionSummary([result.jws]);
// { sessionId, receipts: 1, families: ['policy_decision'], unknownTypeCount: 0, issuer }

buildSessionSummary() decodes JWS payloads to extract metadata but does not verify signatures. Callers must verify receipts first. Returns deterministic family ordering (sorted alphabetically) and counts unknown type URIs separately.

Record Families

FamilyType URIKind
Policy Decisionorg.peacprotocol/runtime-governance-policy-decisionevidence
Audit Entryorg.peacprotocol/runtime-governance-audit-entryevidence
Authority Scopeorg.peacprotocol/runtime-governance-authority-scopeevidence
Lifecycle Eventorg.peacprotocol/runtime-governance-lifecycle-eventevidence
Trust Observationorg.peacprotocol/runtime-governance-trust-observationevidence
Compliance Observationorg.peacprotocol/runtime-governance-compliance-observationevidence

Integrates With

  • @peac/protocol (Layer 3): Receipt issuance and local verification
  • @peac/crypto (Layer 2): JWS decode for session summary extraction
  • @peac/adapter-managed-agents: Managed agent event records (complementary adapter)

Design

  • Generic surface: Package named by concept, not vendor. AGT is the first mapper; future mappers can be added without changing the public API.
  • Vendor-neutral: Zero vendor SDK runtime dependencies. The provider field is always caller-supplied.
  • Layer 4: Depends on @peac/protocol and @peac/crypto only.
  • Evidence kind: All record families produce evidence kind Interaction Records.
  • Observational only: PEAC records what the upstream runtime reported; PEAC does not enforce, compute, or determine.
  • Fail-closed validation: Rejects malformed input with descriptive errors. Validates RFC 3339 timestamps, digest patterns, URI shapes, and numeric bounds.
  • Extension namespace: org.peacprotocol/runtime-governance with session_id, event, agent_id, provider fields plus family-specific payload.

For Agent Developers

If you are building an AI agent or MCP server that needs evidence receipts:

  • Start with @peac/mcp-server for a ready-to-use MCP tool server
  • Use @peac/protocol for programmatic receipt issuance and verification
  • See the llms.txt for a concise overview

License

Apache-2.0

PEAC Protocol is an open source project stewarded by Originary and community contributors.

Docs | GitHub | Originary

Keywords

peac

FAQs

Package last updated on 09 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts