# Changelog

## 0.4.0 — 2026-10-12

- **The client starts one engine process per request; the separate handshake process is gone.** Since 0.3.1 the client spent an extra `secrets __serve` per process and executable on a `handshake` before its first data request, a cold Node boot paid by every short-lived caller (agents-cli dropped the same spawn from its own transport in PHNX-4082). Requests now speak protocol 2: each one names the client's `ENGINE_CONTRACT`, the engine refuses a higher contract with `ENGINE_INCOMPATIBLE` before it runs anything, and every response carries the engine's `{ contract, version }`, which the client checks. An engine that speaks only protocol 1 refuses a protocol 2 request as unsupported without running it, so an old `secrets` on PATH still never runs a data operation: registry 0.1.8, 0.3.0 and 0.3.3 engines fail with `ENGINE_INCOMPATIBLE` on reads and writes, and a refused write leaves the store without the bundle. **The client now needs an engine from this release or later**; 0.3.1 to 0.3.3 engines are refused with the upgrade hint (`npm i -g @phnx-labs/secrets-cli@latest`). The engine still answers protocol 1, unstamped, so older clients and agents-cli's own transport keep working, and a push still accepts a 0.3.1 or later receiver. `checkSecretsEngine` / `checkSecretsEngineSync` still return the handshake, now as an ordinary request. Source: `src/protocol.ts`, `src/protocol-server.ts`, `src/client.ts`, `src/engine-compat.test.ts`, `src/protocol-server.test.ts`.
- **`configureSecretsClient({ stderr })` keeps engine notices off the caller's terminal.** The engine's stderr (for example "native credential store is locked") was inherited by both the async request and the sync bridge, so it printed in the middle of a caller's own output; agents-cli logs it to a file instead. `stderr` takes `'inherit'` (the default, unchanged), `'ignore'`, an open file descriptor, or an absolute path the client appends to, creating it `0600` with its directory. It applies to every later request on both transports. Packed-client verification checks it under Node and Bun. Source: `src/client.ts`, `src/client.test.ts`, `scripts/verify-client-package.sh`, `README.md`.

## 0.3.3 — 2026-10-12

- **An unlock asks for Touch ID once.** Clicking Unlock in the AGI Menu (`secrets unlock <bundle>`) raised two sheets. The first came from listing the bundle's keychain items: under hashed service names that is a scan of every `agents-cli.` item, and its data-protection pass evaluated their biometry ACLs in a separate helper process, so it showed the generic "Agents CLI needs to authenticate to continue." sheet before the real read raised its own. On zion's unified log each unlock spawned both (`list` then `get-batch`, each with an interactive `evaluateAccessControl`). Reads now take item names from the bundle metadata alone, for one bundle and for a multi-bundle unlock. The listing added no value: every requested name is re-hashed before the read, and only declared refs reach the environment. A Touch ID device unlock in the last 5 minutes had sometimes hidden the extra sheet. Source: `src/lib/secrets/bundles.ts` (`enumerateBundleSecretItems`, `prefetchKeychainBundles`), `src/lib/secrets/bundles.prefetch.test.ts`, `src/lib/secrets/bundles.test.ts`.
- **A deliberate unlock is not refused by the read back-off.** A cancelled sheet blocks re-reads of the same items for 5 minutes so a polling caller cannot re-raise it. That also blocked the next click on Unlock, which asked for Touch ID and then failed with "is in read back-off". `secrets unlock` is now exempt; headless refusal is unchanged. Source: `src/lib/secrets/index.ts` (`assertRawKeychainReadAllowed`, `interactiveUnlock`).
- **The unlock sheet says what it unlocks.** It read "* is requesting to unlock the 'x' bundle for 7 days to unlock secrets." It now reads "secrets is requesting to unlock the 'x' bundle for 7 days.", and a multi-bundle unlock lists them: "… to unlock 3 bundles (a, b, c) for 1 day." Source: `src/lib/secrets/index.ts` (`keychainOperationPrompt`).
- **`secrets policy --hold <duration>` sets how long an unlock lasts.** The hold window was only settable by writing milliseconds to `agent.holdMs` in `secrets.yaml`. `secrets policy --hold 8h` writes it (1 minute to 30 days; `default` removes it), keeping the file's comments and other keys. `secrets policy` with no bundle shows the default policy and window, and `--json` prints `{"policy","holdMs","holdSource","minHoldMs","maxHoldMs"}` for the AGI Menu. Source: `src/commands/secrets.ts` (`parseHoldWindow`), `src/lib/state.ts` (`writeConfigValue`), `src/lib/state.test.ts`.
- **Every Touch ID-capable read is logged.** A `secrets.prompt` event records the asking command with its pid and parent pid, the helper step (`get`, `get-batch`, `list`), item count, bundle, outcome (`approved`, `missing`, `cancelled`, `failed`, `timeout`, `backoff`, `headless`) and duration, including reads refused before they could ask, which left no trace before. `secrets activity [bundle]` shows them, e.g. `touch-id get-batch 4 items · approved in 2.4s · secrets unlock (pid 4211, parent 812)`. They are not counted as uses. Source: `src/lib/secrets/index.ts` (`logKeychainPrompt`), `src/lib/secrets/audit.ts`, `src/lib/secrets/usage.ts`, `docs/secrets.md`.

