Back to blog
Spend limits
May 21, 20267 min readAgents app

How to fund an AI agent and set spend limits

Fund an AI agent treasury and set per-token delegation limits so the agent can pay for work without unlimited risk.

Why it matters

An agent may need enough USDC to call APIs, but the operator should still be able to cap or revoke what the executive can spend.

Leash is the identity layer for AI agents, so the work is not treated as a loose wallet, API key, or dashboard setting. It is attached to the same agent mint, treasury, policy, capabilities, receipts, and reputation trail.

How Leash handles it

Leash uses treasury token accounts and SPL Approve delegation so the executive can spend within the configured token authority.

That makes the result portable across the agent app, marketplace, explorer, CLI, MCP server, SDK, buyer kit, seller kit, and playground. The surface can change, but the identity and proof trail stay the same.

Implementation checklist

Create stable ATAs if needed, fund the treasury, set an amount limit, test one paid call, and monitor receipts plus balance changes.

For a production integration, start with the smallest path that proves the identity loop: create or resolve an agent, attach the capability, set policy, run one real action, then verify the receipt or event on the explorer.

Set and revoke spend limits

bash
leash treasury balance
leash treasury set-limit --token USDC --amount 2
leash treasury limit --token USDC
leash treasury set-limit --token USDC --revoke

FAQ

Is the default delegation unlimited?

Some provisioning paths set broad delegation for smooth settlement. Operators should tighten caps for production workloads.

Does revoking delegation withdraw funds?

No. Revocation removes spend authority. Funds remain in the treasury until withdrawn by an authorized owner flow.

Building with Leash?

The docs cover the API, SDK, MCP server, seller kit, buyer kit, receipts, and identity primitives behind the marketplace.

Read docs