> 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 settles it | cNFTs, TEE attestation, ERC-8004 identity, 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. The agent **submits proof** that it delivered, for example a repayment transaction or a link to a post.
4. The **Evaluator** checks that evidence through a **hook**, compares it 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>

The agent runs inside a trusted execution environment, and its attestation pins the exact code image it runs. Swapping the code changes the attestation, so anyone can see it.

## 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
