@1claw/sdk 0.41.0 → 0.41.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.
package/README.md CHANGED
@@ -300,6 +300,54 @@ Key properties:
300
300
  - **Every transaction is audit-logged** with full calldata
301
301
  - **Revocable instantly** — set `intents_api_enabled: false` to cut off access
302
302
 
303
+ ### TEE Enforcement (Pro+)
304
+
305
+ Lock down agents so signing and execution requests **must** route through the hardware enclave (Shroud TEE). Direct Vault API calls are rejected with 403.
306
+
307
+ ```typescript
308
+ await client.agents.update(agentId, {
309
+ intents_require_tee: true, // Only signs within the hardware enclave
310
+ execution_require_tee: true, // Only runs within the hardware enclave
311
+ });
312
+ ```
313
+
314
+ When `intents_require_tee` is true:
315
+ - Transaction submit/sign requests to `api.1claw.xyz` are rejected (403)
316
+ - Agents must route through `shroud.1claw.xyz` where signing happens inside TEE memory
317
+
318
+ When `execution_require_tee` is true:
319
+ - Execute requests to `api.1claw.xyz` are rejected (403)
320
+ - All direct secret reads by the agent are blocked — forces use of Execution Intent bindings
321
+ - Agents must route through `shroud.1claw.xyz`
322
+
323
+ Both require `intents_api_enabled` / `execution_intents_enabled` to be on first.
324
+
325
+ ### Overhead Budget and Transaction Count Limits
326
+
327
+ Protect against non-value drain attacks (ATA rent drain, XRP reserve exhaustion, Tron energy drain):
328
+
329
+ ```typescript
330
+ await client.agents.update(agentId, {
331
+ tx_max_per_day: 100, // Cap transactions per UTC day
332
+ tx_overhead_budget: { // Per-chain non-value cost budgets (native units)
333
+ solana: "0.5",
334
+ xrp: "100",
335
+ ethereum: "0.01",
336
+ },
337
+ solana_ata_allowlist: [ // Only these addresses may have ATAs created
338
+ "7nYzKqAqfaGEhN6oeKCQVFjduQ9qH1dWs2gVFkNKBpQF",
339
+ ],
340
+ per_chain_guardrails: { // Per-chain overrides
341
+ solana: { max_per_day: 20, overhead_budget: "0.2", max_ata_creates_per_day: 5 },
342
+ },
343
+ });
344
+
345
+ // Check current spend:
346
+ const agent = await client.agents.get(agentId);
347
+ console.log(agent.data?.tx_count_today); // e.g. 42
348
+ console.log(agent.data?.tx_overhead_today_by_chain); // e.g. { "solana": "0.12" }
349
+ ```
350
+
303
351
  ## OIDC Federation (Anthropic WIF, GCP STS, AWS STS)
304
352
 
305
353
  `https://api.1claw.xyz` is a fully OpenID Connect–compliant issuer. External relying parties — Anthropic Workload Identity Federation, GCP STS, AWS STS, Stytch, etc. — can validate 1claw-issued JWTs by fetching:
@@ -5012,6 +5012,16 @@ export interface components {
5012
5012
  execution_guardrails?: {
5013
5013
  [key: string]: unknown;
5014
5014
  };
5015
+ /**
5016
+ * @description When true, transaction/sign requests must arrive via a TEE host (Pro+ only)
5017
+ * @default false
5018
+ */
5019
+ intents_require_tee: boolean;
5020
+ /**
5021
+ * @description When true, execute requests must arrive via TEE and all direct secret reads are blocked (Pro+ only)
5022
+ * @default false
5023
+ */
5024
+ execution_require_tee: boolean;
5015
5025
  /** @description Token contract/mint addresses this agent may interact with. Empty = unrestricted. */
5016
5026
  tx_token_allowlist?: string[];
5017
5027
  /**
@@ -5023,12 +5033,20 @@ export interface components {
5023
5033
  xrpl_allowed_tx_types?: string[];
5024
5034
  /**
5025
5035
  * @description Per-chain guardrail overrides. Keys are signing chains (ethereum, bitcoin, solana, xrp, cardano, tron).
5026
- * Each value may include max_value, daily_limit, to_allowlist, token_allowlist (legacy *_eth keys accepted).
5036
+ * Each value may include max_value, daily_limit, to_allowlist, token_allowlist, max_per_day, overhead_budget, max_ata_creates_per_day.
5027
5037
  * Strictest of global and per-chain limits wins. Daily limits apply per chain family spend, not cross-chain totals.
5028
5038
  */
5029
5039
  per_chain_guardrails?: {
5030
5040
  [key: string]: unknown;
5031
5041
  };
5042
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5043
+ tx_max_per_day?: number | null;
5044
+ /** @description Per-chain daily overhead budget in native units (e.g. {"solana":"0.5","xrp":"100"}). */
5045
+ tx_overhead_budget?: {
5046
+ [key: string]: string;
5047
+ } | null;
5048
+ /** @description Solana wallet addresses whose ATAs may be created. Empty = unrestricted. */
5049
+ solana_ata_allowlist?: string[];
5032
5050
  /**
5033
5051
  * Format: date-time
5034
5052
  * @description Optional expiration time for the agent's API key.
@@ -5069,6 +5087,18 @@ export interface components {
5069
5087
  execution_guardrails?: {
5070
5088
  [key: string]: unknown;
5071
5089
  };
5090
+ /** @description When true, transaction/sign requests must arrive via a TEE host (Pro+ only) */
5091
+ intents_require_tee?: boolean;
5092
+ /** @description When true, execute requests must arrive via TEE and all direct secret reads are blocked (Pro+ only) */
5093
+ execution_require_tee?: boolean;
5094
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5095
+ tx_max_per_day?: number | null;
5096
+ /** @description Per-chain daily overhead budget in native units. */
5097
+ tx_overhead_budget?: {
5098
+ [key: string]: string;
5099
+ } | null;
5100
+ /** @description Solana wallet addresses whose ATAs may be created. */
5101
+ solana_ata_allowlist?: string[];
5072
5102
  /**
5073
5103
  * @description Enable OIDC federation (RFC 8693 token-exchange) for this agent.
5074
5104
  * When true, the agent may call POST /v1/auth/federated-token to mint
@@ -5164,6 +5194,24 @@ export interface components {
5164
5194
  execution_guardrails?: {
5165
5195
  [key: string]: unknown;
5166
5196
  };
5197
+ /** @description When true, transaction/sign requests must arrive via a TEE host (Pro+ only) */
5198
+ intents_require_tee?: boolean;
5199
+ /** @description When true, execute requests must arrive via TEE and all direct secret reads are blocked (Pro+ only) */
5200
+ execution_require_tee?: boolean;
5201
+ /** @description Max transactions per UTC calendar day. Null = unlimited. */
5202
+ tx_max_per_day?: number | null;
5203
+ /** @description Per-chain daily overhead budget in native units. */
5204
+ tx_overhead_budget?: {
5205
+ [key: string]: string;
5206
+ } | null;
5207
+ /** @description Solana wallet addresses whose ATAs may be created. */
5208
+ solana_ata_allowlist?: string[];
5209
+ /** @description Today's transaction count (UTC calendar day). Present when intents_api_enabled. */
5210
+ tx_count_today?: number;
5211
+ /** @description Today's overhead spend by chain in native units. */
5212
+ tx_overhead_today_by_chain?: {
5213
+ [key: string]: string;
5214
+ };
5167
5215
  /**
5168
5216
  * @description Whether this agent may mint OIDC federation tokens via
5169
5217
  * POST /v1/auth/federated-token. False by default.