Testing Payments Safely
Before going to production, you need confidence that your agent integration handles every scenario — approved, denied, requires approval, insufficient balance, and more. This guide covers how to test each one safely on Tempo Testnet.Prerequisites
Why Tempo Testnet
| Tempo Testnet | Production (Base / Solana) | |
|---|---|---|
| Token | pathUSD (free) | USDC (real money) |
| Gas fees | None | Covered by Conto |
| On-chain | Yes — real blockchain transactions | Yes |
| Policies | Fully enforced | Fully enforced |
| Best for | Integration testing, policy validation | Live agent operations |
Test Plan
This guide walks through 5 scenarios that cover the core payment lifecycle:| # | Scenario | Expected Result |
|---|---|---|
| 1 | Simple payment under limits | APPROVED → execute → confirmed |
| 2 | Payment exceeding spend limit | DENIED |
| 3 | Payment requiring approval | REQUIRES_APPROVAL |
| 4 | Payment to blocked counterparty | DENIED |
| 5 | Payment outside time window | DENIED |
Setup: Create Test Policies
Create these policies to test against. If you already have policies from the quickstart, you can reuse or modify them.Policy: Spend Cap
Policy: Approval Threshold
Policy: Blocked Counterparty
Assign all three policies to your test agent in the Permissions tab.
Scenario 1: Approved Payment
A $5 payment — under all thresholds.- Response
statusis"APPROVED" - Execute it and confirm
txHashis returned - Check Transactions in the dashboard — status should be “Confirmed”
- Check Audit Logs — you should see the policy evaluation trail
Scenario 2: Denied by Spend Limit
A 25 cap.- Response
statusis"DENIED" violationsarray contains a message referencing the spend cap- The
requestIdexists but cannot be executed
Scenario 3: Requires Approval
A 25 cap but over the $15 approval threshold.- Response
statusis"REQUIRES_APPROVAL" - The payment appears in Pending Approvals in the dashboard
- A human can approve or reject it from the dashboard
- After approval, the agent can execute it
Scenario 4: Blocked Counterparty
A $5 payment to a blocked address.- Response
statusis"DENIED" violationsreference the blocked counterparty policy- Amount doesn’t matter — the address itself is blocked
Scenario 5: Time Window Restriction
To test time-based restrictions, temporarily add a time window policy:Create a time window policy
| Field | Value |
|---|---|
| Name | Test: Business Hours Only |
| Policy Type | TIME_RESTRICTION |
| Rule Type | TIME_WINDOW |
| Start Time | 09:00 |
| End Time | 17:00 |
| Timezone | Your timezone |
| Action | ALLOW |
Test outside the window
If it’s currently outside 9am-5pm in your timezone, any payment request will be denied with a time window violation.If it’s during business hours, you can temporarily set the window to a past range (e.g., 02:00-03:00) to trigger the denial.
Checking Results in Bulk
After running all scenarios, review everything in one place:Transactions Page
Go to Transactions in the dashboard. You should see:- Confirmed transactions from Scenario 1
- Denied/rejected entries from Scenarios 2, 4, 5
- A pending-approval entry from Scenario 3
Audit Logs
Go to Audit Logs to see the policy evaluation trail for every request. Each entry shows:- Which policies were evaluated
- Which rules matched
- The final decision and reasoning
Via API
Testing x402 Micropayments
If your agent uses x402 protocol payments (paying for APIs), test the pre-authorize → record flow:"authorized": true and the selected wallet.
Moving to Production
Once all 5 scenarios pass:- Create a production wallet on Base (USDC) or Solana (USDC)
- Fund it with real stablecoins
- Link it to your agent with production-appropriate limits
- Adjust policies for production thresholds (the test policies can remain as-is)
- Your integration code stays the same — no code changes needed
You can keep your testnet wallet and policies active alongside production. Many teams run test agents permanently for regression testing.
Troubleshooting
All scenarios return APPROVED (policies not enforcing)
All scenarios return APPROVED (policies not enforcing)
Check the Permissions tab on the agent detail page. Policies must be explicitly assigned to the agent. Creating a policy doesn’t automatically apply it.
DENIED but expected REQUIRES_APPROVAL
DENIED but expected REQUIRES_APPROVAL
Policies use AND logic — the most restrictive outcome wins. If one policy denies and another requires approval, denial takes priority. Check which policies are assigned and their rule values.
Time window tests pass when they shouldn't
Time window tests pass when they shouldn't
Double-check the timezone setting on the policy. If your local timezone doesn’t match the policy timezone, the enforcement window may be offset.
Execute returns INSUFFICIENT_BALANCE after approval
Execute returns INSUFFICIENT_BALANCE after approval
The wallet balance was sufficient at request time but dropped before execution. This can happen if other transactions executed between request and execute. Re-fund the testnet wallet.
Next Steps
Secure Your Agent
Production-ready policy configurations
Recipes
Copy-paste solutions for specific tasks
Error Handling
Handle every error code gracefully
Policy Reference
All policy types and rule operators