Hosted agent
How a hosted agent is created, funded, paid from, and revoked.
Hosted agents change who you trust. px402 can sign payments within your caps and allowlist. While an agent’s session is warm, px402 holds its viewing keys and can read its balance and every payment.
Most hosted agents today use a Solana account in your own Turnkey sub-organization. px402 signs with a delegated key that Turnkey allows to sign for that one address only. The delegated key is held in AWS KMS.
Create and fund
- 01Your browser → TurnkeyEmail code or passkey. The session is for your own sub-organization.
- 02Your browser → TurnkeyThe agent's Solana account is made in your Turnkey wallet.
- 03Your browser → px402The web app registers the agent with px402, with its caps.
- 04Your browser → TurnkeyYou approve px402's delegated key for this agent.
- 05px402 → Turnkeypx402 checks the key can sign for that one address and nothing else. It repeats this each time it opens a session.
- 06px402 → TurnkeyOne signature gives px402 the agent's viewing keys.
- 07Your browser → TurnkeyYou sign a Rings deposit from your own account in the browser.
- 08Your browser → SolanaThe funds land in the agent private balance. A little SOL pays its fees. Both are public.
Funding is publicly linkable: a deposit carries the agent’s address in clear data, so anyone can tie your funding wallet to the agent.
Pay
- 01App or CLI → px402 walletThe app asks to pay one URL, with a new key for each intended payment.
- 02px402 walletA repeated key returns the earlier payment. Then: agent active, provider allowed, route payable, price, caps and rate. Nothing is signed until all pass.
- 03px402 walletThe cap reservation and allowlist are checked again in one database update.
- 04px402 wallet → Gatewaypx402 requests the route and gets the 402.
- 05px402 wallet → TurnkeyTurnkey signs, using the delegated key for this one address. The payment is recorded before it is broadcast.
- 06px402 wallet → SolanaThe same Rings transfer any agent makes.
- 07px402 wallet → GatewayThe gateway verifies and serves it like any other payment.
- 08px402 wallet → App or CLIThe provider response, or "pending" if the deadline passed after the transfer started.
- A lost answer: retry with the same idempotency key. A new key is a new payment.
pending: the transfer may have happened. Check history before doing anything else. The provider’s response is not kept.- Providers see every hosted call arrive from px402’s address.
Limits you control
| Action | Where | Needs a fresh sign-in |
|---|---|---|
| Lower a cap, remove a provider | Web app or connector | No |
| Raise a cap, add a provider | Web app only | Yes (adding a provider may ask) |
| Withdraw | Web app only, to a wallet you proved with a signature | Yes |
| Revoke | Web app or connector | No |
| Create an agent | Web app | Yes |
Revoking stops the agent for good and signs out every connected app of yours at once. A withdrawal is public and links the agent’s address to your wallet.
What you are trusting
- Whoever controls the px402 host could sign for every Turnkey-hosted agent, whatever Turnkey’s policies say.
- Reading is wider than spending under Turnkey’s access model. The details are in Turnkey and px402.
- px402 stores the agent’s address and its payments until 30 days after they settle.
Moving to TVC
A private preview runs an agent’s key and payment signing inside Turnkey Verifiable Cloud. See the TVC overview and how hosted payments move there.