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

# Architecture

> Your agent writes on the author side. Fiet checks on the review side. Only the review side is trusted.

Every proposal crosses two sides. Your agent works on the **author side**. You approve on the **review side**. Nothing the author side says has to be trusted, because the review side works it out again.

## The two sides

| | Author side | Review side |
| - | - | - |
| Who uses it | Your agent | You, the signer |
| Where it runs | Wherever your agent runs | On Fiet, or on your own machines if you self-host |
| What it does | Fetches data, builds a preview of the plan and writes the intent | Fetches data again, builds the plan again, checks it, simulates it and serves the review |
| Trusted | No | Yes |
| Holds your keys | No | No. Your wallet signs. |

## What crosses over

Only the **intent** crosses from the author side to the review side. It is a data document that states:

* what may leave and what must arrive
* every address involved
* the deadline and the limits
* the agent's reasoning and the data it observed

No program crosses, so the review side never runs code your agent wrote. The agent's observations travel as claims to compare. The review side never builds from them.

## Three words

| Word | Meaning |
| - | - |
| Intent | What you want, written by your agent, with its bounds and reasoning. |
| Outcome | The balance changes you approve: the worst case the intent's bounds allow, shown by simulation. |
| Plan | The requests that carry out the intent. Both sides build it with the same code, so a different plan can only come from different data. |

You approve the outcome, not the route. Quotes and transaction data are fetched again before each step is sent.

## Two checks on the review side

| Check | Compares | Protects | If it fails |
| - | - | - | - |
| Bounds | The review side's fresh data against the intent | Your funds | The step is not sent |
| Agreement | The review side's data against what the agent observed | What the agent told you | A warning or a revision |

Facts about identity, such as addresses, decimals and chains, must match exactly. Market facts, such as prices, fees and rates, must match within a tolerance.

> [!NOTE]
>
> Both sides may read from the same provider, such as the Fiet API. The agreement check then catches stale, altered or wrongly cited data. It does not catch a provider that is wrong for both sides.

## Each request is sent at most once

Each approval is its own run. The review side records every request before it sends it. A request whose result is uncertain is never sent again, and two runs cannot count on the same balance.

## Who runs what

| Setup | Author side | Review side |
| - | - | - |
| Fiet | Runs with your agent | Fiet runs it for you |
| Self-hosted | You run it | You run it and secure it |

Fiet runs on [Value-as-Code](https://docs.fiet.finance/open-source/overview.md), which is open source. Your agent can download the author side and read exactly what runs beside it, and you can [run both sides yourself](https://docs.fiet.finance/open-source/run-locally.md).


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