Security Model
Security architecture, trust boundaries, and threat mitigation strategies.
Aquarius follows a strict security posture:
If a feature weakens security assumptions, it does not ship. If uncertain between two approaches, the safer option is chosen.
Every piece of data that crosses a trust boundary is validated using strict Zod schemas before it enters the trusted core.
Aquarius never holds, accesses, or stores user private keys. All on-chain actions are executed through:
The BufferVault is isolated from other system contracts:
deposit(), withdraw(), and injectLiquidity()injectLiquidity()Every mitigation action is bounded by multiple constraints:
| Constraint | Enforced By | Description |
|---|---|---|
| Spending limit | MitigationExecutor.sol | Maximum per-action amount set by user |
| Daily action cap | PolicyGuard.sol | Maximum actions per user per 24h |
| Single action cap | PolicyGuard.sol | Maximum USD value per single action |
| Action whitelist | AquaAgent.sol | Only pre-registered action types |
| Agent authorization | onlyAgent modifier | Only the registered agent address |
The Event Router uses microtask scheduling and event counting to prevent infinite loops:
The Aqua Agent cannot execute arbitrary calls. It can only:
repayOnBehalf() on the Mitigation ExecutorsupplyOnBehalf() on the Mitigation ExecutorinjectLiquidity() on the BufferVaultEach of these methods has its own authorization and bounds checking.
Mitigation actions are gated by the escalation engine:
All API request payloads are validated using strict Zod schemas:
import { z } from "zod";
const ChainParam = z.enum([
"ethereum", "arbitrum", "base", "solana"
]);
const UserParam = z.string()
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address");Invalid requests receive structured error responses without exposing internal implementation details.
All public endpoints enforce rate limiting:
Real-time streams (WSS, event subscriptions) enforce:
| Area | Status | Notes |
|---|---|---|
| Smart contract audits | Pending | Formal audit not yet completed |
| Penetration testing | Planned | Scheduled for post-launch |
| Bug bounty program | Planned | Will cover critical contract vulnerabilities |
| Key management | Implemented | No keys stored; all via Confidential Compute |
| Supply chain | Monitored | Dependencies are pinned and reviewed |
Audit Status
Smart contracts have not yet undergone a formal security audit. The current implementation has been validated through the 11-stage validation pipeline, but formal audit is planned and required before mainnet deployment.