blindfill 0.0.0-stage → 0.1.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.
@@ -0,0 +1,373 @@
1
+ # Blindfill — architecture (v0.2, 2026-11-27)
2
+
3
+ > Let AI agents sign in to anything without ever seeing the password.
4
+
5
+ Status: alpha. M0 and M1 are implemented (see section 9 for what is built, stubbed and
6
+ unverified); passkeys (web) and the Android companion are built (M2); some features of an earlier
7
+ internal Python prototype are not built yet. Code samples below are language-neutral sketches; the real
8
+ interfaces are TypeScript (`src/backends/spi.ts`, `src/actuators/web/providers/types.ts`).
9
+
10
+ ## 1. Problem and non-goals
11
+
12
+ Agents that drive browsers or phones need to sign in. Today the options are bad:
13
+ paste the password into the prompt, hand the agent a password-manager CLI (`bw get password`
14
+ returns plaintext to the agent), or keep a bespoke credential store.
15
+
16
+ Blindfill is a **credential actuator**: it resolves a secret from a password manager and
17
+ writes it straight into the target field. The agent chooses _which account and which page_;
18
+ it never receives the value.
19
+
20
+ Non-goals: not a password manager, not a login state machine, not a captcha/2FA-by-SMS
21
+ solver, not a general remote-control tool. Multi-step flows stay with the caller (the LLM).
22
+
23
+ ## 2. Security invariants (the product)
24
+
25
+ 1. **Secrets are write-only; everything else is readable.** Fields are classed (see 2a).
26
+ No API, CLI flag or MCP tool returns a _secret-class_ field to the caller; those can only
27
+ be filled (secret -> sink). Non-secret fields (username, URIs, text custom fields, field
28
+ names, the current TOTP code) are returned normally so the agent can reason and act.
29
+ 2. **Origin/app binding.** A fill is allowed only if the item is bound to the _actual_
30
+ target identity (web origin, or Android package + signer). Binding comes from the vault
31
+ item, never from the caller.
32
+ 3. **One shot.** Fill and submit once; unknown outcome is reported, never retried.
33
+ 4. **Post-fill lock.** After a fill, the session refuses page text, DOM, screenshots and
34
+ console output until the session is stopped. Outputs are also scrubbed (raw, URL-encoded,
35
+ Base64 forms of any secret handled).
36
+ 5. **Fail closed.** Missing signer tool, ambiguous field, origin mismatch, focus change:
37
+ stop before the secret is read from the backend.
38
+ 6. **Honest limits, documented.** The secret still exists in the page DOM / app memory.
39
+ Blindfill defends against the _model and its logs_, not against a malicious page or a
40
+ compromised host. `SECURITY.md` states this up front.
41
+
42
+ ### 2a. Field classes
43
+
44
+ | Class | Examples | Agent can read? | Agent can fill? |
45
+ | ------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
46
+ | **Secret** | password, Bitwarden _Hidden_ custom fields, card number/CVV | **never** | yes (via fill) |
47
+ | **Key** | TOTP seed/otpauth URI, SSH private keys, passkey private keys | **never** | **never** (a passkey only signs; `fill` refuses with `SECRET_ACCESS`) |
48
+ | **Ephemeral** | the current TOTP code (6-8 digits, ~30 s) | **yes** (owner's decision) | yes |
49
+ | **Readable** | username, item name, URIs, _Text_/_Boolean_ custom fields, field names, folder/collection | yes | yes |
50
+ | **Notes** | free-form notes | no by default (may hold secrets); opt in per item with `blindfill.notes=readable` | no |
51
+
52
+ Notes:
53
+
54
+ - Class comes from the vault's own type (Bitwarden field type Hidden vs Text), so the owner
55
+ controls it in the normal vault UI. Unknown or untyped data defaults to Secret.
56
+ - The current TOTP code is treated exactly like a text field: readable and fillable, no
57
+ special switch (owner's decision, 2026-11-27). Only the TOTP seed is Secret. The code is
58
+ short-lived, but readability means its safety rests on target binding.
59
+ - Scrubbing (invariant 4) applies to Secret-class values only; Ephemeral codes are not
60
+ scrubbed since they are returned on purpose.
61
+
62
+ ## 3. Layers
63
+
64
+ ```
65
+ agent / human
66
+ CLI (blindfill) MCP server TS library
67
+ \ | /
68
+ +-- Core engine --+ policy, matching, grants, scrubbing, audit log
69
+ / | \
70
+ Backend SPI Actuator SPI Rule store
71
+ (secrets) (where to type) (how to type)
72
+ ```
73
+
74
+ ### 3.1 Backend SPI (where secrets live)
75
+
76
+ ```python
77
+ class Backend(Protocol):
78
+ id: str
79
+ capabilities: set[Cap] # SEARCH, TOTP, ANDROID_APPS, CUSTOM_FIELDS, WRITE
80
+ def unlock(self, ctx) -> None: ... # no interactive prompts in agent mode
81
+ def find(self, target: Target) -> list[ItemRef]: ... # metadata only
82
+ def meta(self, ref: ItemRef) -> ItemMeta: ... # name, username, uris, readable fields + values, secret fields' NAMES only
83
+ def read(self, ref, field) -> str: ... # only for Readable-class fields; raises for Secret
84
+ def open_secret(self, ref, field) -> SecretHandle: ... # handle, not str
85
+ def totp_code(self, ref) -> str: ... # Ephemeral; seed never leaves the backend
86
+ ```
87
+
88
+ - `SecretHandle` is write-once, `repr()`/`str()` raise, and offers only
89
+ `handle.into(sink)`. It zeroes its buffer after use (Buffer.fill(0) after use; a
90
+ Rust core could be stricter, see section 8).
91
+ - A backend never learns the target page content; the engine never learns more than the
92
+ handle exposes.
93
+ - Backends declare capabilities; the engine degrades gracefully (e.g. no `ANDROID_APPS` ->
94
+ phone actuator disabled for that backend).
95
+
96
+ Planned backends and support tiers:
97
+
98
+ | Tier | Meaning | Backends |
99
+ | ---------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
100
+ | **Verified** | maintainers run CI against it | `bw` (Bitwarden/Vaultwarden), `secret-service` |
101
+ | **Blind-written** | coded from the vendor docs, contract tests pass against recorded fixtures, **no live test yet** | `op` (1Password), `keepassxc-cli`, `pass`/`gopass`, `rbw`, Proton Pass CLI, `lpass`, Dashlane CLI, HashiCorp Vault KV |
102
+ | **Community-verified** | a user reported a successful live run (issue template + date + version) | promoted from blind-written |
103
+
104
+ The README carries a live **backend matrix** (tier, version tested, last confirmed). Blind
105
+ backends print a one-line "unverified backend" notice on first use and have a
106
+ `blindfill backend selftest` command that runs a _fake item_ round trip, so a volunteer can
107
+ confirm in two minutes and paste the output into an issue.
108
+
109
+ ### 3.2 Actuator SPI (where secrets are typed)
110
+
111
+ ```ts
112
+ interface Actuator {
113
+ kind: 'web' | 'android'; // later 'desktop'
114
+ identify(): Target; // observed identity, never self-reported
115
+ probe(): FieldCandidate[]; // structure only, no values
116
+ sink(field: FieldCandidate): Sink;
117
+ submit(): Outcome; // at most once
118
+ }
119
+ ```
120
+
121
+ - **Web actuator** (implemented, Playwright): the browser is obtained from a pluggable
122
+ **BrowserProvider** (`src/actuators/web/providers/`, contract in `docs/browsers.md`):
123
+ `chromium-launch` (also any Chromium-based build via `--executable` / `BLINDFILL_CHROMIUM`,
124
+ e.g. Ego Lite with an empty profile), `chromium-cdp` (loopback only), `firefox-connect`
125
+ (Playwright browser server, e.g. Camoufox; endpoint or `--endpoint-file`), and
126
+ `borrowed-page` (library API `withPage`). Providers declare capabilities such as an isolated
127
+ evaluate world, so heuristics use DOM evidence, never page globals. Observed origin comes
128
+ from the page URL and frame URL, not from the caller. Adding a browser = adding one provider
129
+ file plus its tests. A provider that cannot be attached to an already-running browser (no CDP,
130
+ no Playwright server) is not faked; Ego Lite's running instance is reached through its own CLI
131
+ instead (`ego-cli`, supported since 2026-11-28; values pass through Ego's Node runtime,
132
+ `docs/browsers.md`).
133
+ - **Android actuator** (companion APK, `android/`; host side `src/actuators/android/`): chosen
134
+ over scrcpy text injection because the system, not blindfill, attests which app is asking.
135
+ Flow: `android fill|register|passkey --item --serial` arms the companion with a one-time token over
136
+ `adb shell am broadcast` (the receiver requires `DUMP`, which only the shell holds) and listens
137
+ on a loopback port the phone reaches through `adb reverse`. When an app asks, the companion
138
+ reports its package (AssistStructure / CallingAppInfo) and the SHA-256 of its single signing
139
+ certificate (PackageManager); the host checks the package against `androidapp://` (and the
140
+ signer against `blindfill.signers` when the item has a pin; without one the package alone binds,
141
+ as in Bitwarden, SECURITY 21) before reading any secret, answers once, closes the port and
142
+ disarms. Passwords go into an autofill Dataset the user or agent selects, or, for apps that ask
143
+ Credential Manager (`GetPasswordOption`), a password entry (`PasswordActivity`). A WebView
144
+ reports the scheme and domain of its document per view node; it is accepted when the screen
145
+ shows exactly one `https` domain the item binds, whatever the app (SECURITY 22). Kind `password`
146
+ needs a single-password screen; kind `password-new` (`android register`) needs a
147
+ sign-up screen (two password fields, or one with a new-password hint) and fills the same
148
+ password into both. `item generate --android <pkg>` makes such an item. Passkeys: the companion builds clientDataJSON
149
+ for the calling app (`android:apk-key-hash:` origin) and sends only its hash; the host signs
150
+ `authData || hash` (flags UP+UV, counter 0), so the private key never reaches the phone.
151
+ Registration: `android passkey-register --rp-id` arms kind `passkey-create`; the provider offers a
152
+ create entry only for that rpId, `PasskeyCreateActivity` sends rp, user id, algorithms and the
153
+ `webauthn.create` client data hash; the host (item bound to the app and `https://<rpId>`,
154
+ no passkey; ES256 offered) makes a P-256 key, stores it, and returns a `none` attestation
155
+ (`src/core/webauthn.ts`, flags `0x5D`, zero AAGUID).
156
+ The host only arms a companion whose installed APK (read back with `pm path` +
157
+ `adb exec-out cat`, APK Signing Block v2/v3/v3.1 parsed in `apk.ts`) has exactly one signer
158
+ with the pinned release certificate (`COMPANION_SIGNER`; cached per install path +
159
+ `lastUpdateTime`); otherwise `androidOffer` returns `refused` before any secret is read. The
160
+ release APK ships in the npm package (`dist/android/blindfill-companion.apk`, built by
161
+ `release.yml` from the same `package.json` version); `blindfill android install --serial`
162
+ installs it (CLI only: installing an app and switching a phone's providers is a device-level
163
+ change a person should start, so there is no MCP tool). Build and signing: `android/README.md`.
164
+ Tested with a fake relying-party app (`tests/android-device.test.ts`, which switches the
165
+ autofill and credential provider for the run and restores them exactly) using the release APK
166
+ on a Xperia 5 II (Android 17) and an arm64 emulator (Android 16, API 36, Google APIs). Real
167
+ apps on that Xperia with a live `bw` item (2026-11-27): Threads sign-in succeeded, Instagram
168
+ partial (login result not checked); see `docs/TESTED.md`.
169
+ - Later: desktop (accessibility APIs), iOS (probably impossible without an Autofill extension).
170
+
171
+ ### 3.3 Target model
172
+
173
+ ```
174
+ web:https://accounts.example.com
175
+ android:com.instagram.android#sha256=5F:3E:... # signer pinned
176
+ ```
177
+
178
+ A `Target` is what the actuator _observed_. Matching reuses the vault's own rules:
179
+
180
+ ### 3.4 Vault item contract (no sidecar files)
181
+
182
+ Blindfill stores its metadata **inside the vault item**, following each manager's native
183
+ model, so the vault stays the single source of truth.
184
+
185
+ Bitwarden/Vaultwarden mapping:
186
+
187
+ | Need | Where in the item |
188
+ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189
+ | Web binding | `login.uris[]` with Bitwarden match types (base domain, host, starts-with, exact, regex). Default **Host** or stricter; Base-domain only if the user chose it. |
190
+ | Android app binding | extra URI `androidapp://com.instagram.android` (Bitwarden's own convention) + custom field `blindfill.signers` = comma-separated SHA-256 |
191
+ | Username / password / TOTP | `login.username`, `login.password`, `login.totp` |
192
+ | Extra fields (e.g. store ID, display name) | custom fields; names prefixed `blindfill.` are control fields, others are fillable by explicit name |
193
+ | Per-site selector overrides, multi-step hints | custom field `blindfill.rules` (small JSON, version-tagged) or Notes block fenced as ```blindfill |
194
+ | Submit policy | `blindfill.submit` = `once` (default) / `none` |
195
+ | Agent visibility | put items in a dedicated collection; membership + read-only permission is the grant |
196
+
197
+ Other managers get an equivalent mapping documented in `docs/backends/<id>.md`. Where a
198
+ backend cannot hold custom fields, rules fall back to a local `rules.d/` file keyed by item id.
199
+
200
+ ### 3.5 Rules and generality
201
+
202
+ Order of attempts, cheapest first, all one-shot and logged:
203
+
204
+ 1. Heuristic form detection (autocomplete attributes, input types, labels, ARIA) with a
205
+ confidence score; below threshold -> stop and report candidates (names only).
206
+ 2. Item-level `blindfill.rules` override.
207
+ 3. Community rule packs (`rules/sites/*.json`), reviewed and signed in the repo; always
208
+ lower priority than item rules.
209
+
210
+ No per-site state machines. Multi-page logins (username then password) are exposed as
211
+ separate `fill --fields username` / `fill --fields password` calls, so the LLM drives the
212
+ flow.
213
+
214
+ ### 3.6 Interfaces
215
+
216
+ - CLI: `blindfill login <target>`, `blindfill fill`, `blindfill item show` (readable fields only),
217
+ `blindfill totp [--fill]`, `blindfill probe`,
218
+ `blindfill backend list|selftest`, `blindfill session stop`. JSON on stdout, prompts on
219
+ stderr.
220
+ - MCP server (stdio only): `probe`, `candidates`, `item_show` (readable fields), `list_credentials`
221
+ (names, origins, field names), `totp_code`, `fill`, `fill_totp`, `profile_login`, `session_stop` and
222
+ more (see `src/mcp.ts`). No tool returns Secret-class values. Tool descriptions state the no-read contract so agents plan for it.
223
+ - TypeScript library for in-process Playwright owners.
224
+
225
+ ### 3.7 Audit and grants
226
+
227
+ - Local append-only log: time, backend, item id (not name if configured), target, fields
228
+ filled, outcome. Never values.
229
+ - Grants: for phones and for sensitive items, `blindfill grant add <item> <target>`
230
+ creates a digest the engine checks at fill time.
231
+
232
+ ### 3.8 Passkeys (web sign-in and registration built; Chromium, and Firefox/Camoufox over Marionette)
233
+
234
+ Checked against a live Vaultwarden on 2026-11-27: `bw` returns `login.fido2Credentials`
235
+ (`credentialId`, `rpId`, `keyAlgorithm` ECDSA, `keyCurve` P-256, `keyValue` PKCS8 base64url,
236
+ `userHandle`, `counter`, `discoverable`) and accepts them on `bw create item`. The data was
237
+ inserted by script, not created by a Bitwarden client, so real-client encoding is unverified.
238
+
239
+ - Built: `Engine.passkey` (CLI `passkey`, MCP `passkey_sign`). Order: item binding checked
240
+ against the page, then the item's `passkey.rpId` must equal the page host or a parent of it,
241
+ then one-shot per session+origin, then the key is read. `WebActuator.passkeyAssert` loads it into a
242
+ per-page Chromium virtual authenticator over CDP (`WebAuthn.addCredential`), clicks the
243
+ caller's structural `click` selector, waits for the first `credentialAsserted`, and removes the
244
+ authenticator. The page runs its own `navigator.credentials.get`; Chromium signs. Tested
245
+ against a fake relying party that verifies the signature (`tests/passkey.test.ts`).
246
+ - Why CDP and not page-script interception: the key stays in the browser process, never in page
247
+ JS. Firefox/Camoufox (Juggler has no WebAuthn) use Marionette instead (`firefox-connect` with a
248
+ loopback `marionette` endpoint, env `BLINDFILL_MARIONETTE`; `src/actuators/web/marionette.ts`): one
249
+ session and one browser-wide authenticator per ceremony, polled with `WebAuthn:GetCredentials` (no
250
+ events) until the counter moves or a credential appears, then removed. Firefox signs with the stored
251
+ count and then counts up, so blindfill adds stored + 1 (0 stays 0). The page is brought to the front
252
+ first: Firefox serves WebAuthn only to the focused document. Borrowed pages and Firefox without
253
+ Marionette get `UNSUPPORTED`.
254
+ - BE flag: `blindfill.passkey_be` (readable, default 1). Firefox cannot set BE, so Firefox
255
+ registrations store `0`, and BE=1 (Bitwarden-made) passkeys are still signed in Firefox, with BE=0
256
+ (owner decision 2026-11-27; a BE-checking relying party rejects them, and the result carries a
257
+ `note` to use Chromium). Waiting on Marionette `WebAuthn:SetCredentialProperties` to set BE.
258
+ Chromium (`backupEligibility`) and the Android host (flags 0x1D or 0x05) sign with the item's flag.
259
+ - While armed (up to 15 s), any frame of that page whose origin WebAuthn accepts for the rpId could
260
+ request the assertion; blindfill does not see which frame asked.
261
+ - Counter (owner decision 2026-11-27, no terminal): after a signature the engine raises the vault
262
+ counter through `Backend.raisePasskeyCounter` (bw: only `fido2Credentials[0].counter` of the same
263
+ credential id, never lowered). Chromium reports stored + 1; the Android host keeps a stored 0 at 0
264
+ (Bitwarden's rule) and otherwise signs stored + 1. Both sign with BE=BS=1 like Bitwarden clients.
265
+ The result reports `sign_count` and `counter_written_back` (plus `counter_error` on a failed write).
266
+ - Registration (owner decision 2026-11-27, no terminal, add only): `Engine.passkeyRegister` needs an
267
+ item that binds the page and holds no passkey (no opt-in since 2026-11-28); then
268
+ one-shot per session+origin. `WebActuator.passkeyCreate` adds an empty virtual authenticator,
269
+ narrows the page's next `create()` to ES256 (what an ES256-only authenticator such as Bitwarden's
270
+ picks; webauthn.io lists Ed25519 first), clicks `click`, and takes the key from
271
+ `WebAuthn.credentialAdded` into a `SecretHandle`. The engine checks rpId covers the page and the key
272
+ is P-256, then `Backend.addPasskey` (bw: Bitwarden's shape, `b64.`/GUID id, counter after creation;
273
+ refuses an item that already has one). Statuses: `registered`, `not_used`, `not_stored`,
274
+ `vault_write_failed` (the last two tell a person to delete the orphan at the relying party).
275
+ - Interop: the Bitwarden browser extension signed in on webauthn.io with a blindfill-made passkey, and
276
+ blindfill then signed in after it (counter accepted). Open: credentials created by Bitwarden clients
277
+ used by blindfill.
278
+ - Android: Credential Manager prompts need biometric/device unlock; not promised. Registration
279
+ through the companion (add only, section 3.2) is tested with the fake app on the emulator and the
280
+ Xperia: create, then sign in.
281
+
282
+ ## 4. Threat model (short)
283
+
284
+ | Threat | Handled by |
285
+ | ----------------------------------- | ---------------------------------------------------------------------------------------------------- |
286
+ | Model asks for password | no read API |
287
+ | Prompt injection from the page | origin binding from vault; caller cannot choose the target |
288
+ | Secret echoed in logs / tool output | scrubber (raw, URL-encoded, Base64), post-fill lock |
289
+ | Wrong site (phishing, redirect) | observed origin vs item URIs, Host match by default |
290
+ | Rogue app on phone | package (+ signer pin when the item has one), fail closed; WebViews by https domain (SECURITY 21–22) |
291
+ | Malicious page reads DOM | **not handled**, documented |
292
+ | Compromised host | out of scope |
293
+
294
+ ## 5. Repo layout
295
+
296
+ ```
297
+ blindfill/
298
+ src/
299
+ core/ types, field classes, SecretHandle, scrubber, audit, policy
300
+ backends/ bw, op, rbw, pass, gopass, keepassxc, secret-service, registry, selftest
301
+ _contract/ contract suite every backend must pass
302
+ actuators/
303
+ web/ dom, heuristics, session, web.ts, providers/ (browser providers)
304
+ android/ companion APK host side (index.ts) + APK Signing Block parser (apk.ts)
305
+ engine.ts config.ts library.ts (withPage) cli.ts mcp.ts harden.ts
306
+ rules.ts profiles.ts password.ts (in progress: field rules, login recipes, generator)
307
+ tests/ unit, contract, e2e on local fake sites, leak test, opt-in Firefox tests
308
+ docs/ ARCHITECTURE.md RELEASING.md browsers.md backends/
309
+ examples/ MCP config, login script
310
+ ```
311
+
312
+ ## 6. Testing strategy
313
+
314
+ - **Backend contract suite**: one test file every backend must pass against fixtures
315
+ (find, meta, open_secret->into, totp, missing item, locked vault, no secret in repr/log).
316
+ This is what makes blind-writing credible.
317
+ - **Fake sites**: local pages with traps (hidden honeypot fields, cross-origin iframe,
318
+ lookalike domain) -> must refuse.
319
+ - **Leak tests**: run fills with a canary password and grep every output, log and artifact.
320
+ - **Android**: emulator + synthetic app; real-device runs stay manual.
321
+
322
+ ## 7. Adoption plan
323
+
324
+ - Name, one-sentence promise, 20-second demo GIF (agent logs in, transcript shows no secret).
325
+ - README first screen: the no-read guarantee, install in one command (`npx -y <package>`),
326
+ the backend matrix.
327
+ - `good first backend` issues; backend template + selftest make contributions small.
328
+ - SECURITY.md with honest limits; responsible-disclosure address.
329
+ - License: MIT or Apache-2.0 (decision needed).
330
+ - Publish only after an internal run of a week on our own accounts.
331
+
332
+ ## 8. Language decision (revised 2026-11-27: TypeScript / Node)
333
+
334
+ Goal: install in one command, no toolchain explanation.
335
+
336
+ - **TypeScript on Node 20+ (chosen).** `npx -y <pkg>` is the de-facto way agents launch MCP
337
+ servers; Playwright is first class in Node; the Bitwarden CLI is itself an npm package, so
338
+ the main user already has Node. `Buffer` secrets can be zero-filled, which is better than
339
+ Python's immutable strings. The Android side needs only `adb`/`scrcpy` as external binaries.
340
+ - Python (the earlier prototype's language): `uvx` is also one command, but it needs `uv` and a
341
+ Python runtime, which most MCP users do not have. The prototype's engine is ported, not reused.
342
+ - Go/Rust single binary: easiest install and best secrecy guarantees, but Playwright is not
343
+ first class there. Revisit only if a CDP-only core is wanted.
344
+ - Keep the `SecretHandle` boundary clean so the core can later move to Rust/Go.
345
+
346
+ ## 9. Roadmap and status
347
+
348
+ - **M0 done** repo, invariants, SECURITY.md, backend/actuator SPI, contract tests, CI,
349
+ release workflow triggered by a `package.json` version bump (npm Trusted Publishing).
350
+ - **M1 done (alpha)**: `bw` backend (mock CLI and fixtures in CI; one live-vault run passed on
351
+ 2026-11-27 with throw-away items on local fake pages, see `docs/TESTED.md`), web actuator, CLI + MCP, leak test.
352
+ Blind-written and unverified: `op`, `rbw`, `pass`, `gopass`, `keepassxc`, `secret-service`.
353
+ - **M1.5 in progress** web parity with the earlier prototype: browser providers (done, Firefox/Camoufox passed
354
+ against a real Camoufox build, owner's running instance untested), field rules and profiles,
355
+ discover/diagnose/verify, registration with generated passwords, human handoff.
356
+ - **M2** passkeys (`sign`, section 3.8) for web; Android companion APK (autofill + passkey
357
+ provider) with signer pinning, tested on one device with a fake app and, on 2026-11-27, with
358
+ Threads (sign-in succeeded) and Instagram (partial).
359
+ - **M3** community verification of the blind-written backends, public release and backend matrix.
360
+ - **M4** community rule packs; desktop actuator exploration; Android saving logins typed by hand.
361
+ - Done 2026-11-28: `ego-cli`, an attach provider for the already-running Ego Lite (supported after
362
+ one outbound-traffic capture; the operation log was not checked, accepted by the owner).
363
+
364
+ ## 10. Open questions
365
+
366
+ Decided: name `blindfill`; license MIT; TypeScript/Node; TOTP code is readable like text.
367
+
368
+ 1. Rules location: item custom field vs notes vs both (validate on a real Vaultwarden item;
369
+ Bitwarden clients may truncate or hide hidden-type fields).
370
+ 2. Does Vaultwarden return `androidapp://` URIs intact for items created by the real clients?
371
+ (Created by script: returned intact; real-client check pending.)
372
+ 3. How strict the default web match should be (Host vs Base domain). Current default: Host.
373
+ 4. Passkey encoding written by real Bitwarden clients, and blindfill-made passkeys used by them.
@@ -0,0 +1,51 @@
1
+ # Releasing
2
+
3
+ Publishing is done **only** by `.github/workflows/release.yml`. It runs when a push to `main`
4
+ changes `package.json`, or when started by hand on `main`, and publishes only if the `package.json`
5
+ version is not on npm yet. No token is stored in the repository. Maintainers do not run
6
+ `npm publish` or push release tags by hand: the workflow creates the tag `v<version>` and the
7
+ GitHub Release after a successful publish.
8
+
9
+ ## One-time owner setup (npm Trusted Publishing) — done
10
+
11
+ The npm package `blindfill` trusts GitHub Actions workflow `release.yml` in `mics8128/blindfill`
12
+ (no environment). Check with `npm trust list blindfill`. Only the npm package owner can change it.
13
+
14
+ ### Fallback: long-lived token
15
+
16
+ Only if Trusted Publishing is unavailable: create a granular publish-only token for this package,
17
+ store it as the repository secret `NPM_TOKEN`, and uncomment the `env: NODE_AUTH_TOKEN` block in
18
+ `release.yml`. Rotate it, and remove it as soon as Trusted Publishing works.
19
+
20
+ ## Cutting a release
21
+
22
+ ```bash
23
+ # bump the version without a local tag, then push it to main (directly or through a merged PR)
24
+ npm version 0.1.0 --no-git-tag-version # or: npm version prerelease --preid alpha --no-git-tag-version
25
+ git commit -am "release: 0.1.0"
26
+ git push origin main
27
+ ```
28
+
29
+ The workflow then runs the full test suite on Windows (`test-windows`) and, on Linux, `npm ci`,
30
+ build, the signed Android companion (`android/release-apk.sh` with the `ANDROID_KEYSTORE_*`
31
+ secrets; fails unless `apksigner` shows the pinned certificate), lint and tests, checks that the
32
+ tarball contains `dist/android/blindfill-companion.apk`, runs
33
+ `npm publish --provenance --access public`, and finally tags `v<version>` and creates the GitHub
34
+ Release with generated notes (marked pre-release for `-alpha`/`-rc` versions).
35
+ Versions with a pre-release suffix (`-alpha.0`, `-rc.1`, …) are published under the `next`
36
+ dist-tag (`npm i blindfill@next`); plain `X.Y.Z` versions become `latest`.
37
+
38
+ If a release run fails (for example `test-windows`), nothing is published. Fix the cause on `main`,
39
+ then start the workflow again without changing the version:
40
+ `gh workflow run release.yml --ref main` (or Actions → Release → Run workflow). A run on any other
41
+ branch publishes nothing.
42
+
43
+ ## Dry run (safe, publishes nothing)
44
+
45
+ ```bash
46
+ npm ci && npm run build && npm run lint && npm test
47
+ npm publish --dry-run # lists the tarball contents, does not upload
48
+ npm pack --dry-run # same check without the registry
49
+ ```
50
+
51
+ `npm publish --dry-run` fails for pre-release versions unless you add `--tag next`.