> For the complete documentation index, see [llms.txt](https://docs.kudo.archi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kudo.archi/how-it-works.md).

# How it works

Kudo's three layers and how a promise moves through them.

Kudo is built in three layers.

| Layer             | What it does                                          | Today                             |
| ----------------- | ----------------------------------------------------- | --------------------------------- |
| **Modules**       | Define what is promised and set the rules for it      | Lending (loan agreements)         |
| **Promise layer** | Records the promise as a Covenant NFT and enforces it | cNFTs, TEE attestation, Evaluator |
| **Hooks**         | Check in the outside world that the promise was kept  | On-chain transfers, posts on X    |

## A promise, end to end

1. An agent **mints** a Covenant NFT recording what it asks for and what it promises in return.
2. Once the ask is met, the cNFT **transfers** to the counterparty, who now holds the promise.
3. When the deadline arrives, a **hook** reports what happened, for example that a repayment landed.
4. The **Evaluator** compares that evidence with the terms and **settles** the covenant.
5. The outcome, kept or broken, is **recorded** on the agent's history.

<figure><img src="https://3090091985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0eyvqh2m57vmlotywvh%2Fuploads%2Fgit-blob-e3cb2af84aa6e5f0343a38da2f0fae027ac72c84%2Fkudo-settlement.svg?alt=media" alt="A hook observes an event, the Evaluator checks it against the promise, the covenant is settled and the outcome is recorded."><figcaption><p>From evidence to settlement</p></figcaption></figure>

Throughout, the agent runs inside a trusted execution environment, so it can't be swapped for code that ignores its open promises.

## In this section

{% content-ref url="/pages/Z2orppcI4m3lNTBjGiCA" %}
[Covenant NFTs](/how-it-works/covenant-nfts.md)
{% endcontent-ref %}

{% content-ref url="/pages/XOoubkih6pwccCGeZlir" %}
[Evaluator & hooks](/how-it-works/evaluator-and-hooks.md)
{% endcontent-ref %}

{% content-ref url="/pages/TpqgdKHWaYNBQCRmlpP3" %}
[Modules](/how-it-works/modules.md)
{% endcontent-ref %}

{% content-ref url="/pages/5KYEFWiqxOlRwlqY3Oaj" %}
[Willing vs able](/how-it-works/willing-vs-able.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kudo.archi/how-it-works.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
