This guide shows how to combine Agent Kit (agents, MCP, wallets) with Warrant (policy before action). Pattern: wrap sensitive MCP tools (e.g. transfer) so warrant.check() runs first. On DENY, the tool never executes.

Who this is for

Teams building a chat agent that can move funds or call paid MCP tools, with spend rules enforced before execution.

Architecture

Two products, two keys

You still create the mandate with the application key. Runtime check() uses the mandate key.

Environment

WARRANT_AGENT_ID must match the agent_id on the sealed mandate (can differ from Agent Kit’s internal agent UUID).

Step 1 — Seal a mandate

Create a web3 mandate with rules (example: max $100, allowlisted USDC address). See SDK quickstart. Store the returned mandate.apiKey as WARRANT_MANDATE_API_KEY.

Step 2 — Wrap the MCP transfer tool

The idea: intercept transfer before it calls MCP.
On DENY, return a structured result to the LLM — do not call MCP.

Step 3 — Wire into your agent

Typical flow with Agent Kit:
  1. AgentKitClient + MCP client loads tools
  2. Convert MCP tools to AI SDK format
  3. wrapTransferWithWarrant(tools, { agentId })
  4. Pass wrapped tools to streamText() / your chat loop

Example project

Abstraxn ships a full example: abstraxn-agent-examples/examples/09-warrant-gated-transfer It includes:
  • Chat UI with Agent Kit
  • Warrant gate on transfer (lib/warrant-gate.ts)
  • Demo prompts for ALLOW and DENY

Demo prompts (after setup)

On DENY the agent explains verdict, reasons, and receipt_id — MCP never runs.

Extend to other tools

Same pattern for any irreversible MCP tool:
  1. Map tool args → Warrant NormalizedAction (domain, action_type, value, …)
  2. Call check() in the wrapper’s execute
  3. Only call the real tool on ALLOW
Examples: food order checkout, paid API paid_fetch, custom write tools.