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.
rules:
- match:
purpose: [crawl, index]
allow: true
require:
attribution: true
- match:
purpose: train
allow: falseWhy 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.
Four standard purposes for agent interactions
The CAL defines a unified vocabulary for describing what agents intend to do with your content.
crawlWeb crawling and scraping operations
indexSearch engine indexing
trainAI model training data collection
inferenceAI 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.
Match conditions
Define which requests this rule applies to based on purpose and subject type.
Allow or deny
Specify whether matching requests should be allowed or denied.
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: truePowerful CLI tools
Policy Kit integrates with the PEAC CLI for validation, explanation, and artifact generation. Debug policy decisions before deployment.
peac policy initpeac policy validatepeac policy explainpeac policy generate# 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 publicGenerated 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 summaryProgrammatic Evaluation
Use the Policy Kit library to evaluate policies at runtime. Deterministic first-match-wins semantics ensure consistent behavior.
Evaluation Result
true0{ 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.
Install the CLI
pnpm add -g @peac/cli
Initialize a policy
peac policy init
Generate artifacts
peac policy generate policy.yaml --out public
Requires Node.js 20 or newer
View full documentationReady to simplify your policy management?
Join early adopters using Policy Kit to manage agent access control.