# preset AI Documentation
> Documentation for preset AI, the design system memory layer for AI coding tools.
Full documentation corpus : 46 pages. Each section below is a single page delimited by its URL header, with a structured metadata block preceding the body.
---
# preset AI · Documentation
Source: https://presetai.dev/docs/
Summary: Pick a path: scan a repo, set up enforcement, plug an AI tool in, or read about the memory layer.
Last updated: 2026-05-11
Related: Why the memory layer matters (https://presetai.dev/docs/memory-layer), Scan your repo (https://presetai.dev/docs/scan), Set up enforcement (https://presetai.dev/docs/enforce), Agent resources (https://presetai.dev/docs/agent-resources)
---
owner: jschuyler
updated: '2026-05-11'
status: stable
---
export const metadata = {
title: 'preset AI · Documentation',
description: 'Make AI fluent in your design system. The memory layer that teaches AI coding tools to follow your tokens, components, and patterns.',
summary: 'Pick a path: scan a repo, set up enforcement, plug an AI tool in, or read about the memory layer.',
last_updated: '2026-05-11',
related: ['/memory-layer', '/scan', '/enforce', '/agent-resources'],
}
export const sections = [
{ title: 'Choose where to start', id: 'choose-where-to-start' },
{ title: 'Recipes', id: 'recipes' },
]
Documentation
Make AI fluent in your design system.
The memory layer that teaches AI coding tools to follow your tokens, components, and patterns. Start with the Quickstart, or pick a path below that matches what you're trying to do.
{`# preset AI Documentation
> Documentation for preset AI, the
> design system memory layer for AI
> coding tools.
- [What is preset AI](/index.md):
Overview and core concepts.
- [The memory layer](/memory-layer.md):
Why longitudinal beats snapshot.
- [Scan your repo](/scan.md):
Run the scanner; review the output.
- [Set up enforcement](/enforce.md):
Install MCP; watch the first reject.
- [Agent resources](/agent-resources.md):
Every surface AI tools can read.`}
---
# Agent resources
Source: https://presetai.dev/docs/agent-resources
Type: reference
Summary: Every surface AI tools can read: MCP server, llms.txt, per-page markdown, copy-to-AI.
Last updated: 2026-05-11
Related: Set up enforcement (https://presetai.dev/docs/enforce), Why the memory layer matters (https://presetai.dev/docs/memory-layer)
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Agent resources',
description: 'Every way an AI tool can read preset AI: MCP server, llms.txt, per-page markdown, and one-click context handoff.',
type: 'reference',
summary: 'Every surface AI tools can read: MCP server, llms.txt, per-page markdown, copy-to-AI.',
last_updated: '2026-05-11',
related: ['/enforce', '/memory-layer'],
}
export const sections = [
{ title: 'MCP server', id: 'mcp-server' },
{ title: 'llms.txt and llms-full.txt', id: 'llmstxt-and-llms-fulltxt' },
{ title: 'Per-page markdown', id: 'per-page-markdown' },
{ title: 'Copy this page to AI', id: 'copy-this-page-to-ai' },
{ title: "What's next", id: 'whats-next' },
]
# Agent resources
preset AI is built to be read by AI tools, not just humans. This page lists every surface an agent can use: to query your memory layer, to ingest these docs, or to act on what it reads.
Pick the surface that matches what the agent is trying to do.
## MCP server
The Model Context Protocol server is the deepest surface. It lets an AI tool call into your live memory layer: list components, look up presets, validate generated code, read context rules at the moment of generation.
```bash
claude mcp add --transport http preset https://mcp.presetai.dev/mcp
```
For Cursor, Windsurf, VS Code Agent, and Zed, the install command differs per client. See [developers.presetai.dev](https://developers.presetai.dev/) for the full per-tool list.
The MCP server runs over OAuth: no config files, no API keys, no manual rotation. It's free on every plan.
Use MCP when the agent needs to **act** on your memory layer: generate code that matches your presets, validate against forbidden primitives, look up the current state of a token. Use the markdown surfaces below when the agent just needs to **read** these docs.
## llms.txt and llms-full.txt
For agents that ingest documentation as context, both files live at the root of this site:
- [`/llms.txt`](https://presetai.dev/docs/llms.txt): a manifest listing every page with a one-line summary. Compact. Use it for "give me a map" prompts.
- [`/llms-full.txt`](https://presetai.dev/docs/llms-full.txt): the full content of every page concatenated into a single payload. Drop the URL into any AI tool that supports remote context.
Both regenerate on request, so they stay in sync with the live MDX corpus. No build step.
```bash
curl https://presetai.dev/docs/llms-full.txt
```
## Per-page markdown
Every page on this site is also served as raw markdown: same path, `.md` suffix:
| Page | Markdown |
| ----------------------------- | --------------------------------- |
| `presetai.dev/docs/enforce` | `presetai.dev/docs/enforce.md` |
| `presetai.dev/docs/memory-layer`| `presetai.dev/docs/memory-layer.md` |
| `presetai.dev/docs/` (this index) | `presetai.dev/docs/index.md` |
The markdown view strips the chrome and leaves the prose and code blocks. Use it when you want to feed exactly one page to an agent: surgical context, not the whole site.
## Copy this page to AI
The button in the top-right of every desktop page handles the common case:
- **Copy as markdown**: copies the page's raw markdown to your clipboard, ready to paste into any AI tool.
- **Open in Claude**: opens a Claude conversation pre-filled with this page's URL.
- **Open in ChatGPT**: same, for ChatGPT.
Use it when you're reading something and want the agent to read along with you.
## What's next
---
# Connect an AI coding tool
Source: https://presetai.dev/docs/ai-coding-tools
Type: guide
Summary: One-line MCP install for each major AI coding tool. preset AI becomes the design-system runtime for the agent.
Last updated: 2026-05-12
Related: Agent resources (https://presetai.dev/docs/agent-resources), Set up enforcement (https://presetai.dev/docs/enforce)
Install: claude mcp add --transport http preset https://mcp.presetai.dev/mcp
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Connect an AI coding tool',
description: 'Give your AI coding assistant access to your design system via MCP. Per-tool install for Claude Code, Cursor, Copilot, Windsurf.',
type: 'guide',
summary: 'One-line MCP install for each major AI coding tool. preset AI becomes the design-system runtime for the agent.',
last_updated: '2026-05-12',
related: ['/agent-resources', '/enforce'],
install_command: 'claude mcp add --transport http preset https://mcp.presetai.dev/mcp',
}
export const sections = [
{ title: 'Pick a tool', id: 'pick-a-tool' },
{ title: 'Claude Code', id: 'claude-code' },
{ title: 'Cursor', id: 'cursor' },
{ title: 'GitHub Copilot', id: 'github-copilot' },
{ title: 'Windsurf', id: 'windsurf' },
{ title: 'What your AI can do', id: 'what-your-ai-can-do' },
{ title: 'Adaptive behavior', id: 'adaptive-behavior' },
{ title: 'Troubleshooting', id: 'troubleshooting' },
]
# Connect an AI coding tool
Give your AI coding assistant access to your design system. Once connected via MCP, the agent reads your tokens, presets, and patterns before it writes, and validates code against your rules after.
## Pick a tool
Every major AI coding tool that speaks MCP works with preset AI. The install is one line in each.
| Tool | Mode | Install |
|---|---|---|
| **Claude Code** | Terminal | `claude mcp add --transport http preset https://mcp.presetai.dev/mcp` |
| **Cursor** | Editor | Add via Settings → MCP, see below |
| **GitHub Copilot** | Editor (Agent Mode) | Via VS Code MCP settings |
| **Windsurf** | Editor | Via MCP plugin settings |
The MCP server runs over OAuth: no API keys to manage. Free on every plan.
For a tool-specific operating loop (what to prompt, when to validate, common pitfalls) see the per-tool pages linked from the sidebar.
## Claude Code
The fastest install. From any terminal:
```bash
claude mcp add --transport http preset https://mcp.presetai.dev/mcp
```
Verify the connection:
```bash
claude mcp list
```
You should see `preset` with status `connected`. See the [Claude Code guide](/ai-coding-tools/claude-code) for the recommended operating loop.
## Cursor
In Cursor, open **Settings → MCP**. Add a new server:
```json
{
"mcpServers": {
"preset": {
"url": "https://mcp.presetai.dev/mcp",
"type": "http"
}
}
}
```
Cursor will prompt you to authenticate via OAuth on first use. See the [Cursor guide](/ai-coding-tools/cursor) for the prompting template.
## GitHub Copilot
Copilot Agent Mode (VS Code) supports remote MCP servers. In VS Code, open **Settings → Copilot → Agent mode → MCP servers** and add:
```json
{
"preset": {
"url": "https://mcp.presetai.dev/mcp"
}
}
```
OAuth flow runs on first request. See the [Copilot guide](/ai-coding-tools/copilot) for the governance recommendations.
## Windsurf
In Windsurf, open the MCP settings panel and add:
```json
{
"mcpServers": {
"preset": {
"url": "https://mcp.presetai.dev/mcp"
}
}
}
```
OAuth on first use. See the [Windsurf guide](/ai-coding-tools/windsurf) for team operating rules.
## What your AI can do
Once connected, the agent gains these capabilities:
| Capability | Example prompt |
|---|---|
| **Search** | "Search for button presets." |
| **Suggest** | "What preset should I use for a delete action?" |
| **Generate** | "Generate a form with email and password inputs." |
| **Validate** | "Check this code for design system violations." |
| **Fix** | "Fix the violations in this component." |
| **Audit** | "Run a design system audit on this file." |
### Example conversations
**Finding the right component**:
> I need a dropdown for selecting a time period.
The agent uses `get_intent_route` and `get_preferred_component` to find the matching preset, then generates code using your design system.
**Checking your work**:
> Validate this component for design system compliance.
The agent uses `validate_generated_code` to check for violations and suggest fixes.
**Understanding constraints**:
> What should I avoid when building this form?
The agent uses `get_forbidden_primitives` and `get_anti_patterns` to explain which patterns are blocked.
## Adaptive behavior
The MCP server adapts to your design system's maturity:
| Mode | Behavior | Best for |
|---|---|---|
| **Generative** | Proposes new patterns; warns but doesn't block | Early-stage teams |
| **Hybrid** | Suggests existing patterns; warns on violations | Growing teams |
| **Enforcement** | Requires existing presets; blocks violations | Enterprise teams |
The mode is auto-detected from your preset count, token coverage, and other signals. Override with `set_system_mode`.
## Troubleshooting
### "Connection failed"
1. Confirm you're signed in to preset AI in your browser (OAuth state is shared)
2. Restart your AI tool after configuring MCP
3. Test the server directly: `curl https://mcp.presetai.dev/` returns a JSON health check (the `/mcp` path speaks MCP, not plain GET)
### "Tools not appearing"
1. Restart your AI tool after configuration
2. Check for JSON syntax errors in your config file
3. Confirm OAuth completed: first request opens a browser; you must approve
### "Gateway online but tools don't work"
1. The MCP server is healthy but tool calls may fail for other reasons
2. Check the specific error in the agent's reasoning trace
3. Ensure your design system has data (presets, tokens, components) to act on
## FAQ
### Do I need an API key?
No. The MCP server runs over OAuth: your AI tool authenticates once, and the memory layer becomes available immediately.
### Can I use multiple AI tools with the same account?
Yes. Every tool authenticates independently but reads from the same memory layer.
### Is my code sent to preset AI servers?
Only when you explicitly ask the AI to validate or audit code. MCP tools operate on the code snippets you provide, not your entire codebase.
### What MCP tools are available?
60+ tools across guardrails, discovery, generation, validation, typography, accessibility, Figma, and workflows. See [developers.presetai.dev](https://developers.presetai.dev) for the full reference.
---
# Claude Code with preset AI
Source: https://presetai.dev/docs/ai-coding-tools/claude-code
Type: guide
Summary: Operating loop for Claude Code: read context first, generate with constraints, validate, propose canonical changes.
Last updated: 2026-05-12
Prerequisites: Connect an AI coding tool (https://presetai.dev/docs/ai-coding-tools)
Related: Agent resources (https://presetai.dev/docs/agent-resources), Set up enforcement (https://presetai.dev/docs/enforce)
Install: claude mcp add --transport http preset https://mcp.presetai.dev/mcp
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Claude Code with preset AI',
description: 'Use Claude Code as a governed design-system runtime. The recommended operating loop: read context, generate within constraints, validate, propose.',
type: 'guide',
summary: 'Operating loop for Claude Code: read context first, generate with constraints, validate, propose canonical changes.',
last_updated: '2026-05-12',
prerequisites: ['/ai-coding-tools'],
related: ['/agent-resources', '/enforce'],
install_command: 'claude mcp add --transport http preset https://mcp.presetai.dev/mcp',
}
export const sections = [
{ title: 'Setup', id: 'setup' },
{ title: 'Recommended operating loop', id: 'recommended-operating-loop' },
{ title: 'Prompting pattern', id: 'prompting-pattern' },
{ title: 'Read, generate, apply', id: 'read-generate-apply' },
{ title: 'Common failure patterns', id: 'common-failure-patterns' },
{ title: 'Team policy', id: 'team-policy' },
]
# Claude Code with preset AI
Use Claude Code with preset AI as a governed design-system runtime.
## Setup
One command:
```bash
claude mcp add --transport http preset https://mcp.presetai.dev/mcp
```
OAuth runs on first request. Verify the connection:
```bash
claude mcp list
```
You should see `preset` with status `connected`. The full per-tool install matrix lives in [Connect an AI coding tool](/ai-coding-tools).
## Recommended operating loop
The four-step loop that keeps Claude Code aligned with the system:
1. **Read context first**: inspect relevant presets, patterns, and tokens; fetch active constraints for the target file or intent
2. **Generate with constraints**: request code by preset name and semantic intent; avoid hardcoded values and unapproved primitives
3. **Validate before and after**: run pre-generation checks when available; run generated-code validation and drift checks
4. **Propose before apply** (for system-level changes): for new or changed presets or rules, use the proposal lifecycle; apply only after validation and required approvals
## Prompting pattern
Structure your prompts like this:
- **Intent**: what you are building
- **Context**: target route or component, and constraints
- **Required artifacts**: preset names, token categories, patterns
- **Validation ask**: request drift and compliance checks before finalizing
Example:
> Build a destructive confirmation flow for account deletion. Use approved destructive presets, token-based colors, and the interaction rules from the design system. Validate generated code and report drift and compliance findings before final output.
## Read, generate, apply
### Read
- at the start of a task
- when uncertain about naming or policy
- when working in unfamiliar domains or components
### Generate
- only after retrieving required constraints or artifacts
- for implementation and refactor suggestions
### Apply
- direct apply for low-risk local code changes with passing validation
- proposal + approval path for canonical system artifacts
## Common failure patterns
- generating from generic UI patterns without querying preset AI first
- hardcoding style values where tokens exist
- skipping post-generation validation
- applying system-level changes without the proposal workflow
## Team policy
Adopt a simple policy:
- **No merge** without passing drift and compliance checks
- **No canonical model writes from AI** without a proposal trail
- **Require explicit approval** in stricter compliance modes
---
# GitHub Copilot with preset AI
Source: https://presetai.dev/docs/ai-coding-tools/copilot
Type: guide
Summary: Operating model for Copilot: gather context first, generate with intent-based constraints, validate, route canonical writes.
Last updated: 2026-05-12
Prerequisites: Connect an AI coding tool (https://presetai.dev/docs/ai-coding-tools)
Related: Claude Code with preset AI (https://presetai.dev/docs/ai-coding-tools/claude-code), Cursor with preset AI (https://presetai.dev/docs/ai-coding-tools/cursor)
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'GitHub Copilot with preset AI',
description: 'Keep Copilot outputs aligned with preset AI tokens, presets, and patterns while maintaining development speed.',
type: 'guide',
summary: 'Operating model for Copilot: gather context first, generate with intent-based constraints, validate, route canonical writes.',
last_updated: '2026-05-12',
prerequisites: ['/ai-coding-tools'],
related: ['/ai-coding-tools/claude-code', '/ai-coding-tools/cursor'],
}
export const sections = [
{ title: 'Setup', id: 'setup' },
{ title: 'Operating model', id: 'operating-model' },
{ title: 'Prompting guidance', id: 'prompting-guidance' },
{ title: 'Governance', id: 'governance' },
{ title: 'Common pitfalls', id: 'common-pitfalls' },
]
# GitHub Copilot with preset AI
Keep Copilot outputs aligned with preset AI tokens, presets, and patterns while maintaining development speed.
## Setup
GitHub Copilot Agent Mode (VS Code) supports remote MCP servers. In VS Code, open **Settings → Copilot → Agent mode → MCP servers** and add:
```json
{
"preset": {
"url": "https://mcp.presetai.dev/mcp"
}
}
```
OAuth runs on first request. See [Connect an AI coding tool](/ai-coding-tools) for the full install matrix.
Standard Copilot inline completions don't consume MCP. Use Agent Mode for governed generation against your design system.
## Operating model
Use Copilot as a coding accelerator, with preset AI as the policy and system-intelligence layer.
Recommended flow:
1. Gather preset AI context first (presets, tokens, pattern guidance)
2. Generate with intent-based constraints
3. Validate generated output with drift and compliance checks
4. Route system-level changes through the proposal lifecycle
## Prompting guidance
When requesting code, include:
- intended component behavior
- required preset names
- token usage requirements
- validation expectation before final merge
Example:
> Generate a settings card using approved presets and semantic tokens only. Include accessible interaction states and avoid hardcoded styles.
## Governance
- enable PR checks for drift and policy validation
- require explicit approval for canonical model writes
- track recurring violation patterns to refine rules
## Common pitfalls
- accepting quick suggestions that bypass semantic presets
- copying generated code without a validation pass
- mixing local style overrides that create drift
---
# Cursor with preset AI
Source: https://presetai.dev/docs/ai-coding-tools/cursor
Type: guide
Summary: Operating workflow for Cursor: discover context, generate within constraints, validate, govern canonical writes.
Last updated: 2026-05-12
Prerequisites: Connect an AI coding tool (https://presetai.dev/docs/ai-coding-tools)
Related: Claude Code with preset AI (https://presetai.dev/docs/ai-coding-tools/claude-code), Agent resources (https://presetai.dev/docs/agent-resources)
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Cursor with preset AI',
description: 'Run Cursor with preset AI as a constrained design-system context source. Discover, generate within constraints, validate, govern.',
type: 'guide',
summary: 'Operating workflow for Cursor: discover context, generate within constraints, validate, govern canonical writes.',
last_updated: '2026-05-12',
prerequisites: ['/ai-coding-tools'],
related: ['/ai-coding-tools/claude-code', '/agent-resources'],
}
export const sections = [
{ title: 'Setup', id: 'setup' },
{ title: 'Recommended Cursor workflow', id: 'recommended-cursor-workflow' },
{ title: 'Prompting template', id: 'prompting-template' },
{ title: 'Common mistakes', id: 'common-mistakes' },
{ title: 'Team policy', id: 'team-policy' },
]
# Cursor with preset AI
Generate and edit UI in Cursor while preserving preset AI alignment by default.
## Setup
In Cursor, open **Settings → MCP** and add:
```json
{
"mcpServers": {
"preset": {
"url": "https://mcp.presetai.dev/mcp",
"type": "http"
}
}
}
```
OAuth runs on first request. Verify MCP server connectivity before coding sessions. The full per-tool install matrix lives in [Connect an AI coding tool](/ai-coding-tools).
## Recommended Cursor workflow
Four steps per task:
1. **Discover context first**: ask Cursor to fetch relevant presets, patterns, and token guidance; retrieve active constraints for the target task
2. **Generate within constraints**: request intent-based outputs using approved preset names; avoid raw style values and ad-hoc component decisions
3. **Validate and iterate**: run drift and validation checks after generation; apply suggested fixes before finalizing
4. **Govern writes**: for canonical system changes, route through the proposal lifecycle; avoid direct apply in stricter compliance modes without approvals
## Prompting template
Use a constrained prompt shape:
- task intent
- target file or surface
- required system artifacts
- validation requirement before final answer
Example:
> Implement a settings form using existing presets and semantic tokens. Validate for drift and compliance and show required fixes before final code.
## Common mistakes
- generating from generic framework defaults without a preset AI lookup
- accepting output without a validation pass
- hardcoding token-like values in component code
## Team policy
For teams using Cursor heavily:
- enforce PR drift checks
- require a proposal trail for system-level artifact changes
- review recurring violations to improve rules and guidance
---
# Windsurf with preset AI
Source: https://presetai.dev/docs/ai-coding-tools/windsurf
Type: guide
Summary: Operating workflow for Windsurf: retrieve context, generate within constraints, validate, govern canonical writes.
Last updated: 2026-05-12
Prerequisites: Connect an AI coding tool (https://presetai.dev/docs/ai-coding-tools)
Related: Claude Code with preset AI (https://presetai.dev/docs/ai-coding-tools/claude-code), Cursor with preset AI (https://presetai.dev/docs/ai-coding-tools/cursor), GitHub Copilot with preset AI (https://presetai.dev/docs/ai-coding-tools/copilot)
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Windsurf with preset AI',
description: 'Run Windsurf workflows with preset AI as the system constraint and governance source. Context, generation, validation, governed changes.',
type: 'guide',
summary: 'Operating workflow for Windsurf: retrieve context, generate within constraints, validate, govern canonical writes.',
last_updated: '2026-05-12',
prerequisites: ['/ai-coding-tools'],
related: ['/ai-coding-tools/claude-code', '/ai-coding-tools/cursor', '/ai-coding-tools/copilot'],
}
export const sections = [
{ title: 'Setup', id: 'setup' },
{ title: 'Recommended workflow', id: 'recommended-workflow' },
{ title: 'Team operating rules', id: 'team-operating-rules' },
{ title: 'Failure modes', id: 'failure-modes' },
]
# Windsurf with preset AI
Use Windsurf for high-velocity implementation while preserving design-system consistency and governance controls.
## Setup
In Windsurf, open the MCP settings panel and add:
```json
{
"mcpServers": {
"preset": {
"url": "https://mcp.presetai.dev/mcp"
}
}
}
```
OAuth runs on first request. See [Connect an AI coding tool](/ai-coding-tools) for the full install matrix.
## Recommended workflow
Four steps per task:
1. **Context retrieval**: fetch relevant presets, patterns, and token guidance; identify active constraints for the target surface
2. **Generation**: request intent-first UI output; require semantic token and preset usage
3. **Validation**: run drift and compliance checks; capture violations and remediation before merge
4. **Governed changes**: for system-level artifact updates, use propose → validate → apply; require approvals based on current compliance mode
## Team operating rules
- no production merge without automated drift and compliance checks
- no direct system-artifact apply from AI without an approval path in stricter modes
- maintain auditability of major AI-generated changes
## Failure modes
Watch for these:
- pattern drift introduced by convenience refactors
- token bypass through local literals
- unreviewed proposal application
---
# Active guardrails
Source: https://presetai.dev/docs/compliance/active-guardrails
Type: guide
Summary: Active guardrails combine pre-generation constraints, post-generation validation, and policy gates before apply: a controlled loop instead of ad-hoc assistant behavior.
Last updated: 2026-05-12
Related: Rule model (https://presetai.dev/docs/compliance/rule-model), Validation and confidence (https://presetai.dev/docs/compliance/validation-and-confidence), Set up enforcement (https://presetai.dev/docs/enforce)
---
owner: jschuyler
updated: '2026-05-12'
status: stable
---
export const metadata = {
title: 'Active guardrails',
description: 'How preset AI moves from passive guidance to active constraint enforcement for AI workflows.',
type: 'guide',
summary: 'Active guardrails combine pre-generation constraints, post-generation validation, and policy gates before apply: a controlled loop instead of ad-hoc assistant behavior.',
last_updated: '2026-05-12',
related: ['/compliance/rule-model', '/compliance/validation-and-confidence', '/enforce'],
}
export const sections = [
{ title: 'Objective', id: 'objective' },
{ title: 'Guardrail model', id: 'guardrail-model' },
{ title: 'Core guardrail layers', id: 'core-guardrail-layers' },
{ title: 'Expected outcomes', id: 'expected-outcomes' },
{ title: 'Integration guidance', id: 'integration-guidance' },
{ title: 'Relationship to compliance modes', id: 'relationship-to-compliance-modes' },
]
# Active guardrails
How preset AI moves from passive guidance to active constraint enforcement for AI workflows.
## Objective
Ensure AI-generated output is system-aligned by design, not corrected after drift appears.
## Guardrail model
Active guardrails combine three moments:
- **Constraints before generation**: the agent reads what's allowed before writing
- **Validation after generation**: generated code is checked against rules
- **Policy gates before apply**: canonical writes are gated on approval
Together these create a controlled loop instead of ad-hoc assistant behavior.
## Core guardrail layers
1. Forbidden primitives and anti-pattern constraints
2. Context-aware active constraints by file, intent, or surface
3. Pre-generation validation checks
4. Post-generation code validation and drift checks
5. Mode-aware apply policy gates
## Expected outcomes
- lower cleanup work after AI generation
- fewer policy violations entering PRs
- more predictable assistant behavior across teams
## Integration guidance
Use guardrails as the default policy in AI-assisted coding flows:
- retrieve constraints first
- generate within constraints
- validate before commit or apply
- route unresolved cases into the proposal workflow
## Relationship to compliance modes
Each compliance mode tunes how strictly guardrails block versus advise:
- **Observe / Assist**: emphasis on guidance and learning
- **Guard / Enforce**: stricter blocking and approval requirements
See [Rule model](/compliance/rule-model) for the underlying rule contract and [Validation and confidence](/compliance/validation-and-confidence) for how guardrail results feed scoring.
---
# Exceptions and escalation
Source: https://presetai.dev/docs/compliance/exceptions-and-escalation
Type: guide
Summary: Three exception levels (local, domain, system), explicit escalation triggers, and review cadence. No permanent exceptions by default.
Last updated: 2026-05-12
Related: Rule model (https://presetai.dev/docs/compliance/rule-model), Active guardrails (https://presetai.dev/docs/compliance/active-guardrails)
---
owner: jschuyler
updated: '2026-05-12'
status: stable
---
export const metadata = {
title: 'Exceptions and escalation',
description: 'How to handle policy exceptions without weakening governance. Controlled, traceable, and temporary by default.',
type: 'guide',
summary: 'Three exception levels (local, domain, system), explicit escalation triggers, and review cadence. No permanent exceptions by default.',
last_updated: '2026-05-12',
related: ['/compliance/rule-model', '/compliance/active-guardrails'],
}
export const sections = [
{ title: 'Principle', id: 'principle' },
{ title: 'Exception policy', id: 'exception-policy' },
{ title: 'Exception levels', id: 'exception-levels' },
{ title: 'Escalation triggers', id: 'escalation-triggers' },
{ title: 'Escalation path', id: 'escalation-path' },
{ title: 'AI-specific exception handling', id: 'ai-specific-exception-handling' },
{ title: 'Review cadence', id: 'review-cadence' },
{ title: 'Metrics to track', id: 'metrics-to-track' },
]
# Exceptions and escalation
How to handle policy exceptions without weakening governance.
## Principle
Exceptions should be controlled, traceable, and temporary.
## Exception policy
Every exception must include:
- **reason**: what's being exempted and why
- **owner**: who's accountable
- **scope**: what it applies to
- **expiry date**: when it must be re-reviewed
- **rollback or remediation plan**: how it gets cleaned up
No permanent exceptions by default.
## Exception levels
### Level 1: Local exception
- scoped to one artifact or file set
- short expiry
- no broad policy change
### Level 2: Domain exception
- scoped to a rule domain (for example, token-naming migration)
- steward approval required
- explicit impact tracking
### Level 3: System exception
- cross-domain or org-wide impact
- governance lead approval required
- mandatory review checkpoint
## Escalation triggers
Escalate when any of the following occur:
- repeated violations of the same rule category
- increasing exception count over time
- policy blocks critical delivery repeatedly
- security, accessibility, or compliance-critical rules violated
- conflicting ownership decisions
## Escalation path
1. Capture issue and context
2. Classify severity and blast radius
3. Assign governance owner
4. Choose immediate containment action
5. Decide rule adjustment, exception extension, or rejection
6. Document final decision and follow-up tasks
## AI-specific exception handling
For AI-generated changes:
- keep proposal artifacts when exceptions are requested
- require explicit human approval in Guard / Enforce modes
- log model, tool, and context for post-incident analysis
## Review cadence
Run exception reviews at minimum:
- **weekly** for active programs
- **monthly** for mature, stable systems
Review outcomes:
- remove expired exceptions
- convert recurring exceptions into updated policy
- tighten policy where exception abuse appears
## Metrics to track
- active exceptions by level
- expired exceptions not remediated
- repeat exceptions by rule
- time-to-resolution by severity
---
# Rule model
Source: https://presetai.dev/docs/compliance/rule-model
Type: reference
Summary: Rule shape, severity model, evaluation lifecycle, and quality criteria. The contract underneath every guardrail and validation check.
Last updated: 2026-05-12
Related: Active guardrails (https://presetai.dev/docs/compliance/active-guardrails), Validation and confidence (https://presetai.dev/docs/compliance/validation-and-confidence), Exceptions and escalation (https://presetai.dev/docs/compliance/exceptions-and-escalation)
---
owner: jschuyler
updated: '2026-05-12'
status: stable
---
export const metadata = {
title: 'Rule model',
description: 'How preset AI expresses, evaluates, and evolves enforceable system rules: the contract for guardrails, validation, and policy gates.',
type: 'reference',
summary: 'Rule shape, severity model, evaluation lifecycle, and quality criteria. The contract underneath every guardrail and validation check.',
last_updated: '2026-05-12',
related: ['/compliance/active-guardrails', '/compliance/validation-and-confidence', '/compliance/exceptions-and-escalation'],
}
export const sections = [
{ title: 'Why this exists', id: 'why-this-exists' },
{ title: 'Rule shape', id: 'rule-shape' },
{ title: 'Rule categories', id: 'rule-categories' },
{ title: 'Severity model', id: 'severity-model' },
{ title: 'Evaluation lifecycle', id: 'evaluation-lifecycle' },
{ title: 'Rule evolution', id: 'rule-evolution' },
{ title: 'Exceptions and overrides', id: 'exceptions-and-overrides' },
{ title: 'Rule outputs', id: 'rule-outputs' },
{ title: 'Rule quality criteria', id: 'rule-quality-criteria' },
]
# Rule model
Defines how preset AI expresses, evaluates, and evolves enforceable system rules.
## Why this exists
Rules are preset AI's enforcement layer. They convert design-system intent into machine-evaluable constraints for:
- product workflows
- CI and CLI checks
- MCP read/write governance
## Rule shape
At minimum, a rule encodes:
- **intent**: the behavior or outcome it governs
- **predicate**: the condition to evaluate
- **severity**: impact level when violated
- **scope**: where it applies (artifact, route, workspace, org)
- **guidance / fix**: how to remediate
## Rule categories
Common categories:
- token usage and naming
- preset usage and prop constraints
- pattern composition rules
- interaction and accessibility requirements
- AI generation and write constraints
## Severity model
Use consistent severity semantics:
- **info**: informational, no action required
- **warning**: should fix, doesn't block
- **error**: should fix, signals real problem
- **blocking**: policy-gated, must fix before merge or apply
Severity is mode-aware. Same rule, different teeth depending on whether you're in Observe, Assist, Guard, or Enforce.
## Evaluation lifecycle
Rules can be evaluated at multiple points:
- **pre-generation**: AI constraints
- **post-generation**: validate output
- **pre-apply**: proposal gate
- **CI / PR checks**
- **periodic health and audit scans**
## Rule evolution
Rules should evolve with system maturity:
- start descriptive (guidance-heavy)
- graduate to stricter enforcement when confidence is high
- track exception volume and false-positive rates
- sunset or split brittle rules
## Exceptions and overrides
Exceptions should be:
- explicit
- time-bounded
- owner-attributed
- auditable
Overrides should never silently disable baseline governance. See [Exceptions and escalation](/compliance/exceptions-and-escalation) for the full lifecycle.
## Rule outputs
Every evaluation should produce machine- and human-usable output:
- pass / fail result
- severity and scope
- violation location and context
- recommended fix path
## Rule quality criteria
A good rule is:
- **unambiguous**: one interpretation, no edge cases the author meant differently
- **testable**: outcome can be verified deterministically
- **scoped**: applies only where intended
- **explainable**: the violation message tells the reader what to do
- **stable**: doesn't flag false positives in typical development workflows
---
# Validation and confidence
Source: https://presetai.dev/docs/compliance/validation-and-confidence
Type: reference
Summary: Validation asks
Last updated: 2026-05-12
Related: Rule model (https://presetai.dev/docs/compliance/rule-model), Active guardrails (https://presetai.dev/docs/compliance/active-guardrails)
---
owner: jschuyler
updated: '2026-05-12'
status: stable
---
export const metadata = {
title: 'Validation and confidence',
description: 'How preset AI evaluates quality and determines trust levels for automated guidance and enforcement.',
type: 'reference',
summary: 'Validation asks "is the output correct?" Confidence asks "how reliable is our interpretation?" Together they tune how much automation is safe.',
last_updated: '2026-05-12',
related: ['/compliance/rule-model', '/compliance/active-guardrails'],
}
export const sections = [
{ title: 'Validation goals', id: 'validation-goals' },
{ title: 'Confidence goals', id: 'confidence-goals' },
{ title: 'Practical usage', id: 'practical-usage' },
{ title: 'Operational guidance', id: 'operational-guidance' },
]
# Validation and confidence
How preset AI evaluates quality and determines trust levels for automated guidance and enforcement.
## Validation goals
Validation should answer:
- Is the output structurally and semantically correct?
- How severe are detected issues?
- What fixes are safe and actionable?
## Confidence goals
Confidence should answer:
- How reliable is the system's interpretation or mapping?
- How much automation is safe at this stage?
- When should workflows require human review?
## Practical usage
Validation and confidence work together:
- **High validation confidence + low-risk scope** → faster apply paths
- **Low confidence or ambiguous findings** → proposal + review path
- **Repeated low-confidence zones** → improve taxonomy, rules, and metadata
## Operational guidance
Track and use:
- violation severity distribution
- false-positive and false-negative signals
- confidence trends by artifact type
- remediation latency
These should inform rule tuning and maturity-mode progression. See [Rule model](/compliance/rule-model) for the underlying rule contract and [Active guardrails](/compliance/active-guardrails) for how validation feeds the enforcement loop.
---
# Set up enforcement
Source: https://presetai.dev/docs/enforce
Type: guide
Summary: Install the MCP server and watch your first AI generation get redirected to a real preset.
Last updated: 2026-05-11
Prerequisites: Scan your repo (https://presetai.dev/docs/scan), Review what was extracted (https://presetai.dev/docs/extract)
Related: Agent resources (https://presetai.dev/docs/agent-resources)
Install: claude mcp add --transport http preset https://mcp.presetai.dev/mcp
---
owner: jschuyler
updated: '2026-06-19'
status: stable
---
export const metadata = {
title: 'Set up enforcement',
description: 'Connect an AI coding tool, install the enforcement layer, and watch your first rejection land.',
type: 'guide',
summary: 'Install the MCP server and watch your first AI generation get redirected to a real preset.',
last_updated: '2026-05-11',
prerequisites: ['/scan', '/extract'],
related: ['/agent-resources'],
install_command: 'claude mcp add --transport http preset https://mcp.presetai.dev/mcp',
}
export const sections = [
{ title: 'Pick a connection', id: 'pick-a-connection' },
{ title: 'Install the MCP server', id: 'install-the-mcp-server' },
{ title: 'Watch the first enforcement', id: 'watch-the-first-enforcement' },
{ title: 'Raise the bar over time', id: 'raise-the-bar-over-time' },
{ title: "What's next", id: 'whats-next' },
]
# Set up enforcement
Your memory layer exists. Every AI tool in your stack is still ignoring it. This step changes that.
## Pick a connection
preset AI exposes your memory layer to agents three ways. Pick the one that matches where you want enforcement to land:
- **MCP server**: for Claude Code, Cursor, Windsurf, VS Code Agent Mode, and Zed. Enforces at generation time. Recommended for most teams.
- **GitHub Action**: for PRs. Runs `preset validate` on every commit and posts a comment with violations and fixes. Good backstop even if some developers don't use MCP.
- **CLI pre-commit hook**: for individual machines. Catches violations before they leave the developer's laptop.
You can combine them. MCP for generation, GitHub Action for review, pre-commit as a belt-and-suspenders local gate.
## Install the MCP server
For Claude Code (most common):
```bash
claude mcp add --transport http preset https://mcp.presetai.dev/mcp
```
For Cursor, Windsurf, VS Code Agent, and Zed, see the [developer quickstarts](https://developers.presetai.dev/). Every client has its own one-command install.
The MCP server runs over OAuth: no config files, no API keys to rotate. Your AI tool authenticates once; the memory layer becomes available immediately.
## Watch the first enforcement
Open your AI tool and ask it to generate something your design system has a pattern for. A realistic first prompt:
> Generate a destructive confirmation dialog for the delete account flow.
A tool connected via MCP now sees your presets before it writes anything. You'll get a response that looks more like this:
> Using `btn.destructive-confirm` from your preset (matched at 94% confidence). It requires a confirmation dialog: I'll include that too.
Compare to the same prompt without preset AI, where the tool invents a button, guesses at a color, and calls the dialog whatever it felt like in the moment.
If the tool tries something forbidden, `