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/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.
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 commitmentFrom 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.
| Tool | Does |
|---|---|
gloam_info / gloam_privacy_status | What Gloam is; the honest current privacy posture (read) |
gloam_list_markets / gloam_quote | Markets and indicative quotes, with what stays private (read) |
gloam_plan_shield / gloam_plan_private_trade | Build an unsigned intent an agent can reason over (plan) |
gloam_execute_transfer | Sign + broadcast on the real testnet execution rail (execute) |
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.