> 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/the-five-layer-pact/kpv-policy-vault.md).

# KPV, Policy Vault

How KPV applies configurable, versioned trading policies across agents, owners, assets, risk limits, and execution constraints.

## KPV, Policy Vault

Session authorization and policy enforcement solve different problems. An agent can operate inside a valid session and still request a trade that the active policy does not allow.

KPV is the policy enforcement layer of the Five-Layer Pact. It evaluates every trade against configurable rules for the agent, owner, asset, and execution conditions.

### Policy structure

| Parameter                 | What it controls                                            |
| ------------------------- | ----------------------------------------------------------- |
| `agentId`                 | Identifies the agent to which the policy applies.           |
| `owner`                   | Identifies the policy owner.                                |
| `allowedAssets`           | Defines assets permitted by the policy.                     |
| `maxTradeSize`            | Limits the size of an individual trade.                     |
| `dailyLimit`              | Limits permitted trading over a day.                        |
| `maxConcentration`        | Limits concentration in the agent's portfolio.              |
| `maxSlippage`             | Limits acceptable estimated slippage.                       |
| `requireOracleFresh`      | Requires current oracle data when enabled.                  |
| `minLiquidity`            | Sets the minimum required liquidity.                        |
| `tradeOutsideMarketHours` | Controls whether trading outside market hours is permitted. |
| `riskScoreThreshold`      | Sets the maximum permitted KRO risk score.                  |

These parameters express the active policy context. They let policy distinguish a trade that is technically possible from one that meets the configured operating limits.

### Enforcement and versioning

Every trade is checked against the active policy. If any policy parameter is violated, the trade is rejected with a specific reason code.

Policies are versioned. Each policy change creates a new version. KAR includes the version hash in its attestation, preserving the policy configuration associated with the decision.

This makes the active policy part of the decision context. It does not imply legal compliance or governance guarantees beyond the specification.

### Session authority versus policy

KSO and KPV can both constrain a trade. They answer different authorization questions.

| KSO                    | KPV                     |
| ---------------------- | ----------------------- |
| Session authority      | Trading policy          |
| Time window            | Asset permissions       |
| Delegated budget       | Daily limit             |
| Session scope          | Risk constraints        |
| Per-session trade size | Policy-level trade size |
| Revocation status      | Policy version          |

KSO establishes whether the current delegation covers the action. KPV establishes whether the active policy permits it. The layers may overlap in some constraints, but neither replaces the other.

### Example: valid session, blocked policy

An agent requests a tokenized stock trade. Its session is active, has sufficient remaining budget, and includes the asset in scope.

The active policy sets a maximum KRO risk score of `50`. KRO returns `67`. KPV rejects the trade because the policy threshold is exceeded.

KAR records the policy version and rejection context. The example shows why a valid session does not automatically permit a trade.

### Policy evaluation

```
Trade Intent
  |
  v
Load Active Policy
  |
  v
Check Asset, Amount, Limits, and RWA Constraints
  |
  v
Check Risk Threshold
  |
  v
Policy Pass or Reject
  |
  v
Return Result to Pact
```

The flow shows the set of policy concerns. It does not prescribe a fixed internal evaluation order for every parameter.

### Scope of KPV

KPV answers one question:

> Does the requested trade comply with the active policy?

The next layer evaluates gas and execution-path conditions: [KGR, Gas Router](/whitepaper/the-five-layer-pact/kgr-gas-router.md).

***


---

# 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/the-five-layer-pact/kpv-policy-vault.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.
