enclave-link 0.1.0 → 0.2.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
@@ -26,6 +26,8 @@ hex saved Netflix: email, password
26
26
 
27
27
  It works out of the box with a hosted relay. No accounts, no keys to set up, nothing for the person to install.
28
28
 
29
+ The vault also takes 2FA codes and passkeys. Bring in your whole [Proton Pass](#bring-your-proton-pass-vault) vault, and the agent types the current 2FA code or [signs in with a passkey](#passkeys) whose key never leaves the vault.
30
+
29
31
  ## Set up your agent
30
32
 
31
33
  **Agents with a shell** (Claude Code, Codex, Cursor, Gemini CLI, OpenCode and [30 more](https://github.com/vercel-labs/skills)) get it as a skill:
@@ -38,7 +40,7 @@ The skill teaches the agent to send a link instead of asking in chat, and runs e
38
40
 
39
41
  **Agents that use MCP** get the same thing as tools. Add the server below, and add this line to the agent's instructions, because tools alone don't stop a model from asking in chat:
40
42
 
41
- > Never ask for a password, API key or other secret in chat. Use the enclave tools.
43
+ > When you need a password, API key or other secret, ask for it with the enclave tools rather than in chat.
42
44
 
43
45
  <details>
44
46
  <summary><b>Claude Code</b></summary>
@@ -63,7 +65,7 @@ claude mcp add enclave -- npx -y enclave-link mcp
63
65
  codex mcp add enclave -- npx -y enclave-link mcp
64
66
  ```
65
67
 
66
- Codex stops a tool after 60 seconds by default. To let `wait_for_secret` wait as long as the link lives, add this under `[mcp_servers.enclave]` in `~/.codex/config.toml`:
68
+ Codex stops a tool after 60 seconds by default. `wait_for_secret` waits up to 25 minutes a call (the agent calls it again if the person needs longer), so add this under `[mcp_servers.enclave]` in `~/.codex/config.toml`:
67
69
 
68
70
  ```toml
69
71
  tool_timeout_sec = 1800
@@ -211,7 +213,7 @@ deletes the request ────────▶ gone
211
213
  ```
212
214
 
213
215
  - **The relay can't read anything.** The key it would need never leaves the agent's computer. The public key travels in the part of the link after `#`, which browsers don't send to servers, so the relay doesn't even learn what was asked for.
214
- - **Links work once and expire.** The first answer wins, and the request is deleted as soon as the agent picks it up, or after 30 minutes.
216
+ - **Links work once and expire.** The first answer wins, and the request is deleted as soon as the agent picks it up, or after 24 hours.
215
217
  - **No polling.** `enclave wait` holds a live Convex subscription and wakes up the moment the answer lands.
216
218
 
217
219
  ## Using a secret without seeing it
@@ -232,11 +234,13 @@ A field named `passkey` holds a passkey, and the agent signs in with it in Chrom
232
234
  enclave passkey GitHub # then click the site's passkey sign-in
233
235
  ```
234
236
 
235
- `enclave passkey` arms the passkey for one sign-in, for up to 5 minutes. When the site asks for a passkey, enclave's Chrome extension hands the request to `enclave sign`, which signs it inside the vault and disarms the passkey. The private key never enters Chrome. Run it in the background, since it waits for that sign-in.
237
+ `enclave passkey` arms the passkey for one sign-in, for up to 5 minutes. When the site asks for a passkey, enclave's Chrome extension hands the request to `enclave sign`, which signs it inside the vault and disarms the passkey. The private key never enters Chrome.
236
238
 
237
239
  enclave signs the way Proton Pass does, with a signature counter of 0 every time. Sites read 0 as "this authenticator doesn't count", so a passkey keeps working from Proton and from enclave side by side.
238
240
 
239
- Install the extension once per machine. It's force-installed through Chrome's policy, so it loads in every profile:
241
+ A passkey's private key never comes out: `enclave get` and `enclave run` refuse passkey fields, and only `enclave sign` uses them.
242
+
243
+ Install the extension once per machine, from a clone of this repo, with Google Chrome on Linux. It's force-installed through Chrome's policy, so it loads in every profile:
240
244
 
241
245
  ```sh
242
246
  extension/install # signs with enclave on this machine
@@ -246,12 +250,13 @@ extension/install ssh my-server enclave sign # or with a vault on another
246
250
  ## Bring your Proton Pass vault
247
251
 
248
252
  ```sh
249
- enclave import proton <vault>
253
+ enclave import proton # every vault
254
+ enclave import proton Work # or just the ones you name
250
255
  ```
251
256
 
252
- copies every item in a [Proton Pass](https://proton.me/pass) vault in through [pass-cli](https://github.com/protonpass/pass-cli): logins, 2FA, passkeys, notes, cards, SSH keys and custom fields, one item per Proton item, named by its title. Proton keeps everything. Run it again to bring in what changed; it replaces items with the same name.
257
+ copies [Proton Pass](https://proton.me/pass) in through [pass-cli](https://github.com/protonpass/pass-cli): logins, 2FA, passkeys, notes, cards, SSH keys and custom fields, one item per Proton item, named by its title (two items with the same title get the account or a number after it). Proton keeps everything. Run it again to bring in what changed: each Proton item keeps its name across imports, a renamed one follows its new title, one you deleted in Proton leaves enclave too, and items saved by link are left alone. `~/.enclave/proton.json` remembers which item is which, by Proton's IDs and names only.
253
258
 
254
- 2FA comes in as a `totp` field, so `enclave get <name> totp` gives the current code. Passkeys come in as a `passkey` field: Proton keeps each passkey's private key in the item, and enclave unpacks it the way Proton's own [export code](https://github.com/protonpass/proton-pass-common/blob/main/proton-pass-common/src/cxf/credentials/passkey.rs) does. `ENCLAVE_PASS_CLI` names a different pass-cli, like one signed in as a Proton Pass agent.
259
+ 2FA comes in as a `totp` field, so `enclave get <name> totp` gives the current code. Passkeys come in as a `passkey` field: Proton keeps each passkey's private key in the item, and enclave unpacks it the way Proton's own [export code](https://github.com/protonpass/proton-pass-common/blob/main/proton-pass-common/src/cxf/credentials/passkey.rs) does.
255
260
 
256
261
  ## CLI
257
262
 
@@ -265,10 +270,11 @@ npm install -g enclave-link # or run any of these with npx -y enclave-link
265
270
  | `enclave wait <name>` | Waits for the answer and saves it. Exits 1 if the link expires first. |
266
271
  | `enclave run VAR=<name>/<field>… <command…>` | Runs a command with secrets in its environment, hidden in its output. |
267
272
  | `enclave get <name> <field>` | Prints a saved value, for a pipe or `$(…)`. |
273
+ | `enclave save <name> <field>` | Saves a value piped in, like a token the agent just made, without it passing through the chat. |
268
274
  | `enclave passkey <name> [field]` | Arms a saved passkey for the next sign-in on its site, through the extension. |
269
275
  | `enclave sign` | Signs a passkey request (JSON on stdin) with an armed passkey. The extension runs it. |
270
- | `enclave import proton <vault>` | Copies a Proton Pass vault in through pass-cli. |
271
- | `enclave list` | Saved names and their fields, never values. |
276
+ | `enclave import proton [vault…]` | Copies Proton Pass in through pass-cli: every vault, or the ones named. |
277
+ | `enclave list [search]` | Saved names and their fields, never values. A search matches names and websites. |
272
278
  | `enclave rm <name>` | Deletes a saved item. |
273
279
  | `enclave mcp` | Serves the tools below over MCP (stdio). |
274
280
 
@@ -282,7 +288,7 @@ npm install -g enclave-link # or run any of these with npx -y enclave-link
282
288
  | `wait_for_secret` | Returns the moment the person taps Send, with the field names it saved. |
283
289
  | `run_with_secrets` | Runs a command with secrets in its environment and hides them in the output. |
284
290
  | `sign_in_with_passkey` | Arms a saved passkey for the next sign-in on its site, then returns so the agent can click sign in. |
285
- | `list_secrets` | Names and fields, never values. |
291
+ | `list_secrets` | Names and fields, never values, optionally only those matching a name or website. |
286
292
 
287
293
  There's no tool that returns a secret's value.
288
294
 
@@ -301,7 +307,21 @@ await vault.run(["sh", "-c", 'curl -u "$EMAIL:$PASSWORD" https://example.com'],
301
307
  })
302
308
  ```
303
309
 
304
- `vault` reads `ENCLAVE_FROM`, `ENCLAVE_HOME` and `ENCLAVE_RELAY`. For anything else, `openVault({ from, home, relay })` makes one of your own. It also has `get`, `list` and `remove`, the same as the CLI.
310
+ `vault` reads `ENCLAVE_FROM`, `ENCLAVE_HOME` and `ENCLAVE_RELAY`. For anything else, `openVault({ from, home, relay, store })` makes one of your own. It also has `get`, `list` and `remove`, the same as the CLI.
311
+
312
+ Answers are saved to `~/.enclave` by default. To keep them somewhere else, pass a `store`: any object with `get`, `put`, `remove` and `names`, like your own database. For a one-time answer that's never written to disk, keep it in memory:
313
+
314
+ ```ts
315
+ const answers = new Map()
316
+ const oneTime = openVault({
317
+ store: {
318
+ get: async (name) => answers.get(name),
319
+ put: async (name, item) => void answers.set(name, item),
320
+ remove: async (name) => void answers.delete(name),
321
+ names: async () => [...answers.keys()],
322
+ },
323
+ })
324
+ ```
305
325
 
306
326
  ## Security
307
327