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

# How Anafi works

> The trust model of Anafi in one page — who holds what, and what each party can do.

Anafi has three parts that a partner sees: the **wallet**, the **rule**, and the **permission**.

```mermaid theme={null}
flowchart LR
  O[Wallet owner] -- signs once --> R[Rule document]
  O -- grants --> P[On-chain permission]
  R --> A[Anafi]
  A -- each payment, inside the permission --> P
  P --> W[Owner's wallet pays]
```

## The wallet stays the owner's

The funds never leave the owner's wallet until a payment happens. Anafi holds no keys and has no account that holds user funds.

## The rule is private

The SDK encrypts a rule before it leaves the browser. Only Anafi's attested execution environment can read it. The chain stores a salted commitment to the rule, so anyone can check which rule is active, but nobody can read it from the chain.

## The permission limits every payment

Each payment goes through a permission contract that the owner enabled. The contract checks that the payment comes from the genuine Anafi service, and it rejects anything outside what the owner granted. Optional spend caps put a hard limit on each token per period.

## The owner can always leave

The owner can revoke the permission with one transaction from any wallet app. Revocation needs nothing from Anafi.

## Execution is verifiable

Anafi publishes proof on chain that the service which runs rules is the audited build. Any client can check this proof before it sends a rule.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.