Security model
An agent cannot exceed the limits its operator set, even if it is manipulated.
The sections below cover assets, adversaries, trust boundaries, mitigations and residual risks.
Assets
- Funds in the Elysium wallet the agent uses
- Positions and margin in the Hyperliquid account the agent trades for
- The wallet key and the Hyperliquid agent key
- The policy, the kill switch and the audit log
Adversaries
- A manipulated agent
- Prompt injection through token names, web pages, API strings or user messages. Can call any tool with any arguments, repeatedly and concurrently.
- A hostile contract or token
- Behaves differently under simulation, emits misleading events, or tries to obtain approvals.
- A dishonest or broken RPC
- Reports the wrong chain, inconsistent data, or drops a broadcast response.
- A compromised external signer
- Returns a signature for a different transaction than the one requested.
- Someone who reads the logs
- Should learn nothing secret from the audit log, CLI output or errors.
Trust boundaries
- Agent ↔ tools
- The agent controls tool arguments only. Every input is parsed strictly; unknown fields fail. Descriptions are static.
- Tools ↔ wallet
- Write tools describe an action. The wallet builds transfer and approval calldata itself, so a tool cannot hide a different call.
- Wallet ↔ key
- The key lives in one class as bytes. Tools, policy and agent text never reach it.
- Wallet ↔ chain
- RPC answers are checked: chain ID on every endpoint before signing, simulation results validated by schema, receipts compared with simulation.
- Operator ↔ everything
- The operator writes the policy and config, holds the approval channel and the kill switch. None of these are reachable from a tool.
Threats and mitigations
| Threat | Mitigation |
|---|---|
| Drain to an attacker | Recipient allowlist; per-transaction and rolling caps across all agents on the wallet; caps re-checked under a lock so concurrent calls cannot add up past them. |
| Unlimited or hidden approvals | Approvals only through approval rules, bounded, Permit2 with expiry; approval selectors refused in generic rules; any unexpected Approval event in simulation refuses the action. |
| Calldata smuggling | Wallet-built calldata for transfers and approvals; selector allowlist for contract calls; simulated effects must match the declaration exactly. |
| Cross-chain replay | Hand-defined chains; EIP-155 chain ID in every transaction; every RPC endpoint must report the expected chain before signing. |
| Nonce races | Nonces reserved under the same lock as spend; resync from the chain after any failure. |
| Simulation and chain diverge | Only allowlisted contracts; receipts compared with simulation; divergence engages the kill switch. |
| Approval spoofing | Approval bound to the signing hash; webhook requests and responses signed with HMAC; the CLI requires typing part of the hash. |
| Compromised signer | The signed transaction is parsed, compared field by field and its signer recovered before broadcast. |
| Tampered audit log | Each entry hashes the previous one; any edit or deletion stops verification and new writes. |
| Key leakage | Encrypted keystores (scrypt N=2^17, AES-256-GCM with the header as AAD); keys never in argv, logs or errors; best-effort zeroing. |
Residual risks
- A contract that behaves honestly only under simulation can complete one transaction before the receipt check halts the wallet. Caps and the contract allowlist bound it.
- Inside an allowlisted contract or swap, funds may go to a pool or address the contract chooses. Caps bound the amount; the policy cannot bound the destination.
- Hyperliquid order checks use the mid price at request time; the market can move before the fill.
- The state lock works on one host. Run one signer process per key.
- JavaScript cannot guarantee that no copy of a key remains in memory. Zeroing is best effort.
- The Elysium sequencer and data availability are run by a single party at launch. Elyrail cannot change that.
- The operator's own machine, config and approval channel are trusted. Elyrail does not protect against a compromised operator.
Policy design
Deny by default. Rules name exactly what is allowed. A token with no per-transaction limit cannot move at all. Missing prices deny USD rules instead of skipping them. Unknown fields in a policy are errors, so a typo cannot silently disable a rule.
Each action is checked three times: against what it declares, against what simulation shows, and against fresh state under the lock just before reservation. See the policy reference and concepts.