How it works
Self-held agent
Where the key lives and what limits spending when you run the agent.
- 01You → Agent machineA Solana key is created locally and encrypted under your passphrase.
- 02You → Solana + HeliusYou fund the agent address. This is public on chain.
- 03Agent machine → Solana + HeliusThe agent moves public USDC into its private balance. The deposit is public.
- 04You → Agent machineYou set per-request, daily and total caps, stored on this machine.
- 05Agent machine → px402 gatewayThe agent requests the route and gets a 402.
- 06Agent machine → Solana + HeliusThe agent signs and sends the transfer through your own Helius key.
- 07Agent machine → px402 gatewayThe agent proves it paid and gets the response.
What is on your disk
Everything is under $PX402_HOME/<profile>/ (by default ~/.px402/default/):
| File | What it is |
|---|---|
key.json | The key seed, encrypted with scrypt and AES-256-GCM |
caps.json | Your spending caps |
journal.sqlite | Every payment: reserved, submitted, served, rejected or released |
Back up key.json and remember the passphrase. px402 does not hold your key and cannot recover it.
What limits spending
| Limit | Set with | Checked |
|---|---|---|
| Highest price you accept | PX402_MAX_PRICE_BASE | Before reserving |
| Origins you may pay | PX402_ALLOWED_ORIGINS | Before reserving |
| Per request, rolling 24 hours, total | px402 caps set or PX402_CAP_*_BASE | In the same SQLite transaction that reserves the payment |
These caps protect you. They are enforced on your machine, so they are only as safe as that machine.
What px402 sees
Only the payments your agent makes to providers it serves. It never receives your key or your balance. Your RPC, indexer and prover traffic goes to Helius with your own API key.