Agent SDK
Design preview. The SDK is open source at github.com/intelena/agent-kit and runs against a
LocalSimulatortoday. When the shielded pool ships, theBackendinterface is the only thing that changes. Not yet on npm.
The private agent SDK lets bots and AI agents trade from shielded balances with spending limits, keeping their strategy off-chain.
Why
A bot on a public chain is a strategy written in fills: readable, reversible, and front-runnable. The SDK gives automation the same dark-first execution a human user gets, plus a hard leash.
Model
- Provision an agent identity with per-asset spending limits and an allowed venue set.
- Fund a bounded allocation from a shielded balance. The rest stays out of the agent's reach.
- Execute. The agent submits encrypted intents through private RPC. Crossing and fallback routing behave exactly as for a human user.
- Observe. Read the agent's activity locally; extend a scoped viewing key if a third party needs to verify it.
Guarantees
- Limits are enforced by the spending proof itself, not by a server-side check. An agent cannot exceed its allocation.
- The agent never holds the owner key.
- Every agent spend carries a proof of innocence like any other spend.
Shape (TypeScript)
import { Agent, LocalSimulator, runDca } from "@intelena/agent-kit";
const backend = new LocalSimulator({
prices: { USDG: 1, TSLA: 365.9 },
balances: { agent_0001: { USDG: 5_000 } },
darkDepth: { "USDG/TSLA": 1_500 },
});
const agent = new Agent({
id: "agent_0001",
name: "dca-bot",
backend,
limits: { perAsset: { USDG: 2_000 }, venues: ["dark", "uniswap"], minExposure: 60 },
beforeExecute: (intent, plan) => plan.leakScore <= 25, // human / policy veto
});
await runDca(agent, { sell: { asset: "USDG", amountPerSlice: 500 }, buy: { asset: "TSLA" }, slices: 4, exposure: 85 });
agent.remaining(); // { USDG: 0 } — a 5th slice throws LimitExceededError
What the SDK enforces: per-asset spending limits checked before every plan, a venue allow-list (VenueNotAllowedError instead of silently routing publicly), a minimum exposure, a beforeExecute veto, a Leak Score on every plan, and a proofId on every execution. Also included: planRebalance() and examples for a DCA bot and an approval gate.