@1claw/cli 0.55.0 → 0.57.0

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
@@ -1,4 +1,4 @@
1
- # @1claw/cli (v0.53.2)
1
+ # @1claw/cli (v0.56.3)
2
2
 
3
3
  Command-line interface for [1Claw](https://1claw.xyz).
4
4
 
@@ -258,6 +258,34 @@ When a valid cache exists, `env run` uses it automatically instead of calling th
258
258
  --per-environment-guardrails '{"production":{"tx_max_value":"1.0"}}'
259
259
  ```
260
260
 
261
+ ### Graduated HITL & v0.55 guardrails (Intents API)
262
+
263
+ When Intents API is enabled, configure graduated human-in-the-loop thresholds and extended hard guardrails:
264
+
265
+ ```bash
266
+ 1claw agent create my-agent --intents-api \
267
+ --tx-approval-policy '{"require_above_native":{"ethereum":"0.1"},"require_for_new_recipients":true}' \
268
+ --typed-data-policy approve \ # EIP-712 → HITL (deny|approve)
269
+ --simulation-failure-policy approve \ # Tenderly revert → HITL
270
+ --raw-signing-policy approve \ # Raw digest → HITL (allow|deny|approve)
271
+ --tx-block-unlimited-approvals \
272
+ --tx-max-value-usd 1000 \
273
+ --tx-daily-limit-usd 5000 \
274
+ --allow-erc4337 \
275
+ --allow-eip7702 \
276
+ --address-screening-policy deny # off | deny | approve (recipient screening)
277
+
278
+ 1claw agent update <id> \
279
+ --tx-approval-policy '{"require_for_unlimited_approvals":true}' \
280
+ --clear-auto-suspended # Clear circuit-breaker suspension (owner/admin)
281
+
282
+ # Org emergency stop (owner/admin)
283
+ curl -X POST https://api.1claw.xyz/v1/org/freeze -H "Authorization: Bearer $ONECLAW_TOKEN"
284
+ curl -X POST https://api.1claw.xyz/v1/org/unfreeze -H "Authorization: Bearer $ONECLAW_TOKEN"
285
+ ```
286
+
287
+ Matching transactions return **202** `awaiting_approval` with an `approval_id`. Approve via dashboard or `1claw approval decide <id> --decision approved`.
288
+
261
289
  The CLI's `agent create` always uses `auth_method=api_key` (default; returns an `ocv_` API key). To register an `mtls` or `oidc_client_credentials` agent, use the SDK or `POST /v1/agents` directly — those auth methods don't generate an API key.
262
290
 
263
291
  All agents automatically receive an Ed25519 SSH keypair for future A2A messaging. The public key is shown in `agent get` output.
@@ -284,6 +312,48 @@ Human-controlled inter-agent delegation. Create, manage, and revoke delegation p
284
312
 
285
313
  Delegation modes: `caller` (delegate uses own credentials), `target` (delegate uses target's config), `both`.
286
314
 
315
+ ### Guardrail governance (v0.56)
316
+
317
+ Convention 6 shadow mode, revision history, and dry-run replay for agent/binding guardrail changes:
318
+
319
+ ```bash
320
+ 1claw guardrails shadow-report # Would-deny violations (owner/admin)
321
+ 1claw guardrails shadow-report --since 2026-01-01T00:00:00Z
322
+ 1claw guardrails revisions # Audit trail of guardrail edits
323
+ 1claw guardrails replay <agent-id> \
324
+ --draft-guardrails '{"tx_max_value_eth":"0.1"}' \
325
+ --days 7
326
+ ```
327
+
328
+ Widening agent or binding guardrails may return **202** with an `approval_id`. Approve via `1claw approval decide`, then resubmit with `--approval-id <uuid>` on `agent update` or `agent binding update`.
329
+
330
+ Execution bindings support Convention 6 shadow mode via `--execution-enforcement log|enforce` on `agent create` / `agent update`.
331
+
332
+ ### Agent accounts & Safe (Phase 5, v0.56)
333
+
334
+ Counterfactual Safe accounts derived from agent EOA owners. On-chain deploy/module broadcast is stubbed (501) pre-Guard audit.
335
+
336
+ ```bash
337
+ 1claw agent accounts list <agent-id>
338
+ 1claw agent accounts migrate <agent-id> --chain ethereum [--deprecate-eoa]
339
+ 1claw agent accounts deprecate-eoa <agent-id> --chain ethereum
340
+
341
+ 1claw safe module-registry ethereum # Public Guard + Zodiac addresses
342
+ 1claw safe sync-allowances # Org admin: compile allowance drift report
343
+ ```
344
+
345
+ ### Human Factor Auth (HFA, v0.56)
346
+
347
+ Step-up policies for treasury wallet send/swap/export. Configured per user via API; embedded clients call `GET /v1/treasury/wallets/auth-policy`.
348
+
349
+ ```bash
350
+ # Via API (SDK/dashboard) — not yet a dedicated CLI subcommand:
351
+ # PUT /v1/auth/human-factor-auth { "policy": { "require_passkey": true } }
352
+ # Passkey tx-assert: POST /v1/auth/passkeys/tx-assert/begin { "tx_digest", "action": "send"|"swap" }
353
+ ```
354
+
355
+ Treasury sends accept `X-Auth-Confirm` (password) or `X-Passkey-Token` (from tx-assert ceremony).
356
+
287
357
  ### Bankr dynamic key vending
288
358
 
289
359
  Lease short-lived Bankr wallet API keys from your org's partner key (`BANKR_PARTNER_KEY` on Vault). **Privileged** — agents need explicit policy on `agents/{id}/bankr/*` in `__agent-keys`. Human callers receive `api_key` once; agent tokens omit it.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAS,SAAQ,KAAK;IAEpB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,MAAM;gBAFb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAK3B;AAgBD,wBAAsB,GAAG,CAAC,CAAC,GAAG,OAAO,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GACP,OAAO,CAAC,CAAC,CAAC,CA8CZ;AAED,wBAAsB,SAAS,CAAC,CAAC,GAAG,OAAO,EACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC5D,GACP,OAAO,CAAC,CAAC,CAAC,CAEZ"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAS,SAAQ,KAAK;IAEpB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,MAAM;gBAFb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAK3B;AAgBD,wBAAsB,GAAG,CAAC,CAAC,GAAG,OAAO,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GACP,OAAO,CAAC,CAAC,CAAC,CAiDZ;AAED,wBAAsB,SAAS,CAAC,CAAC,GAAG,OAAO,EACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC5D,GACP,OAAO,CAAC,CAAC,CAAC,CAEZ"}
@@ -65,7 +65,10 @@ export async function api(path, options = {}) {
65
65
  }
66
66
  if (res.status === 204)
67
67
  return undefined;
68
- return res.json();
68
+ const text = await res.text();
69
+ if (!text)
70
+ return undefined;
71
+ return JSON.parse(text);
69
72
  }
70
73
  export async function apiNoAuth(path, options = {}) {
71
74
  return api(path, { ...options, token: "" });
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAgB,MAAM,gBAAgB,CAAC;AAEhF,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEpB;IACA;IACA;IAHX,YACW,MAAc,EACd,MAAc,EACd,IAAa;QAEpB,KAAK,CAAC,GAAG,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC;QAJvB,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAS;QAGpB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IAC3B,CAAC;CACJ;AAED,KAAK,UAAU,cAAc,CACzB,GAAa;IAEb,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA2B,CAAC;QAC1D,OAAO;YACH,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU;YACnE,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC;IACN,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;IACtC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,GAAG,CACrB,IAAY,EACZ,UAMI,EAAE;IAEN,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,EA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AAI,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4EpC,eAAO,MAAM,YAAY,SAAoD,CAAC"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsGpC,eAAO,MAAM,YAAY,SAAoD,CAAC"}
@@ -5,6 +5,14 @@ import { api, apiNoAuth } from "../client.js";
5
5
  import { requireToken, handleError } from "../middleware.js";
6
6
  import { printTable, printKeyValue, printSuccess, printJson, formatDate, resolveExpiresAt, } from "../output.js";
7
7
  import { registerAgentBindingCommands } from "./binding.js";
8
+ function mergeExecutionGuardrails(guardrails, enforcement) {
9
+ if (!enforcement)
10
+ return guardrails;
11
+ if (!["log", "enforce"].includes(enforcement)) {
12
+ throw new Error("execution-enforcement must be log or enforce");
13
+ }
14
+ return { ...(guardrails ?? {}), enforcement };
15
+ }
8
16
  export const agentCommand = new Command("agent").description("Manage agents");
9
17
  agentCommand
10
18
  .command("list")
@@ -48,6 +56,7 @@ agentCommand
48
56
  .option("--intents-api", "Enable Intents API (on-chain signing)")
49
57
  .option("--execution-intents", "Enable Execution Intents (HTTP/GraphQL proxy; Pro+ tier)")
50
58
  .option("--execution-guardrails <json>", "Agent execution guardrails JSON (allowed_hosts, allowed_binding_types, max_duration_ms, …)")
59
+ .option("--execution-enforcement <mode>", "Convention 6 shadow mode on agent execution guardrails: log or enforce")
51
60
  .option("--intents-require-tee", "Enforce TEE-only transaction signing (Business+)")
52
61
  .option("--execution-require-tee", "Enforce TEE-only execution and block all direct secret reads (Business+)")
53
62
  .option("--shroud", "Enable Shroud LLM Proxy")
@@ -65,6 +74,20 @@ agentCommand
65
74
  .option('--tx-max-per-day <n>', 'Max transactions per UTC calendar day')
66
75
  .option('--tx-overhead-budget <json>', 'Per-chain daily overhead budget JSON (e.g. {"solana":"0.5","xrp":"100"})')
67
76
  .option('--solana-ata-allowlist <addrs>', 'Comma-separated Solana addresses whose ATAs may be created', (v) => v.split(',').map(s => s.trim()))
77
+ .option('--tx-approval-policy <json>', 'Graduated tx HITL policy JSON')
78
+ .option('--typed-data-policy <mode>', 'EIP-712 escalation: deny or approve (HITL)')
79
+ .option('--simulation-failure-policy <mode>', 'Simulation failure: deny or approve (HITL)')
80
+ .option('--tx-block-unlimited-approvals', 'Block unlimited ERC-20 approvals')
81
+ .option('--tx-per-recipient-max-per-day <n>', 'Max txs to same recipient per UTC day')
82
+ .option('--tx-per-recipient-daily-limit <amount>', 'Max native spend to same recipient per day')
83
+ .option('--new-recipient-cap-native <amount>', 'Cap on first-time recipient spend (native units)')
84
+ .option('--tx-max-value-usd <amount>', 'Per-transaction USD cap')
85
+ .option('--tx-daily-limit-usd <amount>', 'Rolling 24h USD spend cap')
86
+ .option('--raw-signing-policy <mode>', 'Raw digest signing: allow, deny, or approve (HITL)')
87
+ .option('--personal-sign-policy <json>', 'personal_sign guardrails JSON')
88
+ .option('--address-screening-policy <mode>', 'Recipient screening: off, deny, or approve')
89
+ .option('--allow-erc4337', 'Allow ERC-4337 gasless UserOperations')
90
+ .option('--allow-eip7702', 'Allow EIP-7702 type-4 transactions')
68
91
  .option("--environment <env>", "Named environment tag (production, preview, development, or custom)")
69
92
  .option("--environment-locked", "Lock the environment tag after creation")
70
93
  .option("--env-auto-resolve", "Auto-fill env var resolve from agent environment tag")
@@ -79,8 +102,11 @@ agentCommand
79
102
  body.intents_api_enabled = true;
80
103
  if (opts.executionIntents)
81
104
  body.execution_intents_enabled = true;
82
- if (opts.executionGuardrails)
83
- body.execution_guardrails = JSON.parse(opts.executionGuardrails);
105
+ if (opts.executionGuardrails || opts.executionEnforcement) {
106
+ body.execution_guardrails = mergeExecutionGuardrails(opts.executionGuardrails
107
+ ? JSON.parse(opts.executionGuardrails)
108
+ : undefined, opts.executionEnforcement);
109
+ }
84
110
  if (opts.intentsRequireTee)
85
111
  body.intents_require_tee = true;
86
112
  if (opts.executionRequireTee)
@@ -121,6 +147,39 @@ agentCommand
121
147
  body.tx_overhead_budget = JSON.parse(opts.txOverheadBudget);
122
148
  if (opts.solanaAtaAllowlist)
123
149
  body.solana_ata_allowlist = opts.solanaAtaAllowlist;
150
+ if (opts.txApprovalPolicy)
151
+ body.tx_approval_policy = JSON.parse(opts.txApprovalPolicy);
152
+ if (opts.typedDataPolicy)
153
+ body.typed_data_policy = opts.typedDataPolicy;
154
+ if (opts.simulationFailurePolicy)
155
+ body.simulation_failure_policy = opts.simulationFailurePolicy;
156
+ if (opts.txBlockUnlimitedApprovals)
157
+ body.tx_block_unlimited_approvals = true;
158
+ if (opts.txPerRecipientMaxPerDay)
159
+ body.tx_per_recipient_max_per_day = parseInt(opts.txPerRecipientMaxPerDay, 10);
160
+ if (opts.txPerRecipientDailyLimit)
161
+ body.tx_per_recipient_daily_limit = opts.txPerRecipientDailyLimit;
162
+ if (opts.newRecipientCapNative)
163
+ body.new_recipient_cap_native = opts.newRecipientCapNative;
164
+ if (opts.txMaxValueUsd)
165
+ body.tx_max_value_usd = opts.txMaxValueUsd;
166
+ if (opts.txDailyLimitUsd)
167
+ body.tx_daily_limit_usd = opts.txDailyLimitUsd;
168
+ if (opts.rawSigningPolicy)
169
+ body.raw_signing_policy = opts.rawSigningPolicy;
170
+ if (opts.personalSignPolicy)
171
+ body.personal_sign_policy = JSON.parse(opts.personalSignPolicy);
172
+ if (opts.allowErc4337)
173
+ body.allow_erc4337 = true;
174
+ if (opts.allowEip7702)
175
+ body.allow_eip7702 = true;
176
+ if (opts.addressScreeningPolicy) {
177
+ const mode = opts.addressScreeningPolicy;
178
+ if (!["off", "deny", "approve"].includes(mode)) {
179
+ throw new Error("address-screening-policy must be off, deny, or approve");
180
+ }
181
+ body.address_screening_policy = { mode };
182
+ }
124
183
  if (opts.environment)
125
184
  body.environment = opts.environment;
126
185
  if (opts.environmentLocked)
@@ -445,6 +504,37 @@ agentCommand
445
504
  JSON.stringify(agent.per_chain_guardrails),
446
505
  ]);
447
506
  }
507
+ if (agent.tx_approval_policy) {
508
+ rows.push([
509
+ "Tx approval policy (HITL)",
510
+ JSON.stringify(agent.tx_approval_policy),
511
+ ]);
512
+ }
513
+ if (agent.typed_data_policy) {
514
+ rows.push(["Typed data policy", agent.typed_data_policy]);
515
+ }
516
+ if (agent.simulation_failure_policy) {
517
+ rows.push(["Simulation failure policy", agent.simulation_failure_policy]);
518
+ }
519
+ if (agent.raw_signing_policy) {
520
+ rows.push(["Raw signing policy", agent.raw_signing_policy]);
521
+ }
522
+ if (agent.tx_block_unlimited_approvals) {
523
+ rows.push(["Block unlimited approvals", "true"]);
524
+ }
525
+ if (agent.tx_max_value_usd) {
526
+ rows.push(["Max value USD", agent.tx_max_value_usd]);
527
+ }
528
+ if (agent.tx_daily_limit_usd) {
529
+ rows.push(["Daily limit USD", agent.tx_daily_limit_usd]);
530
+ }
531
+ if (agent.allow_erc4337)
532
+ rows.push(["Allow ERC-4337", "true"]);
533
+ if (agent.allow_eip7702)
534
+ rows.push(["Allow EIP-7702", "true"]);
535
+ if (agent.auto_suspended) {
536
+ rows.push(["Auto-suspended", chalk.red("yes")]);
537
+ }
448
538
  }
449
539
  rows.push(["Created by", agent.created_by]);
450
540
  rows.push(["Created", formatDate(agent.created_at, "long")]);
@@ -460,6 +550,7 @@ agentCommand
460
550
  .option("--intents-api <bool>", "Enable/disable Intents API (true/false)")
461
551
  .option("--execution-intents <bool>", "Enable/disable Execution Intents (true/false)")
462
552
  .option('--execution-guardrails <json>', 'Agent execution guardrails JSON (use "" to clear)')
553
+ .option("--execution-enforcement <mode>", "Convention 6 shadow mode on agent execution guardrails: log or enforce")
463
554
  .option("--intents-require-tee <bool>", "Enforce TEE-only transaction signing (true/false; Business+)")
464
555
  .option("--execution-require-tee <bool>", "Enforce TEE-only execution (true/false; Business+)")
465
556
  .option("--shroud <bool>", "Enable/disable Shroud LLM Proxy (true/false)")
@@ -482,6 +573,21 @@ agentCommand
482
573
  .option("--environment-locked <bool>", "Lock/unlock environment tag (true/false)")
483
574
  .option("--env-auto-resolve <bool>", "Auto-fill env var resolve from agent tag (true/false)")
484
575
  .option('--per-environment-guardrails <json>', 'Per-environment guardrail overrides JSON (use "" to clear)')
576
+ .option('--tx-approval-policy <json>', 'Graduated tx HITL policy JSON (use "" to clear)')
577
+ .option('--typed-data-policy <mode>', 'EIP-712 escalation: deny or approve (use "" to clear)')
578
+ .option('--simulation-failure-policy <mode>', 'Simulation failure: deny or approve (use "" to clear)')
579
+ .option('--tx-block-unlimited-approvals <bool>', 'Block unlimited ERC-20 approvals (true/false)')
580
+ .option('--tx-per-recipient-max-per-day <n>', 'Max txs to same recipient per UTC day (use "" to clear)')
581
+ .option('--tx-per-recipient-daily-limit <amount>', 'Per-recipient daily native limit (use "" to clear)')
582
+ .option('--new-recipient-cap-native <amount>', 'First-time recipient cap (use "" to clear)')
583
+ .option('--tx-max-value-usd <amount>', 'Per-transaction USD cap (use "" to clear)')
584
+ .option('--tx-daily-limit-usd <amount>', 'Rolling 24h USD cap (use "" to clear)')
585
+ .option('--raw-signing-policy <mode>', 'Raw digest: allow, deny, or approve')
586
+ .option('--personal-sign-policy <json>', 'personal_sign guardrails JSON (use "" to clear)')
587
+ .option('--address-screening-policy <mode>', 'Recipient screening: off, deny, or approve')
588
+ .option('--allow-erc4337 <bool>', 'Allow ERC-4337 gasless (true/false)')
589
+ .option('--allow-eip7702 <bool>', 'Allow EIP-7702 type-4 (true/false)')
590
+ .option('--clear-auto-suspended', 'Clear circuit-breaker auto-suspension (owner/admin)')
485
591
  .action(async (id, opts) => {
486
592
  try {
487
593
  requireToken();
@@ -490,11 +596,13 @@ agentCommand
490
596
  body.intents_api_enabled = opts.intentsApi === "true";
491
597
  if (opts.executionIntents !== undefined)
492
598
  body.execution_intents_enabled = opts.executionIntents === "true";
493
- if (opts.executionGuardrails !== undefined) {
494
- body.execution_guardrails =
495
- opts.executionGuardrails === ""
599
+ if (opts.executionGuardrails !== undefined || opts.executionEnforcement !== undefined) {
600
+ const parsed = opts.executionGuardrails === undefined
601
+ ? undefined
602
+ : opts.executionGuardrails === ""
496
603
  ? {}
497
604
  : JSON.parse(opts.executionGuardrails);
605
+ body.execution_guardrails = mergeExecutionGuardrails(parsed, opts.executionEnforcement);
498
606
  }
499
607
  if (opts.intentsRequireTee !== undefined)
500
608
  body.intents_require_tee = opts.intentsRequireTee === "true";
@@ -580,6 +688,77 @@ agentCommand
580
688
  ? null
581
689
  : JSON.parse(opts.perEnvironmentGuardrails);
582
690
  }
691
+ if (opts.txApprovalPolicy !== undefined) {
692
+ body.tx_approval_policy =
693
+ opts.txApprovalPolicy === ""
694
+ ? null
695
+ : JSON.parse(opts.txApprovalPolicy);
696
+ }
697
+ if (opts.typedDataPolicy !== undefined) {
698
+ body.typed_data_policy =
699
+ opts.typedDataPolicy === "" ? null : opts.typedDataPolicy;
700
+ }
701
+ if (opts.simulationFailurePolicy !== undefined) {
702
+ body.simulation_failure_policy =
703
+ opts.simulationFailurePolicy === ""
704
+ ? null
705
+ : opts.simulationFailurePolicy;
706
+ }
707
+ if (opts.txBlockUnlimitedApprovals !== undefined) {
708
+ body.tx_block_unlimited_approvals =
709
+ opts.txBlockUnlimitedApprovals === "true";
710
+ }
711
+ if (opts.txPerRecipientMaxPerDay !== undefined) {
712
+ body.tx_per_recipient_max_per_day =
713
+ opts.txPerRecipientMaxPerDay === ""
714
+ ? null
715
+ : parseInt(opts.txPerRecipientMaxPerDay, 10);
716
+ }
717
+ if (opts.txPerRecipientDailyLimit !== undefined) {
718
+ body.tx_per_recipient_daily_limit =
719
+ opts.txPerRecipientDailyLimit === ""
720
+ ? null
721
+ : opts.txPerRecipientDailyLimit;
722
+ }
723
+ if (opts.newRecipientCapNative !== undefined) {
724
+ body.new_recipient_cap_native =
725
+ opts.newRecipientCapNative === ""
726
+ ? null
727
+ : opts.newRecipientCapNative;
728
+ }
729
+ if (opts.txMaxValueUsd !== undefined) {
730
+ body.tx_max_value_usd =
731
+ opts.txMaxValueUsd === "" ? null : opts.txMaxValueUsd;
732
+ }
733
+ if (opts.txDailyLimitUsd !== undefined) {
734
+ body.tx_daily_limit_usd =
735
+ opts.txDailyLimitUsd === "" ? null : opts.txDailyLimitUsd;
736
+ }
737
+ if (opts.rawSigningPolicy !== undefined) {
738
+ body.raw_signing_policy = opts.rawSigningPolicy;
739
+ }
740
+ if (opts.personalSignPolicy !== undefined) {
741
+ body.personal_sign_policy =
742
+ opts.personalSignPolicy === ""
743
+ ? null
744
+ : JSON.parse(opts.personalSignPolicy);
745
+ }
746
+ if (opts.addressScreeningPolicy !== undefined) {
747
+ const mode = opts.addressScreeningPolicy;
748
+ if (!["off", "deny", "approve"].includes(mode)) {
749
+ throw new Error("address-screening-policy must be off, deny, or approve");
750
+ }
751
+ body.address_screening_policy = { mode };
752
+ }
753
+ if (opts.allowErc4337 !== undefined) {
754
+ body.allow_erc4337 = opts.allowErc4337 === "true";
755
+ }
756
+ if (opts.allowEip7702 !== undefined) {
757
+ body.allow_eip7702 = opts.allowEip7702 === "true";
758
+ }
759
+ if (opts.clearAutoSuspended) {
760
+ body.clear_auto_suspended = true;
761
+ }
583
762
  if (Object.keys(body).length === 0) {
584
763
  console.log(chalk.yellow("No update options provided. Use --help for available flags."));
585
764
  return;
@@ -1461,5 +1640,102 @@ delegationCommand
1461
1640
  handleError(err);
1462
1641
  }
1463
1642
  });
1643
+ const accountsCommand = agentCommand
1644
+ .command("accounts")
1645
+ .description("Agent EOA/Safe account management (Phase 5)");
1646
+ accountsCommand
1647
+ .command("list <agent-id>")
1648
+ .description("List agent accounts (EOA and Safe) per chain")
1649
+ .option("--json", "Output as JSON")
1650
+ .action(async (agentId, opts) => {
1651
+ try {
1652
+ requireToken();
1653
+ const res = await api(`/agents/${agentId}/accounts`);
1654
+ if (opts.json) {
1655
+ printJson(res.accounts);
1656
+ return;
1657
+ }
1658
+ if (!res.accounts.length) {
1659
+ console.log("No accounts provisioned for this agent.");
1660
+ return;
1661
+ }
1662
+ printTable(res.accounts, [
1663
+ { key: "chain", header: "Chain" },
1664
+ { key: "account_type", header: "Type" },
1665
+ { key: "address", header: "Address" },
1666
+ { key: "deploy_status", header: "Deploy" },
1667
+ ]);
1668
+ }
1669
+ catch (err) {
1670
+ handleError(err);
1671
+ }
1672
+ });
1673
+ accountsCommand
1674
+ .command("migrate <agent-id>")
1675
+ .description("Build EOA→Safe migration plan and provision counterfactual Safe (no on-chain broadcast)")
1676
+ .requiredOption("--chain <chain>", "Chain name (e.g. ethereum, base, sepolia)")
1677
+ .option("--deprecate-eoa", "Mark the EOA account deprecated after migration")
1678
+ .option("--json", "Output as JSON")
1679
+ .action(async (agentId, opts) => {
1680
+ try {
1681
+ requireToken();
1682
+ const body = { chain: opts.chain };
1683
+ if (opts.deprecateEoa)
1684
+ body.deprecate_eoa = true;
1685
+ const plan = await api(`/agents/${agentId}/accounts/migrate`, {
1686
+ method: "POST",
1687
+ body,
1688
+ });
1689
+ if (opts.json) {
1690
+ printJson(plan);
1691
+ return;
1692
+ }
1693
+ printKeyValue([
1694
+ ["Chain", plan.chain],
1695
+ ["Safe address", plan.safe_address],
1696
+ ["Safe version", plan.safe_version],
1697
+ ["EOA address", plan.eoa_address ?? "(none)"],
1698
+ ["Deploy status", plan.deploy_status],
1699
+ ["Roles hash", plan.roles_config_hash],
1700
+ ["Allowance hash", plan.allowance_config_hash],
1701
+ ]);
1702
+ if (plan.modules.length) {
1703
+ console.log("\nModules:", plan.modules.join(", "));
1704
+ }
1705
+ if (plan.warnings.length) {
1706
+ console.log("\nWarnings:");
1707
+ for (const w of plan.warnings)
1708
+ console.log(` • ${w}`);
1709
+ }
1710
+ printSuccess("Migration plan stored (counterfactual — deploy broadcast returns 501)");
1711
+ }
1712
+ catch (err) {
1713
+ handleError(err);
1714
+ }
1715
+ });
1716
+ accountsCommand
1717
+ .command("deprecate-eoa <agent-id> <chain>")
1718
+ .description("Mark the agent EOA account deprecated for a chain (blocks direct EOA signing path)")
1719
+ .option("--json", "Output as JSON")
1720
+ .action(async (agentId, chain, opts) => {
1721
+ try {
1722
+ requireToken();
1723
+ const row = await api(`/agents/${agentId}/accounts/${encodeURIComponent(chain)}/deprecate-eoa`, { method: "POST" });
1724
+ if (opts.json) {
1725
+ printJson(row);
1726
+ return;
1727
+ }
1728
+ printKeyValue([
1729
+ ["Chain", row.chain],
1730
+ ["Type", row.account_type],
1731
+ ["Address", row.address ?? ""],
1732
+ ["Deploy status", row.deploy_status],
1733
+ ]);
1734
+ printSuccess("EOA account marked deprecated");
1735
+ }
1736
+ catch (err) {
1737
+ handleError(err);
1738
+ }
1739
+ });
1464
1740
  registerAgentBindingCommands(agentCommand);
1465
1741
  //# sourceMappingURL=agent.js.map