## 0.3.2 — 2026-10-09

- **`secrets status --json`.** Prints `{"broker":{"running"},"holdMs","held":[{"name","keys","expiresAt","durable","survives"}]}`, metadata only, for programs that read the broker (the AGI Menu Secrets tab). `durable` is true for a hold served from its persisted session (the text output's Durable section), and `survives` is then `"sleep+reboot"` or `"restart"`; it is null for a hold in broker memory. `expiresAt` comes from the same hold map as `list --json`'s `heldExpiresAt`, so the two agree. It never starts the broker, and off macOS it prints `"running":false`, `"held":[]` and exits 0. The text output is unchanged. Source: `src/commands/secrets.ts` (`statusHeldBundles`), `src/lib/secrets/held-listing.test.ts`, `docs/secrets.md`.
- **`secrets list` shows every bundle `secrets status` reports as held.** On a Mac `status` listed `andre-estefania.supabase` as a durable hold while `list --json` omitted it. `list` enumerates keychain bundles from a per-root name index (`.cache/helpers/secrets-agent/bundle-meta-index.json`) that only learns bundles written through that root, and that Mac had three such indexes, none written after the bundle was created. `list` now checks each held name the index lacks with a silent by-name lookup and adds the ones that exist, so they also appear in later listings. Source: `src/lib/secrets/bundles.ts` (`listBundles`, `indexKnownBundles`), `src/lib/secrets/held-listing.test.ts`.

## 0.3.1 — 2026-10-09

- **Revealing a value asks for Touch ID every time on macOS, whatever the policy.** Use and reveal are now separate. A `never`-policy bundle keeps its silent use: `exec` and injection read it with no prompt, across sleep, restart and broker exits. Before, `view --reveal` and `get <bundle item>` on that bundle printed values with no prompt either, and a held `hold` bundle revealed from the broker with no prompt. Both now read a biometry-ACL'd gate item (`agents-cli.reveal-gate`, created on first use) in a fresh helper process first, so the sheet appears for each reveal (except within 5 minutes of unlocking the Mac with Touch ID, which the helper's reuse window accepts). Over SSH or in an unattended run a reveal on macOS is refused, since nobody can answer the sheet. Linux and Windows have no biometry and are unchanged. Source: `src/lib/secrets/index.ts` (`confirmRevealPresence`), `src/commands/secrets.ts`, `docs/secrets.md`.

