Test Payments & Policies
This guide walks through applying policies to your agent and running test transactions that verify they enforce correctly on Tempo Testnet.Prerequisites
Step 1: Create Test Policies
Create two policies to test different enforcement behaviors.Policy A: Spend Limit
Create the policy
Go to Policies → New Policy.
| Field | Value |
|---|---|
| Name | Test Spend Limit |
| Description | Deny transactions over $15 |
| Policy Type | SPEND_LIMIT |
Policy B: Approval Threshold
Create the policy
| Field | Value |
|---|---|
| Name | Test Approval Threshold |
| Description | Require approval for transactions over $10 |
| Policy Type | APPROVAL_THRESHOLD |
Step 2: Assign Policies to Agent
- Open your agent’s detail page
- Go to the Permissions tab
- Assign both “Test Spend Limit” and “Test Approval Threshold”
Step 3: Expected Behavior
With both policies active:| Amount | Result | Why |
|---|---|---|
| $5 | APPROVED | Under all thresholds |
| $12 | REQUIRES_APPROVAL | Exceeds 15 limit |
| $20 | DENIED | Exceeds $15 spend limit |
Step 4: Run Test Transactions
Test 1: $5 (Expect: APPROVED)
"status": "APPROVED" with "currency": "pathUSD"
Test 2: $12 (Expect: REQUIRES_APPROVAL)
"status": "REQUIRES_APPROVAL" with a violation message referencing the approval threshold.
Test 3: $20 (Expect: DENIED)
"status": "DENIED" with a violation referencing the spend limit.
Step 5: Execute an Approved Payment
If Test 1 returned APPROVED, execute it on Tempo Testnet:REQUEST_ID with the requestId from the response.
The response includes:
txHash— onchain transaction hash on Tempo TestnetexplorerUrl— link to view on explore.tempo.xyz
Step 6: Using the SDK
The same tests using the TypeScript SDK:Step 7: Verify in Dashboard
After executing a payment:- Go to Transactions in the dashboard
- Find your transaction — it should show status “Confirmed” with Tempo Testnet chain
- Click the explorer link to verify onchain
- Check Audit Logs to see the full policy evaluation trail
You’ve verified that policies enforce correctly and made a real onchain payment on Tempo Testnet.
Troubleshooting
All payments denied with 'per-transaction limit of $0'
All payments denied with 'per-transaction limit of $0'
The wallet-level per-transaction limit is set to
0. Edit the wallet limits on the agent detail page and set it to a non-zero value.Payment denied but expected REQUIRES_APPROVAL
Payment denied but expected REQUIRES_APPROVAL
Policies use AND logic. If one policy denies while another requires approval, the denial wins. Check the Permissions tab for all assigned policies.
INSUFFICIENT_BALANCE
INSUFFICIENT_BALANCE
Your testnet wallet needs funding. Use the Faucet button on the wallet detail page.
AUTH_FAILED
AUTH_FAILED
Invalid or expired SDK key. Generate a new one from the agent detail page.
Moving to Production
Once you’ve verified policies work on testnet:- Create a production wallet — Tempo Mainnet (pathUSD, no gas token needed), Base (USDC), or Solana (USDC)
- Fund it with real stablecoins
- Link the production wallet to your agent with appropriate limits
- Update or create production policies (the test policies can remain for reference)
- Your SDK integration code stays the same
Next Steps
SDK Payments Reference
Full SDK methods, parameters, and autoExecute
Policy Types
Explore all policy rule types
Error Handling
Handle payment errors gracefully
MCP Server
Connect via Claude MCP for natural language payments