The Gloam SDK is live. Add private balances, payments, and disclosure to any onchain app.

Explore the SDK →

Documentation

Build a private agent

Give an AI agent a private execution surface on Robinhood Chain. It shields, pays, and proves holdings end to end, with size and strategy hidden and signing under policy.

Why agents need this most

An agent trading a public chain leaks its whole strategy: every position, size, and time is on the graph for anyone to copy or front-run. Agents run predictable, high-frequency strategies, so they are the easiest to reverse-engineer. Gloam gives an agent a private execution surface — hold, move, and prove value with size hidden, so its edge stays its own.

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/mcp server.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.

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 commitment

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

@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.

ToolDoes
gloam_info / gloam_privacy_statusWhat Gloam is; the honest current privacy posture (read)
gloam_list_markets / gloam_quoteMarkets and indicative quotes, with what stays private (read)
gloam_plan_shield / gloam_plan_private_tradeBuild an unsigned intent an agent can reason over (plan)
gloam_execute_shieldReal private deposit: mint a note, prove, and broadcast shieldBound server-side (execute)
gloam_execute_transferSign + broadcast a public testnet transfer for funding (execute)
gloam_payment_requirements / gloam_verify_paymentPrice a resource in a private x402 payment, and verify a presented one (server)
gloam_pay_x402Plan the self-custodial private payment that satisfies a 402 challenge (agent)

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 plus the settlement transaction as proof on the 402 retry. The payee opens the note to see the amount; the public sees only that a shielded transfer happened.

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.

Policy and key custody

Signing keys live server-side only and never enter a model context or a log. For production, swap the testnet 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. Sealed swaps are currently disabled pending the H1 solvency work; shield, private send, cash out, and disclosure are live and proof-gated. Testnet only, with dev-ceremony keys, until a production ceremony and an external audit.