@keyban/cli 0.6.0 → 0.7.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
@@ -70,8 +70,13 @@ claude mcp add keyban-agent-wallet -- npx -y @keyban/cli@latest mcp
70
70
  ```
71
71
 
72
72
  On first boot the server runs a key generation, keeps its share in the wallet's
73
- file, and registers itself on chain as a signer of that wallet using the
74
- invite key. That happens once per machine; the invite key is spent by it.
73
+ file, and registers its key on chain as the signer of that wallet using the
74
+ invite key. That happens once; the invite key is spent by it. Once the agent's
75
+ first key is registered, Keyban cannot add, replace or remove a signer of the
76
+ wallet: the wallet's contract accepts a signer change only when a signer in
77
+ place signs it, and it never removes the last signer. Keyban's admin key can
78
+ upgrade the agent wallet's contract, and an upgrade can change any of its
79
+ rules. Every upgrade is public on the blockchain.
75
80
 
76
81
  ## Configuration
77
82
 
@@ -142,7 +147,7 @@ Writing:
142
147
  | Tool | What it does |
143
148
  |---|---|
144
149
  | `use_wallet` | Drive another kept wallet: `keyban mcp` reloads its tools for it, in this server only unless `global`, which also makes it current; `keyban wallet use` always makes it current. Refused for an incomplete wallet, while a payment waits, or when `KEYBAN_WALLET_PATH` or `KEYBAN_CONFIG` names the wallet |
145
- | `sign_message` | Sign a message |
150
+ | `sign_message` | Sign a text (EIP-191): free, as often as asked, unless the wallet is paused |
146
151
  | `cancel_intent` | Cancel a pending payment intent |
147
152
  | `transfer_usdc` | Transfer USDC — moves funds |
148
153
  | `x402_pay` | Pay for an x402 resource — moves funds |
@@ -196,10 +201,15 @@ the agent: Keyban co-signs every signature and applies the wallet's policy
196
201
  first. Treat the machine account that holds the share like one that holds an
197
202
  SSH key.
198
203
 
199
- If you suspect the share or the API key leaked, rotate them: add a new signer
200
- to the wallet, set it up, then delete the old signer. Deleting it removes its
201
- key from the wallet on chain and revokes its API key, so the leaked pair can
202
- no longer sign nor reach the API. The wallet address does not change.
204
+ Neither this package nor Keyban's API replaces the agent's key once it is
205
+ registered. If you suspect the
206
+ share or the API key leaked, pause the wallet and take the funds out as
207
+ [Moving the funds out of a wallet](https://docs.keyban.io/solutions/agent-wallet/security/agent-wallets#moving-the-funds-out-of-a-wallet)
208
+ describes.
209
+
210
+ A wallet's file lost once the agent's first key is registered cannot be
211
+ recovered, by anyone, Keyban included. Lost before, it can be replaced: see
212
+ [Where the agent's share lives](https://docs.keyban.io/solutions/agent-wallet/security/agent-wallets#where-the-agents-share-lives).
203
213
 
204
214
  ## Telemetry
205
215
 
package/SKILL.md CHANGED
@@ -34,13 +34,6 @@ being authenticated on Keyban, and Keyban co-signs only what the policy allows.
34
34
  admin tools call them shared budgets). What a level keeps unallocated is its
35
35
  *free share*.
36
36
 
37
- ## Wallet or prepaid account
38
-
39
- Two kinds exist. `agent-wallet:get_account_info` tells them apart: a reply that
40
- starts with `Account: prepaid` is a prepaid account (see "Prepaid account");
41
- anything else is a wallet. This guide is about a wallet unless a section says
42
- prepaid.
43
-
44
37
  ## One MCP server, two sets of tools
45
38
 
46
39
  The local server, `npx -y @keyban/cli@latest mcp`, serves the wallet tools and,
@@ -159,13 +152,12 @@ API key and a one-shot invite key.
159
152
  ## Fund the wallet — human
160
153
 
161
154
  Funding is a human action: no tool of either server adds funds. It is not
162
- needed for a payment the Keyban welcome offer covers (see "Welcome offer"), nor
163
- on a prepaid account.
155
+ needed for a payment the Keyban welcome offer covers (see "Welcome offer").
164
156
 
165
157
  USDC on the wallet's network, sent to the address from
166
158
  `agent-wallet:get_account_info`. The wallet page in the dashboard also offers a
167
159
  card top-up (Base mainnet only, 5 to 999 EUR per purchase) and a top-up request
168
- to a teammate. Test USDC: https://faucet.circle.com/
160
+ to a teammate.
169
161
 
170
162
  The organization must also have accepted Keyban's terms (the guided setup shows
171
163
  them once the agent is connected): until then card top-ups are refused and the
@@ -181,8 +173,7 @@ welcome offer cannot pay (`policy/terms-not-accepted`).
181
173
  be paid by this wallet.
182
174
  - Only the `exact` x402 scheme is supported: a service that offers only `upto`
183
175
  cannot be paid yet.
184
- - Card top-ups: Base mainnet only. The welcome offer and prepaid accounts: Base
185
- only.
176
+ - Card top-ups and the welcome offer: Base mainnet only.
186
177
  - No native token is needed: Keyban's relayer pays the gas of a USDC transfer,
187
178
  and the seller's facilitator that of an x402 payment.
188
179
  - `KEYBAN_NETWORK` is an entry of the wallet's own file, written when the
@@ -194,7 +185,7 @@ welcome offer cannot pay (`policy/terms-not-accepted`).
194
185
 
195
186
  A new organization's first payments may be covered by a Keyban welcome offer.
196
187
 
197
- - On a wallet, `agent-wallet:balance` and `agent-wallet:get_account_info` show
188
+ - `agent-wallet:balance` and `agent-wallet:get_account_info` show
198
189
  what is left of it. On first use, report it with the balance, and do not say
199
190
  the wallet needs funding while the offer has an amount left that covers the
200
191
  payment. The offer pays a payment only when its whole price fits in what is
@@ -202,27 +193,6 @@ A new organization's first payments may be covered by a Keyban welcome offer.
202
193
  is paid entirely from the wallet, never split. When the offer can no longer
203
194
  cover a payment, `agent-wallet:x402_pay` pays from the wallet on its own;
204
195
  nothing to do.
205
- - On a prepaid account it is a welcome credit, already part of the credit that
206
- `agent-wallet:balance` reports ("Of which offered by Keyban").
207
-
208
- ## Prepaid account
209
-
210
- Only when `agent-wallet:get_account_info` starts with `Account: prepaid`;
211
- otherwise skip this section. A prepaid account has no wallet of its own: no
212
- address and no key share on this machine for you to handle. It does have a
213
- network, the one Keyban pays on, shown by `agent-wallet:get_account_info`.
214
- Keyban pays the seller of each x402 payment and debits the prepaid credit of the
215
- organization, shared by all its prepaid accounts.
216
-
217
- - The balance is that credit, in euros: `agent-wallet:balance` reports it,
218
- welcome credit included (see "Welcome offer").
219
- - Pay with `agent-wallet:x402_pay`. `agent-wallet:transfer_usdc` and
220
- `agent-wallet:sign_message` are not offered: there is nothing to sign or send
221
- from an address.
222
- - The mission tools are not offered either: missions do not run on a prepaid
223
- account yet.
224
- - "Fund the wallet" does not apply. When the credit runs out, the payment is
225
- refused with `policy/prepaid-balance-insufficient` (see the table below).
226
196
 
227
197
  ## Operate the wallet
228
198
 
@@ -244,7 +214,7 @@ organization, shared by all its prepaid accounts.
244
214
 
245
215
  A service listed "via" a gateway (e.g. Orthogonal) is paid the same way: the
246
216
  gateway collects the payment and calls the provider for you.
247
- - Send USDC (a wallet only, not a prepaid account): `agent-wallet:transfer_usdc`,
217
+ - Send USDC: `agent-wallet:transfer_usdc`,
248
218
  amount in USDC (`"1.5"`), not in base units.
249
219
 
250
220
  The policy is the user's authorization: do not ask the user to confirm a payment
@@ -324,8 +294,7 @@ wallet's USDC next to the amount required (`INSUFFICIENT`). Read
324
294
  `agent-wallet:balance`, tell the user how much is missing, and that the wallet
325
295
  needs USDC on its network, sent to the address from
326
296
  `agent-wallet:get_account_info` (see "Fund the wallet"). Do not retry in a
327
- loop, and never split the payment. A prepaid account has its own refusal,
328
- `policy/prepaid-balance-insufficient`.
297
+ loop, and never split the payment.
329
298
 
330
299
  ## Missions
331
300
 
@@ -334,7 +303,6 @@ which services may be paid and how often, how much per run, who may run it and h
334
303
  You write it as a draft and try it; a human validates the trial and an operator
335
304
  publishes it; then it runs as many times as needed, by one wallet or by many.
336
305
  Every mission tool acts on this server's own wallet: never pass a wallet id.
337
- On a prepaid account there are no mission tools: skip this section.
338
306
 
339
307
  ### When to propose one
340
308
 
@@ -571,8 +539,6 @@ that payment.
571
539
  | `policy/missing` | the wallet has no policy (403 at signing) | ask the user to open the wallet page; do not retry |
572
540
  | `policy/x402-no-exact-accept` | the seller only offers an x402 payment scheme the wallet cannot settle yet (e.g. `upto`) — a current limit of the wallet, not a budget problem | do not retry; pick another provider and tell the user |
573
541
  | `policy/x402-…` | the seller's x402 offer cannot be paid (unreachable, malformed, invalid recipient, wrong asset or chain, above `maxAmount`) | pick another provider |
574
- | `policy/prepaid-balance-insufficient` | the prepaid credit of the organization does not cover the payment; even a fraction of a cent short refuses | tell the user an admin must buy a pack in Billing → Prepaid credit; never retry or split the payment |
575
- | `policy/prepaid-payer-unavailable`, `policy/prepaid-suspended` | Keyban cannot pay prepaid payments for now | report it; do not retry |
576
542
  | `policy/terms-not-accepted` | the organization has not accepted Keyban's terms yet; the welcome offer can't pay until then | ask the user to accept the terms in the Keyban dashboard (the welcome flow shows them), then retry; do not suggest funding the wallet for this |
577
543
 
578
544
  A destination refused with `mission` as scope is the mission's list; with
@@ -595,18 +561,24 @@ threshold, and never route a payment around a destination rule.
595
561
  API key and, once the first wallet call has made it, the key share. Keep it
596
562
  like a password: any program running as the user can read it and run
597
563
  `keyban`, and any agent with access to it can ask Keyban to pay from the
598
- wallet within the policy. If the key share or the API key may have
599
- leaked, ask the user to pause the wallet now with the emergency stop, then to
600
- replace the agent's key: register a new key, install it and let it connect
601
- once, then revoke the old one; that revokes both, and the address stays. Before the
602
- agent's first connection the file also holds the invitation, which lets
603
- whoever uses it first register their own key. Neither the admin tools nor the
604
- dashboard offer these steps: they go through the Keyban API
605
- (`/v1/agent-wallets/{walletId}/signers`). What a leak gives, and what to do:
564
+ wallet within the policy. Before the agent's first connection the file also
565
+ holds the invitation, which lets whoever uses it first register their own
566
+ key. Once the agent's first key is registered, at its first connection,
567
+ Keyban cannot add, replace or remove a signer of the wallet, and no wallet
568
+ tool or admin tool changes the agent's key. Keyban's admin key can
569
+ upgrade the agent wallet's contract, and an upgrade can change any of its
570
+ rules. Every upgrade is public on the blockchain.
571
+ - If the key share or the API key may have leaked, ask the user to pause the
572
+ wallet now with the emergency stop, then to take the funds out as
573
+ https://docs.keyban.io/solutions/agent-wallet/security/agent-wallets.md#moving-the-funds-out-of-a-wallet
574
+ describes. Each of its steps is the user's to ask for, as in "Limits belong
575
+ to the user"; yours is to transfer the USDC balance to the new wallet when
576
+ the user asks. Pausing alone does not revoke the wallet's API key. What a
577
+ leak gives, and what to do:
606
578
  https://docs.keyban.io/solutions/agent-wallet/security/agent-wallets.md#what-a-leaked-credential-gives-an-attacker.
607
- A prepaid account has no key to replace: ask the user to have an admin
608
- pause the account at once, then delete it and create a new one, with a new
609
- MCP configuration.
579
+ - A wallet's file lost once the agent's first key is registered cannot be
580
+ recovered, by anyone, Keyban included. Lost before, it can be replaced:
581
+ https://docs.keyban.io/solutions/agent-wallet/security/agent-wallets.md#where-the-agents-share-lives.
610
582
  - The key share stays on the machine that generated it: reinstalling the wallet
611
583
  there works, installing it on another machine is refused (`SIGNER_DKG_ALREADY_COMPLETED`).
612
584
  - A payment fails with `FUNDING_SIGNED_BY_SERVER`: this agent wallet MCP is too
@@ -614,11 +586,6 @@ threshold, and never route a payment around a destination rule.
614
586
  - A payment fails with `FUNDING_UNAVAILABLE`: `agent-wallet:x402_pay` already
615
587
  evaluated it again once. Tell the user Keyban cannot pay this payment for
616
588
  now; do not retry.
617
- - A call fails with `FUNDING_NO_CLIENT_SIGNER`: the account is prepaid, so
618
- Keyban signs its payments and no key share lives on this machine: no DKG, no
619
- `agent-wallet:transfer_usdc`, no `agent-wallet:sign_message`. Pay with
620
- `agent-wallet:x402_pay`; if it fails with this code too, this agent wallet
621
- MCP is too old: ask the user to update it.
622
589
 
623
590
  ## Links
624
591