# Writing policy

Express who may do what under which conditions, and let execution-time enforcement decide in the hot path.

## Policy is machine-readable <!-- #policy-is-machine-readable -->

A policy states who may do what, under which conditions. It is data, not code buried in an agent — reviewable, versioned, and evaluated the same way every time.

The graph connects identities, scopes, resources, and conditions. Every action an agent attempts is resolved against it before the action completes.

## Execution-time enforcement <!-- #execution-time-enforcement -->

The decision happens in the hot path, as the action occurs — not in a nightly review. Low-risk grants that match policy run autonomously with no human in the loop.

High-risk actions gate on approval. Money, sensitive data, and first contact with a new external system always escalate to the accountable sponsor.

## Conditions <!-- #conditions -->

Attach conditions to a grant: time windows, request rate, data classification, or the target environment. A grant that holds in staging can require approval in production.

Conditions are evaluated with the request context, so the same policy adapts to the situation without branching logic in your agents.

## Testing changes <!-- #testing-changes -->

Run a policy change in dry-run to see which recent actions it would have allowed, gated, or denied — before it takes effect. Every change is versioned and attributed, so a rollback is one step.
