> For the complete documentation index, see [llms.txt](https://rwapact.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rwapact.gitbook.io/whitepaper/security-and-risk-model/agent-authorization.md).

# Agent Authorization

## Agent Authorization

Knowing which Agent is acting is not the same as deciding whether that Agent may perform a specific trade. RWAPACT keeps identity, Session authorization, policy authorization, and final Pact authorization separate.

ERC-8004 provides agent identity and reputation registry context. KSO uses the Agent ID within its Session validation. A valid identity does not give an Agent unlimited authority.

### Authorization context

KSO evaluates the Session context that bounds delegated authority.

| Context                 | Role in authorization                                       |
| ----------------------- | ----------------------------------------------------------- |
| Agent ID                | Identifies the acting Agent and connects it to the Session. |
| Owner                   | Identifies the Session owner and revocation authority.      |
| Session ID              | Identifies the delegated Session.                           |
| Session start and end   | Define the Session's valid time range.                      |
| Budget and amount spent | Define the remaining permitted spend.                       |
| Asset scope             | Defines which assets the Agent may trade.                   |
| Maximum trade size      | Caps the amount of an individual trade.                     |
| Session status          | Indicates whether the Session can provide authority.        |

For Session validation to pass, the Session must be active and within its valid time range. It must match the expected Agent, cover the requested asset and trade size, remain within budget, and not be revoked.

### From identity to final authorization

Each layer answers a distinct question:

* **Identity:** Who is the Agent?
* **Session authorization:** Is this Agent currently authorized to act in this Session?
* **Policy authorization:** Is this specific trade allowed by the configured policy?
* **Final Pact authorization:** Have the required risk, Session, policy, and gas conditions passed?

KPV adds trade-level policy enforcement after the Session context is validated. It checks whether the asset and amount comply with the active Policy Version. The Pact authorizes execution only when KRO risk is below threshold, KSO validates the Session, KPV allows the trade, and KGR has an optimized gas path.

### Valid identity, rejected trade

An Agent has a valid ERC-8004 identity and an active Session. It attempts to purchase an asset outside its allowed asset scope.

The identity remains valid. The Session may still be active. KPV rejects the Trade Intent because the asset is not permitted by policy.

This layered model prevents identity from becoming unlimited execution authority. Final Authorization remains a Pact decision, not an identity check.

***


---

# 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://rwapact.gitbook.io/whitepaper/security-and-risk-model/agent-authorization.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.