- **Bun callers can use the public client without hanging.** JavaScript engines run under Node, and synchronous requests use a Node bridge with real private pipes. Timeout, interruption and oversized responses terminate the request's engine process group, including an in-flight SSH child. Node and Bun retain the same typed errors and bundle access checks. Packed-client verification now exercises both runtimes.
- **The default root resolves under `AGENTS_REAL_HOME` when a harness swaps HOME.** agents launches Cursor with HOME set to a per-version home and keeps the user's home in `AGENTS_REAL_HOME`. 0.3.0 resolved `~/.agents/.secrets` from HOME, so a child launched there read an empty root. A real Cursor launch reproduced it: the base child exited 0, the new child got `NOT_FOUND` and exited 1, and an explicit root still worked. `userHome()` (`AGENTS_REAL_HOME`, else the OS home) now drives the default root, the legacy roots it adopts from, `migrate --prefer ~/…` and the legacy YAML directories. HOME is not changed, so harness configuration stays isolated, and an explicit `SECRETS_HOME` still wins. The client looks for agents launcher shims under the same home. Source: `src/lib/state.ts`, `src/lib/secrets/bundles.ts`, `src/commands/secrets.ts`, `src/client.ts`, `src/client.real-home.test.ts`.
- **The client refuses an engine below its contract, before any data operation.** The 0.3.0 client ran whichever `secrets` came first via `SECRETS_BIN` or PATH. A stale 0.1.8 there speaks the same protocol but reads a different root, so a bundle the old client read came back `NOT_FOUND`. The `handshake` operation now reports `contract` (`ENGINE_CONTRACT`, 1) and `version`. The client sends it once per process and engine. An engine that reports no contract or a lower one fails with `ENGINE_INCOMPATIBLE`, which is not a transport error and carries an upgrade hint. `checkSecretsEngine` / `checkSecretsEngineSync` expose the same check. Source: `src/protocol.ts`, `src/protocol-server.ts`, `src/client.ts`, `src/engine-compat.test.ts`.
- **A push checks its receiver's contract before sending anything.** `pushBundleToHost`, `pushResolvedBundleToHost` and their async forms run the receiver's new hidden `secrets __handshake` over the same SSH path, under the same remote `SECRETS_HOME`. An older receiver gets `{ ok: false, code: 'ENGINE_INCOMPATIBLE' }` with nothing sent. The single-host forms also check before the local read. A failed connection is reported as before. Source: `src/index.ts`, `src/lib/secrets/remote.ts`, `src/lib/secrets/push.ts`, `src/lib/secrets/remote-handshake.test.ts`, `src/engine-compat.test.ts`.
- Tests no longer inherit `AGENTS_REAL_HOME` from the session running them (`scripts/vitest-setup.ts`). The loopback-sshd peer is a shared fixture, `src/lib/secrets/testdata/ssh-peer.ts`.

## 0.3.0 — 2026-10-06

- **`@phnx-labs/secrets-cli/client`: the process client for `secrets __serve`, published from this package.** agents-cli carried this client privately; other programs (such as a sessions backup that reads the `r2.backups` bundle) had no supported way to call the engine. The new subpath exports `readAndResolveBundleEnv` / `readAndResolveBundleEnvSync` with their `(name, options, context)` signature and `{ bundle, env }` result, plus `secretsRequest` / `secretsRequestSync`, `SecretsClientError`, `isSecretsClientError`, `isSecretsTransportError`, `resolveSecretsBin` and `buildServeEnv`. The fd 3 / fd 4 lifecycle, envelope checks, 8 MB limit, 65 s async and 30 s sync bounds and error codes are unchanged from the agents-cli copy. Differences: the missing-binary message points at `npm i -g @phnx-labs/secrets-cli` rather than `agents setup`, and an unset `SECRETS_HOME` stays unset so the engine uses its own default root (agents-cli forced `~/.agents`). `AGENTS_SECRETS_PASSPHRASE` is still accepted. `dist/client.js` imports only Node builtins (6 KB). `scripts/assert-pack-clean.sh` requires it, and `scripts/verify-client-package.sh` (run by `release.sh` and CI) installs the packed tarball into a clean prefix and reads a synthetic bundle through the public entry. Source: `src/client.ts`, `src/client.test.ts`, `package.json`, `scripts/bundle.sh`, `scripts/assert-pack-clean.sh`, `scripts/verify-client-package.sh`, `scripts/release.sh`.

## 0.2.1 — 2026-10-06

