---
description: "The HardBasis agent layer: the hardbasis CLI, its MCP server, published skills, scoped keys and testnet first, with what is live and what is planned."
---

# Agents

## For agents, in order

What an agent needs before its first call, one line each; the detail stays on the page linked.

1. **Auth.** One `x-api-key` header; scopes, sessions and the delegate-key pattern: [Authentication](/api/authentication).
2. **Base URLs.** Testnet first; `GET /deployment` says which environment answered: [Environments](/api/#environments).
3. **Units.** Money, prices, rates and counts are decimal strings; read each field's unit off `x-hardbasis-unit`: [Wire encoding](/api/wire-encoding).
4. **Idempotency.** An `idempotency-key` header on every write; each operation page says what the value must be: [Place an order](/api/reference/orders/postV1Orders).
5. **Rate limits.** Three budgets; honor the `RateLimit-*` headers: [Rate limits](/api/rate-limits).
6. **Errors.** Match on the stable `code`, never the message: [Errors](/api/errors).
7. **Pagination.** Lists page by a named cursor, never a generic key: [Wire encoding](/api/wire-encoding).
8. **WebSocket resume.** Reconnect, take the REST snapshot, then resume the stream: [Reconnect doctrine](/api/websocket#reconnect-doctrine).
9. **The worked loop.** Signup to withdrawal, runnable: [Quickstart for agents](/api/quickstart).

## The agent layer

HardBasis ships an agent layer on top of the public API:

- **A CLI.** `hardbasis` turns every public route into a command, with JSON output, `--dry-run` on every write, and the API's machine `code` on every refusal.
- **An MCP server.** `hardbasis mcp` serves the same commands as MCP tools over stdio to Claude Code, Cursor, Codex, Gemini CLI and other clients.
- **Skills.** A pack of agentskills.io skills, each tagged with the lowest autonomy level that may run it.
- **Scoped keys.** An agent trades on a `read,trade` delegate key, never on your master key.
- **Testnet first.** Testnet is the default everywhere, and `hardbasis auth login` gives you a funded testnet account.

**Bitcoin perps your agent can check.** The goal is that every limit an agent runs under is venue state it can read back, and every fill is evidence it can verify.

## Live today vs planned

| What                                                                                        | Status                                             |
| ------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `hardbasis` CLI: every public route, `--dry-run`, decimal-string money, machine error codes | live, testnet                                      |
| `hardbasis mcp` over stdio, with the agent's ack and the human's confirm prompt             | live, testnet                                      |
| Skills pack (nine published skills)                                                         | live                                               |
| Delegate keys with `read`, `trade`, `withdraw` scopes; `cancel-all-after` dead-man switch   | live                                               |
| Proof of reserves as a tool (`por get`, `por dashboard`)                                    | live                                               |
| Engine-enforced per-key limits                                                              | planned, [R-AP-10](#r-ap-10-key-limits)            |
| Agent accounts and a stop button                                                            | planned, [R-AP-11](#r-ap-11-agent-accounts)        |
| Audit and replay of your account history; sats-per-request (L402) premium data              | planned, [R-AP-12](#r-ap-12-audit-replay-and-l402) |
| Remote MCP (no local install)                                                               | planned, [R-AP-13](#r-ap-13-remote-mcp)            |
| Mainnet                                                                                     | not live                                           |

Nothing in the planned rows is available yet. The numbers are the rulings in the agent platform spec that will deliver them.

### R-AP-10 Key limits

Limits set when a key is minted (position size per market, order notional, daily turnover, a market allowlist, reduce-only, expiry), enforced by the venue and readable back from `GET /v1/limits`. Until this ships, the agent enforces its own limits; see [Safety](/agents/safety).

### R-AP-11 Agent accounts

A child account for an agent whose keys can never withdraw, funded from yours with a cap, plus one call that revokes its keys, cancels its orders and optionally flattens it.

### R-AP-12 Audit, replay and L402

Your account's event history with local hash-chain checks and exportable fill evidence, and premium market data paid per request in sats over L402.

### R-AP-13 Remote MCP

A hosted MCP endpoint authenticated by a trade-scoped delegate you mint in the web app, so a cloud agent can connect without a local install.

## Pages

- [Install](/agents/install): the installer, npm, a source checkout, verify, log in.
- [MCP](/agents/mcp): client setup, tool groups, the two gates, autopilot, the audit stream.
- [Autonomy levels](/agents/autonomy-levels): what an agent may call at each level.
- [Skills](/agents/skills): the published skills index.
- [Safety](/agents/safety): what the venue enforces today and what your agent must enforce itself.

Per-command reference pages arrive with hardbasis-cli v0.1.1.
