Build on Gloam
Build a private agent
Give an AI agent private payments on Robinhood Chain, Tempo, Base, Ethereum, Elysium and BNB Chain. It holds, pays and gets paid with amounts and payees hidden, proves what it holds when asked, and signs under policy.
- SDK
- @gloamtrade/sdk
- Server
- @gloamtrade/mcp (MCP)
- Example
- examples/agent-shield
- Secrets
- server-side only
Why agents need this most
An agent paying on a public chain shows every payment: who it paid, how much and when, for anyone to read or copy. Agents pay often and in patterns, so they are easy to follow. With Gloam an agent holds, pays and gets paid with the amounts and payees hidden. Money going in and out of the vault stays public. Private swaps in the Gloam app hide who swapped, not the tokens or the amounts, and agents can't swap through the SDK or the MCP server yet.
Two ways in
Both speak the same intent shape, so a plan an app builds and a plan an agent builds are the same object.
- Directly via
@gloamtrade/sdk. Your agent framework builds an intent and signs it with its own wallet. Best when the agent already has an execution loop. - Via the
@gloamtrade/mcpserver. An MCP-speaking model (Claude, etc.) gets Gloam as tools alongside its other capabilities, the same way Robinhood's own MCP exposes public trading. Best for a general assistant that should also act privately.
For Virtuals agents
Agents built on GAME get Gloam as one worker: @gloamtrade/game-plugin-gloam gives a Virtuals agent a private balance, private payments, cash outs and proofs of funds, under per-asset limits its owner sets. A companion provider pays out privately on ACP, so the job stays on ACP's contracts while who got paid, and how much, stays private.
Gloam for Virtuals agents covers setup, every function, the limits, exactly what stays public, and the networks.
For agent kits and marketplaces
Building a kit other people's agents run on, or an x402 marketplace? Add Gloam to your agent kit or marketplace covers a drop-in tool pack that previews every payment before your wallet signs it, bundling this MCP server next to yours, and taking private x402 payments next to standard ones.
Connect by URL
The quickest way to try Gloam from a chat. Gloam runs a hosted MCP server, so you add it to your client by URL and install nothing.
https://www.gloam.trade/mcp- Claude (claude.ai and Claude Desktop): Settings, Connectors, Add custom connector, then paste the URL.
- ChatGPT: Settings, Apps and connectors. Turn on developer mode, then create a connector with the URL and no authentication.
- Claude Code:
claude mcp add --transport http gloam-hosted https://www.gloam.trade/mcp - Cursor, VS Code and other clients: add it as a remote server, for example
{ "mcpServers": { "gloam-hosted": { "url": "https://www.gloam.trade/mcp" } } }
The hosted server reads and plans. It has these tools:
| Tool | Does |
|---|---|
gloam_info / gloam_networks | What Gloam is; each network's vault, assets and explorer, on mainnet and testnet, with faucets for the testnets |
gloam_vault_stats | Public vault totals, as on the transparency page. No wallets |
gloam_create_payment_request | A link that asks someone to pay your Gloam address privately |
gloam_verify_proof | Check a proof of funds, proof of payment, payroll total or balance disclosure, with the same checks as /verify |
gloam_plan_deposit | The steps and app link for a private deposit, and what is public |
gloam_mpp_how_to | Pay or charge privately over MPP with @gloamtrade/mppx-gloam, with code |
gloam_connect_full_agent | Commands to install the local server that signs and pays |
It never signs, never holds funds, and never needs a private key, a recovery phrase or a note secret. A tool call that looks like it carries one is refused with a warning not to share it, and nothing is kept. When something has to be signed, it sends you to the app, or to the local MCP server, which keeps keys on your own machine.
Fund an agent with one link
A platform can send its users to one link that opens Gloam with the agent's address, the amount, the token and the network filled in. Nothing is sent on its own: the user checks it and confirms.
https://gloam.trade/app/vault?tab=move&mode=pay#to=<address>&amount=<amount>&asset=<token>&chain=<network>&name=<name>¬e=<note>to: a 0x address, an ENS name, or a Gloam address (gloamr1.…). A 0x address with mixed case must have a valid checksum; the zero address is refused.amount: optional, in whole tokens (25,12.5). It is only filled in whenassetnames a token Gloam knows on that network.asset: the token's symbol or address on that network, for exampleUSDGon Robinhood Chain.chain:robinhood-mainnet,tempo-mainnet,base-mainnetorethereum-mainnetfor mainnet.robinhood,tempo,baseandethereumare the testnets.name(up to 40 characters) andnote(up to 80): optional. The note is sealed inside a payment to a Gloam address; for a 0x address or ENS name it is only shown to the payer.
Keep the fields after the #: browsers never send that part to a server. A Gloam address opens Pay and makes a private payment, free, with the amount hidden. A 0x address or an ENS name opens Cash out to that wallet: the relay sends it from the user's private balance for 0.5%, so their wallet does not show, while the receiving wallet, the token and the amount are public. An ENS name is looked up on Ethereum mainnet and paid on the network the link names. A field that does not check out is left blank, with the reason shown to the user.
Keep an agent topped up
An owner can refill an agent's wallet from their private balance on a schedule, with Gloam closed. Open Agent top-ups in the Vault and pick the agent's wallet, a stablecoin, an amount, how often (weekly or every 2 weeks) and how many.
The whole total is paid for up front. Proofs are made in the browser, so nothing can make one later on its own. The app splits the total into one private balance per top-up, proves one cash out of each to the agent's wallet, and hands each proof to the Gloam relay with its own day. The relay picks a random time inside that UTC day and sends it. A proof fixes the amount and the wallet, so the relay can send it as it is or not at all, and it holds no spending key. Proofs are kept encrypted, so reading the relay's store alone gives nobody a proof to send.
- Up to about 90 days ahead. That is 12 top-ups weekly, or 7 every 2 weeks. Start a new series for longer.
- Cancel any top-up before it goes. The money stays in the vault until then. A proof stays valid until its private balance is spent, so a cancelled top-up, or one the relay can't send, first moves to a fresh private balance. That ends the old proof, and the money shows in your balance once the move lands.
- Not from a fresh deposit. A proof carries the vault root it was made against, and a top-up sent with Gloam closed keeps that root. So a series can only start 6 hours after the deposit behind it, once 3 more deposits or payments from others have reached the vault. The screen says when you can start. A payment you received has no deposit of yours to point at, so it does not wait.
- Setup takes about a minute per top-up, with the tab open. If it stops, nothing is lost: what was scheduled still goes out, the rest stays in your private balance, and you can finish the series from the same screen.
- Each top-up pays the usual 0.5% cash-out fee, taken from that top-up when it goes out, at the vault's rate that day. A proof fixes the amount and the agent's wallet, not the fee, so if the fee goes up, the top-ups still ahead pay the agent less. The screen shows what each one will pay, and you can cancel any that hasn't gone.
- An alert if one fails, if you want one. Give an https address and the relay posts
status,seriesandatto it when a top-up fails or is held. Nothing else is sent, but whoever runs that address learns when it happened. The address is kept encrypted with the job. - On Robinhood Chain, Tempo, Base, Elysium and BNB Chain. They aren't offered on Ethereum: each one takes two relay transactions, and gas there costs more than the fee brings in.
Each top-up is a public cash out: its amount, the agent's wallet and the time show on the explorer, and they all land in one wallet, so anyone can add them up. Only where the money came from stays private. The agent needs its own gas: top-ups send stablecoins only, so on Robinhood Chain, where ETH isn't held in the vault, and on Base it needs ETH from somewhere else, and HYPE on Elysium, and BNB on BNB Chain.
Keep your backup current after setting one up. The proofs wait with the relay, but the balances behind them, and the only way to cancel, are in your browser.
Reference agent (the SDK path)
examples/agent-shield is the smallest complete agent: it mints a note, generates the shield proof, and deposits privately via shieldBound. The whole private path is a few lines.
import { buildShieldBoundIntent, artifactProver } from "@gloamtrade/sdk";
import { parseEther } from "viem";
// 1) SDK mints the note + generates the shield proof
const intent = await buildShieldBoundIntent({
amountWei: parseEther("0.001"),
prover: artifactProver({ wasm: "shield.wasm", zkey: "shield_final.zkey" }),
});
// 2) the agent signs the resolved call with its (server-held) wallet
const hash = await wallet.writeContract({
address: intent.exec.poolAddress,
abi: shieldPoolAbi,
functionName: intent.exec.fn, // "shieldBound"
args: intent.exec.args,
value: intent.exec.valueWei,
});
// persist intent.note.secret in the agent's note store, keyed by commitmentThat snippet runs on the testnet, the SDK default. For mainnet, pass a mainnet network (mainnetNetwork("tempo"), "robinhood", "base" or "ethereum"), its stablecoin as asset, and prove with circuitArtifactUrls("shield", net.chainId) so the final keys are used. See the quickstart.
From there the agent can cash out, pay a receive tag, or prove a balance to a counterparty with a disclosure, all with the same core.
The MCP server
Run it on your own machine with npx -y @gloamtrade/mcp. It signs there, under the spending limits below, and keeps keys and note secrets off the model.
@gloamtrade/mcp exposes Gloam as tools to any MCP client. It keeps two phases separate on purpose: planning tools build an unsigned intent and describe, in plain language, what is private and what is not; execution tools take a plan, sign it server-side, and broadcast.
| Tool | Does |
|---|---|
gloam_info / gloam_privacy_status | What Gloam is; the honest current privacy posture (read) |
gloam_swap_quote | The price of a private swap, and anything that would stop it (read) |
gloam_execute_private_swap / gloam_finish_swap | A private swap proved locally and sent through the Gloam relay, under the spending limits ("swap" must be listed); bring back a swap whose money waits at its escrow |
gloam_plan_shield | Build an unsigned intent an agent can reason over (plan) |
gloam_execute_shield | Real private deposit: mint a note, prove, and broadcast shieldBound server-side (execute) |
gloam_execute_transfer | Sign + broadcast a public testnet transfer for funding (execute) |
gloam_payment_requirements / gloam_verify_payment | Price a resource in a private x402 payment, and verify a presented one (server) |
gloam_pay_x402 | Plan the self-custodial private payment that satisfies a 402 challenge (agent) |
gloam_execute_private_pay | Settle that payment from one of the agent's notes, by handle, sealed to the payee (execute) |
gloam_fetch_paid | Fetch a URL and, on a Gloam 402, pay privately and retry, all inside the server (execute) |
gloam_list_notes / gloam_receive_tag | The agent's balances as handles, never secrets, and the tag others pay it at (read) |
gloam_get_limits / gloam_get_spending_report | The agent's spending limits, and what it spent and has left in the last 24 hours (read) |
On Starknet
From 0.12.0 the server has gloam_starknet_* tools: info, balance, register, add, pay, cash out and transaction status. The agent's key (GLOAM_AGENT_PRIVATE_KEY) opens the same private Starknet account the app opens for that wallet. Spending limits name the network starknet-mainnet, and a payment or cash out counts its amount and Gloam's fee. On Starknet, a payment over a channel that is already open hides who paid, who was paid and how much. The first payment to someone shows their private account. Adding money shows the account and the amount, and a cash out shows where it went and how much. The pool's auditor key can read what an account does, and Starkscan's prover sees each transaction it proves. See Starknet.
Private agent payments (x402)
Agents pay for tools and data over HTTP 402. The pattern that won Colosseum paired x402 with stablecoins, but that settlement is fully public: the amount, the payer, and the payee all leak. Gloam's gloam-private scheme keeps it private and self-custodial. The agent settles a shielded transfer to the payee itself, so no operator or facilitator ever holds its key or funds, then presents the payment note, sealed to the payee's receive tag, plus the settlement transaction on the 402 retry. The payee opens the note and moves it into a fresh note only it knows before serving, so the payer cannot spend it back. The public sees only shielded transfers.
This is not a Tempo Zone. A Zone is operator-visible: the zone operator sees every transaction inside it. Gloam is private from the public and from any operator; only the payer and the payee learn the amount. Compliance visibility is opt-in per payment through an issuer-scoped disclosure, not a blanket view handed to an operator. See the privacy model for what stays hidden and what does not.
An economy that posts a merkle root of its records every night can keep agent payments private and still checkable: each payment's receipt becomes one leaf in that root. See private commerce with commitments.
Check before paying (Agent Wormhole)
A 402 is text the payee wrote, and an agent reads it before it pays. The MCP server can send each payment request to Agent Wormhole first, which scans it for hidden instructions and tells whether it changed since it was first seen. The payment goes ahead only on an allow. A refusal, an abstain, findings, an error or no answer within five seconds all mean the agent does not pay, and nothing is spent.
It is off until you turn it on. Put your Agent Wormhole key in the server's settings (~/.gloam/agent.env) or its environment:
GLOAM_WORMHOLE_KEY=your-agent-wormhole-keyAgent Wormhole sees the payment request and nothing else: never a note, a balance, the wallet or a key.
Check the budget before paying (VEYA)
A Gloam note is spent with a proof, so wallet rules can't stop a payment. A budget only holds before the payment, on the server that keeps the notes. The MCP server can ask VEYA whether the agent's budget covers each payment, and only an allow pays. A refusal, any other answer, an error, a bad setting or no answer within five seconds all mean the agent does not pay, and nothing is spent. With Agent Wormhole on too, it goes first, and both must allow.
It is off until you turn it on. Put these in the server's settings (~/.gloam/agent.env) or its environment. The agent id is one you choose, and a wallet address is refused:
GLOAM_VEYA_KEY=your-veya-key
GLOAM_VEYA_URL=https://api.veyanet.tech/guard/v1/check
GLOAM_VEYA_AGENT_ID=an-id-you-chooseVEYA covers USDG on Robinhood Chain. A payment on another chain or in another asset is refused, so with the check on, the server pays only in USDG on Robinhood Chain.
With this on, VEYA sees the agent id, the chain, the asset, the amount and the payee during the check, and nothing else. It gets no resource host and no payment request text, so it learns nothing about what was bought. It never sees a note, a secret, a balance, a wallet or a key. What VEYA keeps after the check is VEYA's to say. If VEYA ever needs more than this to answer, the payment is refused and nothing is spent.
This server enforces the check, off-chain. The vault does not know about it, so it binds the agent only while the notes and the key are held by this server and nowhere else. If a payment fails after an allow, VEYA's running budget may sit ahead of what was really paid.
VEYA checks payments: gloam_execute_private_pay and gloam_fetch_paid. These go through the spending limits but not through VEYA: gloam_execute_transfer, a public send of test ETH on Robinhood Chain testnet, and a private swap or a swap's exit to an address, which only run when the owner lists swap in the limits. Leave swap out if every private spend must pass VEYA. A price of zero or less is refused before any check, with the limits on or off.
The receipt after a payment
VEYA's allow carries a check id. Set GLOAM_VEYA_ANCHOR_URL to https://api.veyanet.tech/guard/v1/anchor as well, on the same origin as the check URL since the key goes to both, and the server proves each payment once it lands, with that id as the receipt's verifier, and hashes the proof into one bytes32 leaf. VEYA gets that leaf and the agent id, nothing else: never the record, the proof, the amount, the payee, a note or the transaction hash. VEYA writes the leaf to storeCommitment, so you need no anchoring wallet.
With receipts on, an allow without a usable check id does not pay, because a payment can't be undone and it could never get its receipt. The payment's answer, with its credential, never waits on the receipt: it comes back as soon as the payment lands, with the receipt pending, and the receipt is built after it, so a challenge can't expire meanwhile and push the agent to pay twice. Keep the server running until the receipt is done. gloam_retry_veya_receipts shows where it stands and tries again without paying anything, after anchor_failed or receipt_failed. A leaf goes to VEYA only once its record is saved, so one payment never gets two leaves. anchored means VEYA named the leaf and the transaction that wrote it, given as anchorTx; the server does not read the chain to confirm the write. VEYA writes a leaf once, so sending the same one again is safe, and it answers with the first transaction.
The server keeps the full record in its encrypted note store. It shows the asset, the minimum amount and the transaction hash, so no tool hands it to the agent. See examples/veya-receipt.
What a receipt proves: a payment of at least the stated amount, in that asset, made by that transaction into the vault, tied to VEYA's check id. It does not prove who received it, since the payee stays private, or that anything was delivered for it. The leaf on chain proves only that VEYA wrote that leaf; whoever holds the record checks the rest with checkPaymentReceipt.
Spending limits
An agent that can sign can spend, so the owner sets its limits and every tool that moves money (pay, send, shield) checks them before anything is proved or signed. A spend that breaks a limit is refused with a plain reason the agent can act on, for example “that would bring today to 14 PathUSD, over the limit of 12 a day”.
| Limit | Meaning |
|---|---|
| Assets | Which stablecoins or tokens the agent may move, matched by contract address |
| Per payment | The most it may send in one payment |
| Per day | The most it may send in any 24 hours |
| Recipients | Anyone, or only the payees you list |
| Expiry | A date after which the agent cannot spend at all |
| Tools | Which of pay, send and shield it may use |
No limits means no spending: a server with a key but no limits refuses every spend until you set them (or turn them off on purpose). Every spend is logged before it is signed, under a lock, so two calls at once cannot both squeeze under the daily cap. Configuration lives in the MCP README.
Where they are enforced. These limits are enforced by the MCP server you run, off-chain, not by the vault contract. They stop a confused or manipulated agent; they do not stop someone who has the raw key. For that, use a policy wallet underneath, as below.
The agent never holds the money itself. A private balance is a note, and whoever knows its secret can spend it, so the server keeps every note in an encrypted store and gives the agent short handles instead. A payment it makes is sealed to the payee's receive tag, so the agent cannot open that either. What limits still cannot stop: an agent tricked into spending within its limits to a payee you allowed.
Policy and key custody
Signing keys live server-side only and never enter a model context or a log. Before an agent runs on mainnet, swap the test key for a Turnkey server wallet with policy the agent cannot override: spend caps, an allow-list of contracts and markets, and size privacy always on. An out-of-policy action is refused, not quietly clamped.
Honesty
No fabricated fills, ever. If a private path is not live, the tool says so and returns a plan rather than a fake success. Private swaps are live on the Robinhood Chain and Tempo mainnets, in the Gloam app, the SDK (buildSwapIntent) and the MCP server (gloam_execute_private_swap): a swap hides who swapped, not the tokens or the amounts. The old sealed trade is retired. Shield, private send, cash out, swaps and disclosure are proof-gated. Mainnet uses the final keys from the 13-contributor ceremony; testnet runs on dev-ceremony keys. The code was reviewed internally before launch, and Kann Audits reviewed the vault contracts (report, 1 November 2026) and found no Critical, High or Medium issues. The SDK and the MCP server were not part of that review. Start an agent on small limits and raise them as you go.