New in v0.9.17

AI Policy Kit

Policy Kit (@peac/policy-kit) compiles one YAML policy to peac.txt, AIPREF headers, and other surfaces. Deterministic Control Abstraction Layer evaluation.

Why Policy Kit?

Define once, deploy everywhere. Stop maintaining multiple policy files.

Single Source of Truth

Define your access control policy once in YAML. Generate all output formats automatically.

Deterministic Evaluation

First-match-wins semantics ensure predictable, reproducible policy decisions every time.

Multi-Surface Output

Generate peac.txt, robots directives, AIPREF headers, and markdown docs from one policy.

Control Abstraction Layer

Four standard purposes for agent interactions

The CAL defines a unified vocabulary for describing what agents intend to do with your content.

crawl

Web crawling and scraping operations

index

Search engine indexing

train

AI model training data collection

inference

AI inference and generation

Policy Definition

Define your access control rules using the Control Abstraction Layer semantics. Rules are evaluated in order with first-match-wins semantics.

1

Match conditions

Define which requests this rule applies to based on purpose and subject type.

2

Allow or deny

Specify whether matching requests should be allowed or denied.

3

Requirements

Set conditions like attribution, receipts, or rate limits for allowed requests.

# policy.yaml - Policy Kit v0.1
schema: peac-policy/0.1
domain: yourdomain.com

# Control Abstraction Layer rules
rules:
  - match:
      purpose: [crawl, index]
      subject_type: agent
    allow: true
    require:
      attribution: true
      receipts: true

  - match:
      purpose: train
      subject_type: any
    allow: false
    reason: "Training requires explicit agreement"

  - match:
      purpose: inference
      subject_type: human
    allow: true
    require:
      attribution: optional

# Default rule (first-match-wins)
default:
  allow: false
  require:
    negotiation: true

# Output configuration
outputs:
  peac_txt: true
  robots_snippet: true
  aipref_headers: true
  ai_policy_md: true
Command Line Interface

Powerful CLI tools

Policy Kit integrates with the PEAC CLI for validation, explanation, and artifact generation. Debug policy decisions before deployment.

peac policy init
peac policy validate
peac policy explain
peac policy generate
Terminal
# Initialize a new policy
peac policy init

# Validate policy syntax and rules
peac policy validate policy.yaml

# Explain how a request would be evaluated
peac policy explain policy.yaml --purpose crawl --subject agent

# Generate all output artifacts
peac policy generate policy.yaml --out public

Generated Outputs

A single policy.yaml generates multiple output artifacts for different consumers.

peac.txt

Machine-readable policy for PEAC-aware agents

robots-ai.txt

AI-specific directives extending robots.txt

aipref-headers.json

HTTP headers for CDN/server configuration

ai-policy.md

Human-readable policy documentation

# Generated outputs from policy.yaml:

public/
  .well-known/
    peac.txt          # PEAC policy file
  robots-ai.txt       # AI-specific robots directives
  aipref-headers.json # Headers for CDN/server config
  ai-policy.md        # Human-readable policy summary

Programmatic Evaluation

Use the Policy Kit library to evaluate policies at runtime. Deterministic first-match-wins semantics ensure consistent behavior.

Evaluation Result

allowedtrue
rule_index0
requirements{ attribution, receipts }
import { evaluate } from '@peac/policy-kit'

const result = await evaluate(policy, {
  purpose: 'crawl',
  subject_type: 'agent',
  subject_id: 'googlebot'
})

// Result:
// {
//   allowed: true,
//   rule_index: 0,
//   requirements: { attribution: true, receipts: true }
// }

Quick Start

Get Policy Kit running in under a minute.

1

Install the CLI

pnpm add -g @peac/cli
2

Initialize a policy

peac policy init
3

Generate artifacts

peac policy generate policy.yaml --out public

Requires Node.js 20 or newer

View full documentation

Ready to simplify your policy management?

Join early adopters using Policy Kit to manage agent access control.