> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inviolet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Define your intention policies

> Compose, test, and approve the policies that gate every grant.

An **intention policy** is the rule that decides what happens when an
agent declares an intention: allow, deny, route to a human approver, or
shadow-evaluate without taking action. This guide walks through the
compose / test / approve workflow that pairs with
[Define your first intention](/guides/define-your-first-intention).

<Note>
  Defining an intention creates the *what* (the elements an agent is
  allowed to touch). Defining a policy creates the *how* (when the
  match counts, who has to approve, what TTL the token gets).
</Note>

## 1. Compose the policy

App dashboard → **Policies** → **New policy**. Pick the intention you
want to gate and fill the form:

```yaml theme={"dark"}
policy_id: support_lookup_business_hours
intention_id: customer_support_lookup
match:
  identity_required: true
  user_groups: ["support-tier-1", "support-tier-2"]
  data_source_id: salesforce_prod
decision: allow
token_ttl_minutes: 5
approval_required: false
shadow_mode: true
```

Every field except `intention_id` and `decision` is optional. Defaults are
conservative — if you forget to set `identity_required`, the policy
will not match any anonymous traffic.

## 2. Test in shadow mode

`shadow_mode: true` means the policy evaluates on every matching tool
call but does not affect the outcome. The decision feed shows what
*would* have happened. Watch for one to two weeks.

The dashboard surfaces three numbers per shadow policy:

* **Match rate** — % of qualifying traffic the policy fires on
* **Would-deny rate** — fraction of matches that would have been blocked
* **Confidence drift** — how often the intent classifier was uncertain

If would-deny is above 5% on intended traffic, refine the match rule
before promoting.

## 3. Route through approval (optional)

For high-risk intentions (PII export, admin write), set
`approval_required: true`. The policy queues the call into Slack +
email. Approvers see the full intent context and can grant, deny, or
delegate.

## 4. Promote to live

Toggle `shadow_mode: false` (one click in the UI). The next matching
tool call gets a real allow / deny / approval decision written to the
audit log.

Promotion is reversible — if something looks wrong, flip back to
shadow within 30 seconds.

## Read next

* **[Six enforcement layers](/concepts/six-enforcement-layers)** — where
  policies actually run
* **[Mandates](/concepts/mandates)** — what the policy mints
  on approval
