<!--
Sitemap:
- [Newton Agent NeoBank](/index)
- [Getting Started](/getting-started)
- [Onboard an Agent](/guides/onboard-an-agent)
- [Give an Agent a Budget](/guides/agent-budget)
- [Pay for an API](/guides/pay-for-an-api)
- [Issue a Card](/guides/issue-a-card)
- [Meter Your API](/guides/meter-your-api)
- [SDK Essentials](/reference/sdk)
- [ModularVault](/reference/sdk/modular-vault)
- [PlatformClient](/reference/sdk/platform-client)
- [FacilitatorClient](/reference/sdk/facilitator-client)
- [createX402Fetch](/reference/sdk/create-x402-fetch)
- [buildPolicyParams](/reference/sdk/build-policy-params)
- [Networks & Addresses](/reference/networks)
-->

# buildPolicyParams

Turn a plain config into the policy params an agent's module enforces. You describe each agent's per-token limits and recipients; the helper produces the canonical, fail-closed policy.

```typescript
import { buildPolicyParams } from "@newton-xyz/isaac";

const params = buildPolicyParams({
  "0xAgent...": {
    "0x036CbD...": {
      max_daily_spend: 500_000_000, // 500 USDC at 6 decimals
      allowed_recipients: "0xApi1...,0xApi2...",
    },
  },
});
```

`buildPolicyParams(agents)` takes a map of agent address to a map of token address to its config, and returns params with `default_policy: "deny"` — any agent or token not listed is denied.

## Per-token config

| Field | Meaning |
|---|---|
| `max_daily_spend` | Cap per day in token base units. `0` means unlimited. |
| `allowed_recipients` | Comma-separated allowlist of recipient addresses. `"*"` allows any; `""` denies all. |
| `vendors` | Optional per-recipient caps (see below). |
| `verified_only_mode` | Optional. When `true`, restrict recipients to the `verified_recipients` set (the verified marketplace tier). |
| `verified_recipients` | Optional. The verified-tier recipient addresses (lowercased). |

```typescript
const params = buildPolicyParams({
  "0xAgent...": {
    "0x036CbD...": {
      max_daily_spend: 0, // unlimited daily total
      allowed_recipients: "*",
      vendors: {
        "0xApi1...": { max_per_tx: 1_000_000, max_daily_spend: 10_000_000 },
      },
    },
  },
});
```

`vendors` adds a per-recipient cap on top of the token-wide limit: `max_per_tx` bounds a single payment and `max_daily_spend` the cumulative daily total to that recipient.

## Applying it

Pass the result to the platform API or the SDK to register it for the agent:

```typescript
await platform.updatePolicyParams(vaultAddress, agentAddress, params);
```

## See also

* [Give an Agent a Budget](/guides/agent-budget) — the guided walkthrough.
* [PlatformClient](/reference/sdk/platform-client) — apply policy over HTTP.