- Add `scripts/generate-cli-docs.sh` with `--check` and `--out-dir`, downloadable command references in PR/release-branch CI, and a freshness check that also covers releases with tests/build skipped.
- **`secrets exec` no longer reports a signal-killed child as success.** A child ended by a signal has no exit code, and `exec` turned that into 0, so a SIGTERMed `secrets exec <bundle> -- deploy` passed CI steps and `&&` chains. It now exits with the shell convention 128+N (143 for SIGTERM, 137 for SIGKILL), or 1 for an unnamed signal. Exit codes and the child's stdout pass through unchanged. Source: `src/lib/platform/process.ts` (`childExitStatus`), `src/commands/secrets.ts`, `src/commands/secrets.test.ts`.
- **`secrets list --json` / `secrets view --json` with several `--hosts` print one parseable document.** Before, each host's JSON followed a `── <host> ──` header line on stdout, so the output was not valid JSON, and an unreachable host appeared only on stderr. Now stdout is `{"hosts":[{"host","ok":true,"result"}|{"host","ok":false,"error"}]}`, in the order given. `result` is exactly what that host prints for a single `--host`. `error` is the ssh/exit reason plus the remote's stderr, never its stdout. Any failed host exits 1, set as the exit code rather than by exiting immediately, so a large listing (JSON or human) reaches a slow pipe reader whole instead of being cut at the 64 KB pipe buffer. A single host and the human output format are unchanged. Source: `src/commands/secrets.ts` (`browseRemote`, `hostResultsJson`), `src/commands/secrets.test.ts`, `src/commands/secrets.hosts-json.test.ts`, `README.md`.

## 0.2.0

- **The default state root is `~/.agents/.secrets`, and it adopts the stores of the two earlier roots.** Before the standalone split agents-cli ran the engine with `SECRETS_HOME=~/.agents`; the standalone then defaulted to `~/.secrets`. After an upgrade a bare `secrets` read only `~/.secrets`, so every bundle in `~/.agents/.cache/secrets` disappeared from `list` and `exec` (observed on a Linux box: about 25 bundles, including `cloudflare` and `cloudflare.com`). The first time a command finds no store at the new root, `adoptLegacyRoots` decrypts each legacy item under its own root's key and re-encrypts it under the new root's key, built in a staging directory and renamed into place. It also carries `vault.age`, `secrets.yaml` and 1Password item maps byte-for-byte, and merges pinned `known_hosts` lines and the macOS bundle-name index (without it the first `list` would run a broad keychain scan that can raise Touch ID). The legacy directories are never modified. A bundle present in both with different contents is a conflict: nothing is written, every command fails with `LegacyRootConflictError` naming it, and `secrets migrate --prefer <root>` picks the copy to adopt (the other copy stays where it is). A copy already in the new root is never overwritten. Items that do not decrypt under their root's key are reported and left behind. An explicit `SECRETS_HOME` never adopts. `secrets migrate` runs the same adoption with `--dry-run` and `--prefer`, then the legacy YAML migration (which still needs a terminal only when there is YAML to migrate). macOS Keychain items are keyed by service name, not by path, so they are unaffected. Source: `src/lib/state.ts`, `src/lib/secrets/filestore.ts`, `src/index.ts`, `src/commands/secrets.ts`, `src/lib/secrets/filestore.adopt.test.ts`.
- Adoption details. The store lock heartbeats through the scrypt work, so a concurrent first run waits instead of stealing it, and only a dead process's staging dir is swept. Adoption refuses while `SECRETS_PASSPHRASE` is set, because the new store must open under its machine-local key in every shell. A rerun completes a bundle whose adoption was interrupted, but only when its metadata matches the legacy copy, so a bundle edited in the new root is never touched. Help, version and `migrate` run during a conflict. Non-interactive `secrets migrate` now adopts and exits 0; it exits 1 only when legacy YAML bundles need the interactive prompt (before, it refused outright).
- **macOS: the downloaded keychain helper is cached under `.cache/helpers/mac-helper/`, not `.cache/secrets/mac-helper/`.** The old path sat inside the file-store dir. A first `secrets --help` would have created that dir and stopped the default root from adopting. The installed helper and its signing identity are unchanged. Source: `src/lib/secrets/download-keychain.ts`.
- **The default root ignores itself in git.** `~/.agents` is a git repository for many users, and its `.gitignore` covered `.cache/` and `.secrets-key/` but not `vault.age` or `secrets.yaml`. The root now holds a `.gitignore` of `*`, written by whichever writer first creates something under it (best effort). Source: `src/lib/state.ts`.

