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

# Policies

> Use Attesso's closed, deterministic policy language to bound an action.

A policy is the deterministic set of constraints inside a mandate. Your backend translates end-user intent into this structure. Attesso does not evaluate prompts, scripts, or natural language.

```json theme={null}
{
  "version": "1",
  "action": "flight.book",
  "constraints": [
    { "path": "attributes.origin", "operator": "eq", "value": "AMS" },
    { "path": "attributes.destination", "operator": "in", "values": ["LIS", "JFK"] },
    {
      "path": "attributes.departureDate",
      "operator": "date_range",
      "on_or_after": "2026-08-01",
      "on_or_before": "2026-08-14"
    },
    { "path": "payment.amount", "operator": "max", "value": 15000 },
    { "path": "payment.currency", "operator": "eq", "value": "EUR" }
  ]
}
```

## Operators

| Operator     | Behavior                                             |
| ------------ | ---------------------------------------------------- |
| `eq`         | Exact JSON type and value equality                   |
| `in`         | Exact membership in an ordered set of allowed values |
| `max`        | Inclusive integer maximum                            |
| `date_range` | Inclusive range for full `YYYY-MM-DD` dates          |

Every constraint is combined with logical `AND`. Exactly one constraint may target each path.

## Exact evaluation

Policy v1 intentionally has no coercion, case folding, wildcard, regular expression, locale processing, timezone conversion, floating-point input, or Unicode normalization.

* A present value that violates a constraint produces `DENY`.
* Missing, incorrectly typed, or unsupported evaluable data produces `INDETERMINATE`.
* Both results are non-allow decisions and create no reservation.
* A different valid action name produces `DENY` without evaluating constraints from the other action domain.

## Payment authority

Payment authority is explicit and indivisible. A policy either:

* Contains no payment paths and can only authorize actions without `payment`, or
* Contains exactly one positive-integer `payment.amount` `max` and exactly one uppercase three-letter `payment.currency` `eq`

Amounts use integer minor units. For EUR, `14200` means EUR 142.00.

## Canonical digest

Attesso canonicalizes the validated policy with RFC 8785 and binds a domain-separated SHA-256 `policy_digest` to the mandate, approval, and evidence.

```text theme={null}
preimage = UTF8("attesso:policy:v1\n") || canonical_policy_bytes
digest   = "sha256:" || lowercase_hex(SHA-256(preimage))
```

<Tip>
  Preserve constraint and `in` value order. Array order is digest-significant even when it does not change evaluation semantics.
</Tip>
