An agent harness where the model can reason freely but can only act through a deterministic, budget-gated trading surface.
Built on top of T3 Code, the agent harness control surface from Ping Labs. Upstream gives you a control surface for coding agents on your machine; T3 Trade adds a second thing an agent can be pointed at — a live Hyperliquid account, reached through a typed, gated tool surface instead of shell access. The core idea: a mission binds one agent thread to one market with a written strategy, a maximum-loss budget, and an expiry. From there the harness runs on its own. It wakes on market events, not on a timer. The agent registers watches — a price level, a candle close — and is resumed only when one fires, with a snapshot of the account, position, resting orders, and remaining budget. Every order passes a deterministic checklist first. A 17-item preview runs before anything is signed: mandate, leverage, gross notional, exchange minimums, the reservation ledger, and a mandatory stop-loss. The agent cannot talk its way past it. No position stays unprotected. Every acknowledged increase must have a confirmed exchange-native reduce-only stop resting against it, reconciled against the canonical position size rather than the size that was submitted. Seven controls never need the agent. Pause, resume, cancel entries, reduce 25/50/75/100%, close, revoke, and close-and-revoke all execute deterministically with the provider process stopped. Submission is idempotent. A deterministic cloid plus a local idempotency key means a retried request returns the existing record instead of placing a second order. Positions, orders, and fills are always read back from the exchange. The database records what T3 Trade did; the exchange remains the authority on what is true. On structure: pure rules (preview checklist, protection, risk equations) live in packages/trading-contracts as schemas and functions with no I/O. The exchange client — signing, info reads, WebSocket — is isolated in packages/hyperliquid. The mission state machine, execution, reconciliation, and controls sit in apps/server/src/trading; the workspace UI in apps/web. Everything outside those paths is upstream T3 Code and is kept deliberately close to it so syncs stay cheap. A patch ledger records every intentional divergence from the fork baseline. Roughly 5 hours end to end, about 60% AI-written. The split fell along a clear line: the agent was good at the mechanical breadth — schemas, the exchange client, wiring the workspace UI — and the hand-written 40% was concentrated in the parts where being wrong costs money: the preview checklist, the protection reconciliation, and the idempotency keys. On safety: alpha software, Hyperliquid testnet only. The interesting design constraint was assuming the agent is untrusted — it can reason about a market however it likes, but it can only act through a surface where the dangerous invariants (budget, leverage, stop-loss presence) are enforced by deterministic code the model never touches.