## 0.1.9

- **macOS: `secrets unlock a b c` asks for Touch ID once, not once per bundle.** Each bundle used to be read by its own keychain-helper process, and the helper's `LAContext` lives for one process, so every bundle raised its own sheet. A multi-bundle unlock (including `--all`) now reads each bundle's metadata silently, then every bundle's secret values in one helper call, and loads each bundle from that read. Cancelling that one sheet cancels the whole unlock. A bundle edited between the two steps is refused with "changed while it was being unlocked" rather than half-loaded. Source: `src/lib/secrets/bundles.ts` (`prefetchKeychainBundles`), `src/commands/secrets.ts`, `src/lib/secrets/bundles.prefetch.test.ts`.
- Generated command reference: `docs/command-reference.html` (sidebar command tree, search, one card per command with arguments, options, examples and notes), `docs/command-index.md` and `docs/command-index.json`, built from the registered Commander tree by `@phnx-labs/cli-docs` (`bun scripts/gen-docs.ts`). `scripts/test.sh` runs `--check` first, so a help change that was not regenerated fails tests and CI. The command tree is now built by `buildProgram()` in `src/program.ts`, which never parses argv; `src/index.ts` keeps its pre-commander intercepts and calls it. Source: `src/program.ts`, `src/index.ts`, `scripts/gen-docs.ts`, `scripts/test.sh`.

## 0.1.8

- Fix macOS `list` and `view` reporting durable grants as locked after sleep or while the broker is down. All hold displays now include persisted sessions, preserve scope distinctions in `status`, and retain the original TTL.

## 0.1.7

- **macOS: `secrets unlock` no longer pops Touch ID twice.** Bundle metadata, the HMAC key, and durable session blobs are stored no-ACL by contract so their reads stay silent, but two paths re-stamped them with the biometry ACL — `secrets migrate-acl` rewrote every item with the default ACL'd `set`, and the one-time metadata heal set a machine-wide sentinel after healing only the single bundle being unlocked, leaving every other bundle gated. A gated metadata item makes the "silent" metadata prefetch (a separate helper process / `LAContext`) pop a second sheet on top of the value read. `isSilentServiceName` (new, in `index.ts`) is now the single source of truth for no-ACL items, `migrateOneRaw` keeps them no-ACL, and the metadata heal is driven from `listBundles` over the complete bundle set so every mis-stamped bundle self-heals, not just the first one unlocked. `migrate-acl` now also skips the opaque hashed bucket (`agents-cli.h.o.<hex>`, #316), which is mixed-tier — no-ACL session blobs live there alongside biometry-ACL'd profile/raw tokens — so it can neither re-gate a session blob nor de-ACL a real credential. Source: `src/lib/secrets/index.ts`, `src/commands/secrets-migrate.ts`, `src/lib/secrets/bundles.ts`, `src/lib/secrets/index.silent-service.test.ts`.
- **`secrets status` shows durable holds, not just broker RAM.** After a sleep RAM-wipe, an idle broker exit, or a reboot, a `--durable` hold printed "no bundles held" even though its no-ACL blob still served reads silently and re-warms the broker on next access — which read as "locked again". Status now merges the durable session index (keyed by `harness:name` so scoped holds don't collapse), labeled "Durable (re-warms silently on next read)". Source: `src/commands/secrets.ts`.

## 0.1.6

- **Linux: a locked keyring can no longer hang every `secrets` call.** On a desktop session the Secret Service answers `secret-tool lookup` for a locked login keyring by raising a GUI unlock prompt and holding the call; gdm autologin never unlocks that keyring, so on an autologged-in box every op that read through to the keyring (the vault-session probe, any file-store miss) waited ~50 s before giving up — `secrets list` took 50 s and `agents setup status` timed out at 30 s. Every `secret-tool` call now runs through one bounded runner (3 s, then SIGKILL) and a timeout is handled exactly like a locked collection: the process switches to the encrypted file store and never re-probes. Source: `src/lib/secrets/linux.ts`, `src/lib/secrets/linux.test.ts`.

## 0.1.5

- `--host` accepts the address grammar shared by every Phoenix CLI (PHNX-4090): `ssh://[user@]host` or a bare `user@host` / alias, exactly as before — `vnc://`, `cdp://`, `tcp://` and every other scheme fail loud since secrets only ever speaks SSH. An SSH port on the address (`ssh://host:2222`) is rejected with a pointer to `~/.ssh/config`, so the one non-default-port path stays where every other SSH tool already looks. `secrets hosts pin` gained the same grammar for its `<target>` and `--port`. Source: `src/lib/address.ts`, `src/lib/secrets/remote.ts`, `src/commands/secrets-hosts.ts`.

## 0.1.4

- **Durable unlocks survive a broker restart.** The broker rehydrates held bundles from a fixed-name keychain index, and every writer of that index rebuilt it from a best-effort read that reported an unreachable keychain as "empty" — so the SLEEP handler (which fires while the keybag is mid-transition, several times a day on a laptop) could persist an empty index and orphan every `--durable` session blob. Observed on 2026-09-12: five unexpired durable blobs in the keychain, three entries in the index, and none of the five in `secrets status` after the broker restarted. `readIndexStrict` now distinguishes absent from unreadable; no writer persists a decision made on an unreadable index (`updateIndex`); a session blob that resolves by name is re-indexed on the hit; and the broker probes every known bundle for a global-scope blob at start, so an already-lost index is repaired instead of hiding grants until a read touches them. `secrets lock` reports an incomplete lock when the index cannot be read instead of claiming success. Source: `src/lib/secrets/session-store.ts`, `src/lib/secrets/agent.ts`, `src/commands/secrets.ts`, and their tests.
- **An agent's read raises the Touch ID sheet instead of telling the user to run `secrets unlock`.** `isHeadlessSecretsContext` treated every `agents run` launch (`terminal`, `teams`, `headless`) as headless, and `secrets exec` also went broker-only on any non-TTY stdin, so a Claude Code / Cursor tool shell always failed with "run `secrets unlock` in a terminal first" even though the user was sitting at the machine. Headless now means a sheet nobody can answer: an unattended launch (`AGENTS_RUNTIME=headless`) or no GUI login session (`launchctl managername` ≠ `Aqua`: SSH, launchd, CI). A user-driven agent gets one sheet; the hold policy keeps the bundle silent afterwards. The old `AGENTS_SECRETS_NO_PROMPT` shell export was never read by this CLI. Source: `src/lib/secrets/headless.ts`, `src/commands/secrets.ts`.
- **A prompted read persists its hold like `secrets unlock` does.** The auto-hold after a Touch ID read lived only in broker RAM, so an upgrade or crash re-prompted for every bundle the user had already unlocked by tapping a sheet. The read now asks the broker to persist the accepted load (`persist` on the `load` request): the broker writes the same session blob `unlock` does (durable under `secrets.agent.durable`) and audits `secrets.unlocked` — and only after its eviction-tombstone check, so a snapshot overtaken by a `rotate`/`delete` mid-prompt is never written back. `view --reveal`, `view --reveal --json` and `export --host` follow the same sheet rule as `exec`. Source: `src/lib/secrets/agent.ts`, `src/lib/secrets/bundles.ts`, `src/commands/secrets.ts`.

## 0.1.3

- npm ships minified `dist/index.js` + `dist/sdk.js` (bundle + mangle). TypeScript stays in git.
- `scripts/release.sh x.y.z` / `x.y.z-pre.n` is the only ship path. CI on `release/…` runs that script.

## 0.1.2

- **A push can pin the remote `secrets` to the consumer's state root (`remoteSecretsHome`), so a bundle lands where the consumer reads it.** agents-cli runs its local standalone under `SECRETS_HOME=~/.agents` (MIG-1) and reads pushed bundles from that same root on the receiving box, but every remote invocation of `pushBundleToHost` — the `import`, the read-back verify, literal restoration — ran with no env prologue, so the remote defaulted to `~/.secrets`, the import reported success, and the consumer's daemon never saw the bundle (observed 2026-09-07: zion logged `pushed __cursor__ (1 key(s)) to yosemite-m0` while the worker kept answering `no readable durable key on this box yet`; the file store is keyed per root, so the two roots cannot even share ciphertext). `PushBundleOptions.remoteSecretsHome` names that root; `remoteStateRootEnv` turns a leading `~/` into `$HOME/` (POSIX) or `$env:USERPROFILE\` (PowerShell), emitted in the expanding quote form (`SECRETS_HOME` joins `PATH` as an expanding env key), and the env rides `buildRemoteFileImportCommand`, `buildWindowsStdinImportCommand`, `remoteSecretsRaw[Async]` (`env` option) and `verifyRemoteKeychainPush[Async]`. Unset keeps today's behaviour. Source: `src/lib/secrets/push.ts`, `src/lib/secrets/remote.ts`, `src/lib/transports/ssh.ts`, and their tests.

## 0.1.1

- **Bundle names accept the reserved `__<name>__` shape, so a consumer-managed store moves through the ordinary bundle transport.** agents-cli keeps one `__<harness>__` file-backed store per harness for durable worker credentials (`CURSOR_API_KEY_<accountId>`, `OPENAI_API_KEY_<accountId>`, …) and pushes it to worker devices with the same `pushBundleToHost` every other bundle uses — which reads the store through `readAndResolveBundleEnv` and imports it remotely with `secrets import <bundle> --from - --backend file`. Both ends ran `validateBundleName`, whose pattern rejected any name starting with `_`, so every push of a `__cursor__` store failed before the SSH hop with `Invalid bundle name`, surfaced to the daemon only as `Secrets operation failed (OPERATION_FAILED)`, and no worker ever received a Cursor, Codex or Grok worker key. `BUNDLE_NAME_PATTERN` now also matches exactly `__<name>__` (a bare leading `__` is still invalid); `create`, `rename`, `add` and `describe` refuse that shape when typed by hand (`assertNotReservedShape`), since the store belongs to the consumer that manages it — a hand `rename --force` onto it would purge its items. Source: `src/lib/secrets/bundles.ts`, `src/lib/secrets/__tests__/bundles.test.ts`, `src/commands/secrets.ts`.

## 0.1.0

First standalone release, extracted from the `agents secrets` engine in
phnx-labs/agi-cli at 95562110 (plan: PHNX-3989).

- `secrets` executable with the full bundle command tree: create/add/rotate/
  remove/rename/delete, list/view/activity, exec, import/export, unlock/lock/
  status/start/stop, policy, vault, push/pull, migrate, mcp.
- Backends: macOS Keychain (Touch ID, in-memory broker), AES-256-GCM file store,
  age-encrypted vault. Existing stores are adopted in place via `SECRETS_HOME`.
- Provider references: 1Password (`op://` through the official SDK, writable
  owned items per account/vault connection) and AWS Secrets Manager (read-only,
  `jsonPointer`, `versionId`/`versionStage`), plus `env`, `file` and opt-in
  `exec` sources in the portable bundle manifest (`version: 1`).
- Private consumer pipe (`secrets __serve`, fd 3/4, versioned JSON) with a
  bundle-allowlist access policy that fails closed for scoped callers.
- `--host <target>` replaces `--device`: plain OpenSSH targets, pinned host keys,
  no multiplexed credential transport, no device registry.
- Value-free event log (`$SECRETS_HOME/.cache/events.jsonl`) backs
  `secrets activity` and per-bundle usage in `view`/`list`.
- Environment names are `SECRETS_*`: `SECRETS_HOME`, `SECRETS_PASSPHRASE`
  (file-store master key override), `SECRETS_SYNC_PASSPHRASE`,
  `SECRETS_BACKUP_PASSPHRASE`, `SECRETS_VAULT_PATH`, `SECRETS_NO_AGENT`,
  `SECRETS_NO_BROKER`, `SECRETS_SCOPE` (ambient grant scope),
  `SECRETS_CONTEXT=agent` (materialization refusal). The signed macOS keychain
  helper keeps reading its `AGENTS_KEYCHAIN_*` variables; `AGENTS_RUNTIME`,
  `AGENTS_SESSION_ID` and `CLAUDECODE` are still recognized as agent-context
  markers for the same refusal.
