operator runbooks
Intended Documentation
Author a Policy
Guide for authoring Intended authorization policies safely, including YAML structure, validation, local testing, and review workflow.
Author a Policy#
This runbook walks you through authoring a Intended authorization policy from scratch. You will define the policy YAML, validate it against the schema, test it locally, and submit it for peer review before deployment.
Prerequisites#
Before you begin, make sure you have:
- The Intended CLI installed and authenticated (
meritt auth status) - Access to the workspace where the policy will be applied
- A local checkout of your organization's policy repository
Tip
Policies are version-controlled alongside your infrastructure. Always author policies in a feature branch and submit them through your standard review process.
Policy YAML Structure#
Every Intended policy is a YAML document that declares authorization constraints for AI execution. The top-level structure follows a strict schema.
Key Fields#
| Field | Required | Description |
|---|---|---|
apiVersion | Yes | Schema version, currently meritt.io/v1 |
kind | Yes | Must be Policy |
metadata.name | Yes | Unique identifier, lowercase with hyphens |
metadata.description | Yes | Human-readable purpose |
spec.scope | Yes | Environments and services this policy targets |
spec.rules | Yes | One or more authorization rules |
spec.fallback | Yes | Default effect when no rule matches: allow or deny |
spec.audit | No | Audit configuration for decision logging |
Warning
Always set fallback: deny for production policies. An open fallback in production creates an unaudited authorization gap.
Step 1: Scaffold the Policy#
Generate a policy skeleton
Use the CLI to scaffold a new policy file with the correct schema:
Edit the policy file
Open the generated file and fill in the spec.rules section. Each rule requires an action, an effect, and optional conditions.
Actions map to Intended execution verbs: deploy, invoke, read, write, delete, escalate.
Effects are either allow or deny.
Add conditions
Conditions constrain when a rule applies. Common condition types:
approval— require N approvals from specific rolestime-window— restrict to a time rangeidentity— match against caller identity attributesresource-tag— match resource labelstrust-level— require a minimum trust score
Step 2: Validate the Policy#
Run schema validation before committing. The validator checks structure, field types, and cross-references.
Danger
Never bypass validation errors. A malformed policy can fail open in the runtime, granting unintended authorization to AI execution.
Step 3: Test Locally#
Test the policy against recorded decision logs to verify it behaves as expected before pushing to the remote.
Warning
If match rate drops below 100%, investigate each mismatch before proceeding. Use --verbose to see which rule fired and why.
Step 4: Submit for Review#
Once validation and testing pass, commit and push your branch, then open a review request.
Commit the policy
Request policy review
Use the CLI to create a formal review request that notifies the required approvers:
Check review status
Common Mistakes#
| Mistake | Consequence | Fix |
|---|---|---|
Missing fallback field | Policy engine uses system default (may be allow) | Always set fallback: deny explicitly |
| Overlapping scopes | Conflicting rules cause unpredictable evaluation | Use meritt policy simulate to detect conflicts |
| Broad wildcard scopes | Unintended services affected | Scope to explicit service names for production |
| Skipping local test | Regression discovered in production | Always replay recent decision logs locally |
Next Steps#
- Simulate Impact — preview the effect of your policy before deployment
- Deploy and Rollback — deploy your reviewed policy to the runtime
- meritt policy CLI Reference — full CLI reference for policy commands