Skip to content

feat: a saved key the agent prints is hidden before it is stored or shown - #1007

Merged
badcuban merged 2 commits into
mainfrom
feat/secret-scrubbing-2a
Nov 19, 2026
Merged

badcuban merged 2 commits into
mainfrom
feat/secret-scrubbing-2a

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

A key the user saved through a card stayed out of Threadlines' records only until the agent pulled it into view: a command printing it, a tool reading the env file, the model repeating it. From there it went into the thread's events, rows and every connected app.

This is step 2a of docs/design/secret-scrubbing.md (rev 4). Once a key is saved, Threadlines replaces it with [NAME hidden] wherever provider output would carry it into the thread, and a row says "Hid NAME in the agent's output".

  • SecretScrubber: one registry of watched values per computer, in memory only. A value is watched from the moment the user presses Save (as typed, not the env file's quoted spelling) and read back from its file at startup; it stays watched after its file goes. Values under 8 characters, or letters or digits alone, are not watched.
  • The provider hook in ProviderService.processRuntimeEvent hides whole values in every event and in the provider's raw message, and remembers what a question was shown with so its answer goes back under the original text.
  • Ingestion holds a key split across pieces where it joins them: per assistant message (by thread and message id, released just before the message completes), and per command or thinking stream before its buffer (released when the item ends). Plans, a child's answer and activities get a whole-value check where they are stored.

Reviewed by GPT-6.2-Astra in four rounds; the first two showed the provider hook couldn't know when ingestion closes a message, so Fable moved the holding into ingestion (rev 4). End to end, the recorded Codex replays check that a phrase streamed in three pieces and a child's answer joined from four never reach the store.

Throughput (scripts/bench-secret-scrubber.ts): nothing watched adds a length check; with 50 watched values a reply piece costs about 0.35 µs and a 64 KB command-output event about 0.1 ms; with 200, about 1 µs and 0.4 ms. Not compared against ingestion's own time in the same run.

Known limits, in the design doc: the provider debug logs can hold a key in pieces (agreed); a side answer stopped from outside can drop its last few held characters. Step 2b (ask_user_to_run, Threadlines' own tools, read-backs, imports, failure text) is not in this PR.

…hown

Step 2a of hiding a printed key (docs/design/secret-scrubbing.md, rev 4).
Once the user saves a key through a card, Threadlines replaces it with
[NAME hidden] wherever provider output would carry it into the thread, and
says so in a row.

- SecretScrubber: one registry of watched values per computer, in memory.
  A value is watched from the moment the user presses Save (as typed) and
  read back from its file at startup; it stays watched after its file goes.
- The provider hook in ProviderService hides whole values in every event and
  the provider's raw message, and remembers what a question was shown with so
  its answer goes back under the original text.
- Ingestion holds a key split across pieces where it joins them: per
  assistant message, and per command or thinking stream before its buffer.
  Plans, a child's answer and activities get a whole-value check where they
  are stored.
- The notice row: "Hid NAME in the agent's output", once per name per turn.

The provider debug logs can still hold a key in pieces, as agreed.
…pened message

Astra's review of the ingestion holder: a message reopened after its tail
was released could complete a key, two threads reusing a message id shared
a holder, a notice line could itself hold a watched value, a session that
ended dropped held text, a completion that repeats the message's only text
sent it twice, and a command's held tail never reached its output. The
holder is now keyed by thread and message and keeps a released tail as
already-sent text; the session end and an item's end release what is held;
the notice falls back to a neutral line. A side answer stopped from outside
can still drop its last few held characters (documented).
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 19, 2026 6:00am UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit d9d50dc Nov 19, 2026
24 checks passed
@badcuban
badcuban deleted the feat/secret-scrubbing-2a branch November 19, 2026 06:12
badcuban added a commit that referenced this pull request Nov 19, 2026
Main is the brief's squash on top of #1007, and this branch already holds
both, so the merge changes no code.

This branch was previously deployed

1 inactive deployment
Preview — 5fadd551 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant