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: [search, 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.
Seven standard purposes for agent interactions
The CAL defines a unified vocabulary for describing what agents intend to do with your content.
trainAI model training data collection
searchTraditional search operations
user_actionUser-initiated actions and requests
inferenceAI inference and generation
indexSearch engine and AI indexing
Publisher Playbooks
Pre-built policy profiles for common publisher scenarios. Start with a template and customize for your needs.
News Site
Optimized for news publishers with time-sensitive content
indexsearchopenBlog / Personal
Simple setup for bloggers and personal sites
indexsearchinferenceopenAPI Provider
For commercial APIs with rate limits and payments
inferencepay_per_crawlResearch Portal
Academic and research institutions with citation requirements
indexinferencesubscriptionUse a profile template
Initialize your policy with a pre-configured profile. Customize rules, attribution formats, and licensing modes to match your requirements.
# Initialize with a profile peac policy init --profile news-site # Or choose interactively peac policy init --interactive # Generate from profile peac policy generate --profile blog
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: [search, 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 index --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: 'index',
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.