---
title: "Pre-flight: store a policy decision for the agent wallet"
method: POST
path: "/v1/policy/evaluate-intent"
tags: ["Wallet Policy"]
---

# Pre-flight: store a policy decision for the agent wallet

`POST /v1/policy/evaluate-intent`

## Request

- Base URL: `https://api.prod.keyban.io`
- URL: `https://api.prod.keyban.io/v1/policy/evaluate-intent`
- Auth: API key in header `X-Api-Key`

Evaluates the payment against the wallet policy and stores the decision as an intent.

**Keyban welcome offer.** An agent declaring `capabilities: ["sponsored-x402"]` in the request may have an x402 payment paid by Keyban, when the organization offer covers it: only for the wallet that earned the offer (its first Base agent wallet), on the offer network, before expiry and for the whole price.

The response then carries `sponsored: true`: the envelope `from` is the Keyban sponsor wallet, not the agent wallet, and the agent must not sign it. It fetches the signature from `POST /v1/policy/intents/:id/sponsored-signature` once the intent is approved.

Without the capability, or when the offer does not cover the payment, `sponsored` is absent and the agent signs from its own wallet as usual.

## Request body

- PolicyInputDto
  - `channel` 'relay' | 'x402', required
  - `relay` object
    - `chainId` integer, required
    - `account` string, required
    - `nonce` string, required
    - `dest` string, required
    - `value` string, required
    - `data` string, required
  - `x402` object
    - `url` string, uri, required
    - `accountAddress` string, required
    - `maxValue` string
    - `chainId` integer
    - `method` string
    - `body` string
    - `headers` object
  - `clientHash` string
  - `capabilities` string[]

## Response `200`

- PolicyDecisionDto
  - `decision` 'allow' | 'deny' | 'require_human', required
  - `reasons` string[], required
  - `obligations` string[], required
  - `intentId` string, uuid
  - `x402Authorization` object
    - `network` string, required
    - `scheme` string, required
    - `x402Version` integer, required
    - `chainId` string, required
    - `asset` string, required
    - `primaryType` 'TransferWithAuthorization' | 'ReceiveWithAuthorization', required
    - `hash` string, required
    - `authorization` object, required
      - `from` string, required
      - `to` string, required
      - `value` string, required
      - `validAfter` string, required
      - `validBefore` string, required
      - `nonce` string, required
    - `accepted` object, required
      - `scheme` string, required
      - `network` string, required
      - `amount` string, required
      - `asset` string, required
      - `payTo` string, required
      - `maxTimeoutSeconds` integer, required
      - `extra` object
  - `sponsored` boolean

---

[API](https://skmtc.dev/keyban/apis/keyban-rest-apis.md) · [All operations](https://skmtc.dev/keyban/apis/keyban-rest-apis/llms.txt) · [OpenAPI document](https://skmtc.dev/keyban/apis/keyban-rest-apis/revisions/0bb79a1da961?raw)
