@buildaureon/sdk 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,196 +1,257 @@
1
- # Production Integration Guide
2
-
3
- This guide details how to integrate `@buildaureon/sdk` into server-side agents, automated rebalancing scripts, and frontend user interfaces.
4
-
5
- ---
6
-
7
- ## 1. End-to-End Integration Plan
8
-
9
- Follow this six-step sequence to configure and start the automated rebalancing loop.
10
-
11
- ```mermaid
12
- flowchart TD
13
- Client[1. Client Init] --> Auth[2. Sign Handshake]
14
- Auth --> Sync[3. Sync Capital Book]
15
- Sync --> Deposit[4. Fund Vault]
16
- Deposit --> Objective[5. Add Objective]
17
- Objective --> Watchdog[6. Run Heartbeat Loop]
18
- Watchdog --> Watchdog
19
- ```
20
-
21
- ### Step 1: Client Construction
22
- Set up the client, leveraging environment variables for configuration options.
23
-
24
- ```ts
25
- import { createAureonClient, createSessionTokenProvider } from "@buildaureon/sdk";
26
-
27
- const session = createSessionTokenProvider(
28
- typeof localStorage !== "undefined"
29
- ? localStorage.getItem("aureon_bearer_token")
30
- : process.env.AUREON_TOKEN ?? null
31
- );
32
-
33
- export const aureon = createAureonClient({
34
- baseUrl: process.env.AUREON_API_URL || "https://api.aureonlabs.network",
35
- apiKey: process.env.AUREON_API_KEY ?? null,
36
- getAccessToken: session.getAccessToken
37
- });
38
- ```
39
-
40
- ### Step 2: EIP-191 Cryptographic Verification
41
- Authenticate session tokens using cryptographic challenge-response verification.
42
-
43
- ```ts
44
- async function authenticate(walletAddress: string, signerFn: (msg: string) => Promise<string>) {
45
- // 1. Fetch challenge message
46
- const { message } = await aureon.getAuthNonce(walletAddress);
47
-
48
- // 2. Sign EIP-191 personal message locally
49
- const signature = await signerFn(message);
50
-
51
- // 3. Post verification payload
52
- const { token } = await aureon.verifyWallet({
53
- address: walletAddress,
54
- message,
55
- signature
56
- });
57
-
58
- session.setToken(token);
59
- return token;
60
- }
61
- ```
62
-
63
- ### Step 3: Align the Capital Book
64
- Populate local assets into the gateway database.
65
-
66
- ```ts
67
- const { portfolio, chainId } = await aureon.syncPortfolio();
68
- console.log(`Portfolios aligned for Chain ID ${chainId}. Total Valuation: $${portfolio.totalNotionalUsd}`);
69
- ```
70
-
71
- ### Step 4: Fund the Smart Vault
72
- Automated objectives rebalance tokens held in your Smart Vault on the Robinhood Chain. Allocate capital into the vault before creating rules.
73
-
74
- ```ts
75
- async function ensureVaultFunded(symbol: string, amount: string, executeTx: (step: any) => Promise<string>) {
76
- const status = await aureon.getVaultStatus();
77
- if (status.empty) {
78
- const prep = await aureon.prepareVaultDeposit({ symbol, amount });
79
- for (const step of prep.steps) {
80
- console.log(`Executing step: ${step.label}`);
81
- const txHash = await executeTx(step);
82
- console.log(`Step complete. Hash: ${txHash}`);
83
- }
84
- }
85
- }
86
- ```
87
-
88
- ### Step 5: Register the Objective
89
- Create the objective. SDK integrations default to `automationMode: "auto"`.
90
-
91
- ```ts
92
- const objective = await aureon.createObjective({
93
- name: "Liquid Stable Reserves",
94
- kind: "stable_allocation",
95
- targetWeight: 0.30,
96
- tolerance: 0.03
97
- });
98
- console.log(`Objective ${objective.name} registered. Status: ${objective.status}`);
99
- ```
100
-
101
- ### Step 6: Execute the Watchdog Loop
102
- Poll the gateway regularly to check policy health and execute restorations.
103
-
104
- ```ts
105
- async function watchdogHeartbeat() {
106
- try {
107
- const result = await aureon.refreshWatchdog();
108
- console.log(`Watchdog completed at ${result.refreshedAt}. System state: ${result.breaches.length} breaches.`);
109
-
110
- for (const breach of result.breaches) {
111
- const plan = await aureon.getRestorePlan(breach.objectiveId);
112
- if (plan.kind === "vault_swap") {
113
- const receipt = await aureon.restoreObjective(breach.objectiveId);
114
- console.log(`Rebalance executed. Settlement: ${receipt.settlement}, Hash: ${receipt.transactionHash}`);
115
- }
116
- }
117
- } catch (error) {
118
- console.error("Watchdog heartbeat failed:", error);
119
- }
120
- }
121
- ```
122
-
123
- ---
124
-
125
- ## 2. Advanced Scripting Guidelines
126
-
127
- ### 2.1 Implementing daemon runners
128
- For long-running processes, wrap the heartbeat logic in daemon controllers like PM2 or run them as systemd services.
129
-
130
- #### PM2 Configuration (`ecosystem.config.js`)
131
- ```js
132
- module.exports = {
133
- apps: [{
134
- name: "aureon-agent-loop",
135
- script: "./dist/index.js",
136
- instances: 1,
137
- autorestart: true,
138
- watch: false,
139
- env: {
140
- NODE_ENV: "production",
141
- AUREON_API_URL: "https://api.aureonlabs.network"
142
- }
143
- }]
144
- };
145
- ```
146
-
147
- #### Systemd Service (`/etc/systemd/system/aureon.service`)
148
- ```ini
149
- [Unit]
150
- Description=Aureon Rebalance Watchdog Daemon
151
- After=network.target
152
-
153
- [Service]
154
- Type=simple
155
- User=node
156
- WorkingDirectory=/home/node/app
157
- ExecStart=/usr/bin/node dist/index.js
158
- Restart=on-failure
159
- RestartSec=10
160
- Environment=NODE_ENV=production
161
-
162
- [Install]
163
- WantedBy=multi-user.target
164
- ```
165
-
166
- ### 2.2 Server-Side Logger Configuration (Pino / Winston)
167
- Log JSON payloads to persistent logging collectors.
168
-
169
- ```ts
170
- import winston from "winston";
171
- import { createAureonClient } from "@buildaureon/sdk";
172
-
173
- const logger = winston.createLogger({
174
- level: "info",
175
- format: winston.format.json(),
176
- transports: [new winston.transports.File({ filename: "aureon-combined.log" })]
177
- });
178
-
179
- const aureon = createAureonClient({
180
- apiKey: process.env.AUREON_API_KEY,
181
- logger: {
182
- debug: (msg, ctx) => logger.debug(msg, ctx),
183
- info: (msg, ctx) => logger.info(msg, ctx),
184
- warn: (msg, ctx) => logger.warn(msg, ctx),
185
- error: (msg, ctx) => logger.error(msg, ctx)
186
- }
187
- });
188
- ```
189
-
190
- ---
191
-
192
- ## 3. Frontend Deployment (SPA/Vite Environments)
193
-
194
- * **Credential Leakage Prevention**: Never commit `AUREON_API_KEY` to public repositories. Deploy client credentials via backend server API proxy routes.
195
- * **CORS Configurations**: The production gateway allows request origins matching allowlisted domains configured in the Developer console. For local development, localhost calls are permitted.
196
- * **Decoupled loop execution**: Frontend interfaces should only allow users to manage objectives and inspect histories. Keep the active rebalancing loops (`refreshWatchdog` and `restoreObjective`) on secure server-side cron loops.
1
+ # Production Integration Guide
2
+
3
+ Integrate `@buildaureon/sdk` into server-side agents and automated rebalancing loops against the live AUREON API.
4
+
5
+ **Automation note:** SDK integrations support **Automatic mode only** (`automationMode: "auto"` — the default). Do not build Manual Approve agent loops with the SDK; use the operator utility for Manual workflows.
6
+
7
+ ---
8
+
9
+ ## 1. End-to-end agent loop
10
+
11
+ ```mermaid
12
+ flowchart TD
13
+ Init[1_issued_API_key_client] --> Sync[2_sync_Capital_Book]
14
+ Sync --> Fund[3_fund_vault_if_empty]
15
+ Fund --> Obj[4_create_Auto_objective]
16
+ Obj --> Loop[5_watchdog_heartbeat]
17
+ Loop -->|breach| Plan[6_restore_plan]
18
+ Plan --> Restore[7_restoreObjective]
19
+ Restore --> Loop
20
+ ```
21
+
22
+ ### Step 1 Client
23
+
24
+ ```ts
25
+ import { createAureonClient } from "@buildaureon/sdk";
26
+
27
+ export const aureon = createAureonClient({
28
+ baseUrl: process.env.AUREON_API_URL || "https://api.aureonlabs.network",
29
+ apiKey: process.env.AUREON_API_KEY!, // issued Developers key
30
+ timeoutMs: 30_000,
31
+ maxRetries: 2,
32
+ retryDelayMs: 500,
33
+ });
34
+
35
+ const me = await aureon.me();
36
+ console.log("operating as", me.walletAddress);
37
+ ```
38
+
39
+ Optional Bearer (usually unnecessary with an issued key):
40
+
41
+ ```ts
42
+ import { createAureonClient, createSessionTokenProvider } from "@buildaureon/sdk";
43
+
44
+ const session = createSessionTokenProvider(process.env.AUREON_TOKEN ?? null);
45
+ export const aureon = createAureonClient({
46
+ baseUrl: process.env.AUREON_API_URL || "https://api.aureonlabs.network",
47
+ apiKey: process.env.AUREON_API_KEY ?? null,
48
+ getAccessToken: session.getAccessToken,
49
+ });
50
+ ```
51
+
52
+ ### Step 2 Sync Capital Book
53
+
54
+ ```ts
55
+ const { portfolio, chainId } = await aureon.syncPortfolio();
56
+ console.log({
57
+ chainId,
58
+ positions: portfolio.positions.length,
59
+ totalNotionalUsd: portfolio.totalNotionalUsd,
60
+ });
61
+ ```
62
+
63
+ Prefer `syncPortfolio()` over hand-seeded books in production. Use `setPortfolio` only for controlled rehearsals.
64
+
65
+ ### Step 3 — Fund vault when needed
66
+
67
+ Automatic restores require vault capital. Prepare returns **unsigned** steps — your host signs and broadcasts.
68
+
69
+ ```ts
70
+ import type { VaultPrepareResult } from "@buildaureon/sdk";
71
+
72
+ async function ensureVaultFunded(
73
+ symbol: string,
74
+ amount: string,
75
+ broadcast: (step: VaultPrepareResult["steps"][number]) => Promise<string>
76
+ ) {
77
+ const status = await aureon.getVaultStatus();
78
+ if (!status.empty && status.canRestore) return status;
79
+
80
+ const prep = await aureon.prepareVaultDeposit({ symbol, amount });
81
+ for (const step of prep.steps) {
82
+ const hash = await broadcast(step);
83
+ console.log(step.label, hash);
84
+ }
85
+
86
+ return aureon.getVaultStatus();
87
+ }
88
+ ```
89
+
90
+ Typical broadcast (viem sketch):
91
+
92
+ ```ts
93
+ // host-owned not part of the SDK
94
+ await walletClient.sendTransaction({
95
+ to: step.to,
96
+ data: step.data,
97
+ value: step.value ? BigInt(step.value) : 0n,
98
+ });
99
+ ```
100
+
101
+ ### Step 4 Create an Automatic objective
102
+
103
+ ```ts
104
+ const objective = await aureon.createObjective({
105
+ name: "Maintain 20% WETH",
106
+ kind: "balanced_portfolio",
107
+ targetWeight: 0.2,
108
+ tolerance: 0.03,
109
+ targetSymbol: "WETH",
110
+ // automationMode defaults to "auto" — keep it that way for SDK agents
111
+ priority: "medium",
112
+ });
113
+ ```
114
+
115
+ **Locks:** `targetSymbol` and `automationMode` cannot change after create. Recreate the objective to change token or mode.
116
+
117
+ ### Step 5 — Watchdog heartbeat
118
+
119
+ ```ts
120
+ async function heartbeat() {
121
+ const refreshed = await aureon.refreshWatchdog();
122
+ console.log("breaches", refreshed.breaches.length);
123
+
124
+ for (const breach of refreshed.breaches) {
125
+ const plan = await aureon.getRestorePlan(breach.objectiveId);
126
+ console.log("plan", plan.kind, plan);
127
+
128
+ const receipt = await aureon.restoreObjective(breach.objectiveId);
129
+ console.log({
130
+ settlement: receipt.settlement, // "vault" | "staged"
131
+ status: receipt.status,
132
+ tx: receipt.transactionHash,
133
+ });
134
+ }
135
+
136
+ const health = await aureon.getHealth();
137
+ return health;
138
+ }
139
+ ```
140
+
141
+ ### Step 6 — Verify
142
+
143
+ ```ts
144
+ await aureon.getHealth(objective.id);
145
+ await aureon.getTimeline(objective.id);
146
+ await aureon.listExecutions(objective.id);
147
+ ```
148
+
149
+ Always branch UI/agent copy on `receipt.settlement`.
150
+
151
+ ---
152
+
153
+ ## 2. Recommended objective kinds for agents
154
+
155
+ | Kind | Typical use |
156
+ | --- | --- |
157
+ | `balanced_portfolio` | Hold `targetSymbol` near a weight band |
158
+ | `stable_allocation` | Keep a stable sleeve near a weight |
159
+ | `risk_ceiling` | Cap portfolio risk score |
160
+ | `reward_reinvestment` | Sweep rewards into a sleeve |
161
+
162
+ Start with one Automatic `balanced_portfolio` objective and a funded vault before adding more policies.
163
+
164
+ ---
165
+
166
+ ## 3. Daemon runners
167
+
168
+ ### PM2
169
+
170
+ ```js
171
+ module.exports = {
172
+ apps: [
173
+ {
174
+ name: "aureon-agent-loop",
175
+ script: "./dist/index.js",
176
+ instances: 1,
177
+ autorestart: true,
178
+ env: {
179
+ NODE_ENV: "production",
180
+ AUREON_API_URL: "https://api.aureonlabs.network",
181
+ // AUREON_API_KEY from secret store / PM2 ecosystem secrets
182
+ },
183
+ },
184
+ ],
185
+ };
186
+ ```
187
+
188
+ ### systemd
189
+
190
+ ```ini
191
+ [Unit]
192
+ Description=AUREON Automatic restore agent
193
+ After=network.target
194
+
195
+ [Service]
196
+ Type=simple
197
+ User=node
198
+ WorkingDirectory=/home/node/app
199
+ ExecStart=/usr/bin/node dist/index.js
200
+ Restart=on-failure
201
+ RestartSec=10
202
+ Environment=NODE_ENV=production
203
+
204
+ [Install]
205
+ WantedBy=multi-user.target
206
+ ```
207
+
208
+ ### Logging
209
+
210
+ ```ts
211
+ import { createAureonClient } from "@buildaureon/sdk";
212
+
213
+ const aureon = createAureonClient({
214
+ apiKey: process.env.AUREON_API_KEY!,
215
+ logger: {
216
+ debug: (msg, ctx) => console.debug(msg, ctx),
217
+ info: (msg, ctx) => console.info(msg, ctx),
218
+ warn: (msg, ctx) => console.warn(msg, ctx),
219
+ error: (msg, ctx) => console.error(msg, ctx),
220
+ },
221
+ });
222
+ ```
223
+
224
+ Never log API keys, Bearer tokens, or private keys.
225
+
226
+ ---
227
+
228
+ ## 4. Frontend / SPA notes
229
+
230
+ - Do not ship issued API keys in public browser bundles.
231
+ - Prefer a backend proxy for agent credentials.
232
+ - Keep `refreshWatchdog` / `restoreObjective` loops on the server.
233
+ - Browser operator UX is the utility app (wallet session), not the SDK agent path.
234
+
235
+ ---
236
+
237
+ ## 5. Troubleshooting
238
+
239
+ | Symptom | Likely cause | Fix |
240
+ | --- | --- | --- |
241
+ | 401 invalid key | Wrong / paused / revoked key | Rotate in Developers |
242
+ | 401 need issued key | Env bootstrap key alone | Use an issued Developers key |
243
+ | Vault empty / cannot restore | No vault capital | `prepareVaultDeposit` → broadcast → sync |
244
+ | Update rejects symbol/mode | Locked at create | Recreate objective |
245
+ | Restore receipt `staged` | Ledger-local path | Do not claim on-chain |
246
+ | Health still violated after restore | Prices / sizing / liquidity | Re-read plan, vault balances, timeline |
247
+ | Network / timeout | RPC or API latency | Raise `timeoutMs`, set `maxRetries` |
248
+
249
+ ---
250
+
251
+ ## 6. Related docs
252
+
253
+ - [Auth](./auth.md)
254
+ - [Architecture](./architecture.md)
255
+ - [Client API](./client-api.md)
256
+ - [Error model](./error-model.md)
257
+ - [Security](./security.md)
package/docs/security.md CHANGED
@@ -1,74 +1,120 @@
1
- # Security Model and Practices
2
-
3
- This document outlines the security architecture of `@buildaureon/sdk`, its integration with Smart Vault smart contracts, and practices for secure production environments.
4
-
5
- ---
6
-
7
- ## 1. Gateway Trust Boundaries
8
-
9
- AUREON operates on a non-custodial gateway model. The API acts as an analytical policy engine, price indexer, and coordinator, but does not control asset custody.
10
-
11
- ```mermaid
12
- flowchart TD
13
- Host[Host Application Boundary] -->|1. Request Calldata| Gateway[Aureon API Gateway]
14
- Gateway -->|2. Generate Unsigned Steps| Host
15
- Host -->|3. Sign Locally| Wallet[Private Key / HSM / KMS]
16
- Wallet -->|4. Broadcast Tx| Chain[Robinhood Chain RPC]
17
-
18
- subgraph OnChain [Smart Contract Controls]
19
- Vault[Smart Vault Contract]
20
- DX[Decentralized Exchanges]
21
- Vault -->|Only allowlisted actions| DX
22
- end
23
- Wallet -.->|Call deposit / withdraw| Vault
24
- ```
25
-
26
- ### 1.1 Private Key Isolation
27
- The SDK provides no features for loading or storing private keys or mnemonics. The host application handles transaction signing locally using EIP-191 signatures or raw transaction serializers. Because private keys are never transmitted to the AUREON API, a gateway breach cannot compromise user keys.
28
-
29
- ### 1.2 Unsigned Calldata Generation
30
- Endpoints like `prepareVaultDeposit` and `prepareVaultWithdraw` return structured calldata. You can decode and verify this data against open-source contract ABIs before signing and broadcasting.
31
-
32
- ---
33
-
34
- ## 2. Smart Contract Access Control
35
-
36
- The AUREON Smart Vault contracts on the Robinhood Chain enforce strict permission boundaries:
37
-
38
- * **Owner Gate**: Only the address that deployed the vault (or was assigned ownership) can execute direct withdrawals.
39
- * **Allowlisted Keepers**: Swap routes can only be executed by registered keeper addresses. The keeper cannot withdraw tokens to external third-party addresses; they are restricted to swapping allowlisted assets within the vault.
40
- * **Limits and Slippage**: The contracts enforce maximum slippage tolerances on swaps to prevent sandwich attacks and price manipulation.
41
-
42
- ---
43
-
44
- ## 3. Credentials and API Keys Management
45
-
46
- * **Zero Commits**: Never check API keys into git repositories. Load keys from environment variables or secure stores (e.g. AWS Secrets Manager, HashiCorp Vault).
47
- * **CI/CD Configuration**: If you run tests in automated pipelines (e.g., GitHub Actions, GitLab CI), store credentials as encrypted secrets.
48
- * **Frontend Mitigation**: Frontends should query an intermediate backend service instead of exposing API keys directly to the client bundle.
49
- * **Key Rotation**: Generate replacement credentials and deprecate compromised tokens in the developer console immediately if a breach is suspected.
50
-
51
- ---
52
-
53
- ## 4. Understanding Staged Settlement
54
-
55
- AUREON receipts contain a `settlement` field:
56
-
57
- * **Vault Settlement (`vault`)**: Transactions are settled on-chain on the Robinhood Chain. These have a real transaction hash and are verifiable via explorer.
58
- * **Staged Settlement (`staged`)**: Simulated rebalances that update gateway database states without broadcasting transactions. This is used during rehearsals and testing.
59
-
60
- > [!WARNING]
61
- > Do not display staged rebalances as completed on-chain transactions in your dashboards. Always check the `settlement` attribute before presenting transaction confirmations to operators.
62
-
63
- ---
64
-
65
- ## 5. Production Checklist
66
-
67
- Review this security checklist before deploying your rebalancing daemon to production:
68
-
69
- - [ ] **Private Key Isolation**: Confirm that private keys are stored in environment variables or KMS, and are never logged or exposed.
70
- - [ ] **EIP-191 Handshake**: Ensure all user logins use the cryptographic challenge-response flow (`verifyWallet`).
71
- - [ ] **Scope Checks**: Verify that the API Key has the minimum permissions needed to run the target agent.
72
- - [ ] **Gas Auditing**: Maintain a gas reserve on the signing wallet to cover deposit and withdrawal transactions on the Robinhood Chain.
73
- - [ ] **Staged Handling**: Confirm your user interface clearly distinguishes between staged and vault settlements.
74
- - [ ] **Slippage Bounds**: Configure appropriate slippage tolerances on objectives to prevent execution failure during market volatility.
1
+ # Security Model and Practices
2
+
3
+ Security architecture for `@buildaureon/sdk`: trust boundaries, credentials, vault signing, and production checklist.
4
+
5
+ **Automation note:** SDK agents should run **Automatic** objectives only. Manual Approve flows are utility concerns, not SDK security surface.
6
+
7
+ ---
8
+
9
+ ## 1. Gateway trust boundaries
10
+
11
+ AUREON is non-custodial. The API is a policy engine, price indexer, and coordinator. It does not hold private keys and does not broadcast owner withdrawals for you.
12
+
13
+ ```mermaid
14
+ flowchart TD
15
+ Host[Host_application] -->|1_request_calldata| Gateway[Aureon_API]
16
+ Gateway -->|2_unsigned_steps| Host
17
+ Host -->|3_sign_locally| Wallet[Private_key_or_KMS]
18
+ Wallet -->|4_broadcast| Chain[Robinhood_Chain_RPC]
19
+
20
+ subgraph OnChain [Smart_contract_controls]
21
+ Vault[Smart_Vault]
22
+ DX[Allowlisted_DEX_routes]
23
+ Vault -->|keeper_swaps_only| DX
24
+ end
25
+ Wallet -.->|owner_deposit_withdraw| Vault
26
+ ```
27
+
28
+ ### 1.1 Private key isolation
29
+
30
+ The SDK never loads, stores, or transmits private keys or mnemonics. Signing stays in the host (viem, ethers, HSM, KMS). A gateway breach cannot drain vaults by itself.
31
+
32
+ ### 1.2 Issued API keys are wallet credentials
33
+
34
+ An **issued** developer key identifies the bound wallet for control-plane operations (sync, objectives, health, restore, prepare). Treat it like a password:
35
+
36
+ - Create in utility **Developers**
37
+ - Store in env / secret manager
38
+ - Pause or revoke on leak
39
+ - Prefer one key per agent host
40
+
41
+ Env bootstrap keys on the server unlock product access only. They do **not** identify a wallet and must not be used as agent identity.
42
+
43
+ ### 1.3 Unsigned calldata
44
+
45
+ `prepareVaultDeposit` / `prepareVaultWithdraw` return structured steps. Decode against published ABIs before signing. Broadcast is always host-side.
46
+
47
+ ---
48
+
49
+ ## 2. What a compromised API key can and cannot do
50
+
51
+ | Can | Cannot |
52
+ | --- | --- |
53
+ | Read portfolio, vault, health, timeline | Sign owner deposit/withdraw txs |
54
+ | Create / update / pause Auto objectives | Withdraw vault funds to arbitrary addresses |
55
+ | Request restore plans and trigger Automatic restore coordination | Bypass vault keeper allowlists |
56
+ | Create additional developer keys under the same wallet | Recover a private key |
57
+
58
+ Keeper-driven Automatic restores execute allowlisted vault swaps. Keepers cannot send vault assets to arbitrary third parties.
59
+
60
+ ---
61
+
62
+ ## 3. Smart vault access control
63
+
64
+ - **Owner path:** deposits and withdrawals require owner-signed txs from prepare steps.
65
+ - **Keeper path:** Automatic restores use registered keepers on allowlisted routes only.
66
+ - **Slippage / limits:** vault and planner enforce execution bounds to reduce bad fills.
67
+
68
+ ---
69
+
70
+ ## 4. Settlement honesty
71
+
72
+ Every execution receipt includes `settlement`:
73
+
74
+ | Value | Meaning | UI rule |
75
+ | --- | --- | --- |
76
+ | `vault` | On-chain vault / keeper settlement with verifiable hash | May show as on-chain |
77
+ | `staged` | Ledger-local / rehearsal — not a chain settlement | Must **not** be labeled as on-chain |
78
+
79
+ Never collapse staged into “confirmed on Robinhood Chain.”
80
+
81
+ ---
82
+
83
+ ## 5. Transport and logging hygiene
84
+
85
+ - Prefer HTTPS production base URL `https://api.aureonlabs.network`.
86
+ - Do not log raw `Authorization` or `X-Aureon-Api-Key`.
87
+ - Redact prepare step calldata in public logs if it includes sensitive amounts in your threat model.
88
+ - Set `timeoutMs` / `maxRetries` deliberately for agent loops (see [transport.md](./transport.md)).
89
+
90
+ ---
91
+
92
+ ## 6. Frontend vs agent hosts
93
+
94
+ | Host | Guidance |
95
+ | --- | --- |
96
+ | Server agent / cron | Issued API key in secret store; private key in KMS if broadcasting deposits |
97
+ | Browser SPA | Do **not** embed issued API keys in public bundles; proxy through your backend |
98
+ | Operator utility | Wallet Bearer only — separate from SDK agent auth |
99
+
100
+ ---
101
+
102
+ ## 7. Production checklist
103
+
104
+ - [ ] Issued developer key (not a shared env bootstrap key) in secrets
105
+ - [ ] Private keys isolated from the API key and never logged
106
+ - [ ] Deposit/withdraw broadcast path reviewed and ABI-checked
107
+ - [ ] Automatic objectives only in SDK loops
108
+ - [ ] UI / agent summaries honor `settlement: vault | staged`
109
+ - [ ] Gas reserve on the signing wallet for owner txs
110
+ - [ ] Key rotation plan (pause/revoke in Developers)
111
+ - [ ] Error handling branches on `error.code` (see [error-model.md](./error-model.md))
112
+
113
+ ---
114
+
115
+ ## 8. Related docs
116
+
117
+ - [Auth](./auth.md)
118
+ - [Architecture](./architecture.md)
119
+ - [Integration guide](./integration-guide.md)
120
+ - [Error model](./error-model.md)