Repository navigation
Conceal password dictations on the clipboard so managers don't archive them - #350
Closed
alexkroman wants to merge 7 commits into
Closed
alexkroman wants to merge 7 commits into
alexkroman wants to merge 7 commits into
Conversation
…e them (#348) A dictation into a secure field that degraded to the quiet "Copied" path was left on NSPasteboard as an unmarked string, so Maccy/Raycast/Alfred kept the secret. The session already withheld it from Recent via targetIsSecure, but the injector never received the flag. InjectorProtocol.insert now takes targetIsSecure; KeyInjector passes it to every clipboard write, and SystemClipboard marks secure writes with org.nspasteboard.ConcealedType plus TransientType. Ordinary quiet "Copied" writes stay unmarked for hand-paste, as before. Fixes #348 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pboard Match 1Password's handling of a copied password: a secure dictation's clipboard write is current-host-only (Universal Clipboard ignores the nspasteboard markers) and cleared after 90 seconds, unless something else has written to the pasteboard since — the same change-count guard the paste's restore uses, so a newer user copy survives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
alexkroman
enabled auto-merge
November 24, 2026 19:43
The release path reads targetIsSecure from the press-time AX read, but a read still blocked when the transcript came back answered nil — read as "not a password field". A target slow enough to outlast recording plus transcription could get a password remembered into Recent / stt_prompt, left unconcealed on the clipboard, and written to the developer-mode log. PressContext now records whether the read has settled, and capturedContext fails closed: an unsettled read answers a context flagged secure. That dictation is still transcribed and pasted; it just isn't remembered, logged, or left unconcealed. Co-authored-by: Alex Kroman <alex@assemblyai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…th limit The fail-closed read (#352) pushed DictationSession.swift to 407 lines and DictationSessionContextTests.swift to 431, failing swiftlint's file_length on CI. The rule moves to PressContext.releaseContext, beside the settled flag and value it reads; capturedContext now delegates to it. The self-contained failure-logging suite moves to its own file. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 24, 2026
Resolves FakeClipboard (both sides added a flag: concealed from this branch, keptForHandPaste from #351 — both kept). #351's new fallback when the ⌘V keystroke can't be built calls `write`, which here takes `concealed:`; it passes `secure` like the other two "copied" paths, so a password left for hand-paste stays concealed. New test covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexkroman
enabled auto-merge
November 24, 2026 22:29
SelectionSpeechRouterTests' tap-read test timed out on CI: with the whole suite starting at once, the main actor was contended for ~5 s, and the poll resumed past its 5 s deadline before the router's queued tasks had run. The budget only bounds a genuine hang, so it can afford to be generous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1ScLg3wRbaz6sT9vSP
The poll and the work it waits on share the main actor. On CI that actor was contended for ~5 s as the whole suite started, so a wall-clock deadline elapsed with neither side running, and SelectionSpeechRouter's tap-read test woke past it and failed before the router's queued tasks had run. A stall delays a poll as much as the work, so counting polls makes the budget immune to it, while a genuine hang still fails after at least the timeout. Replaces the earlier 30 s bump, which only narrowed the window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1ScLg3wRbaz6sT9vSP
Collaborator
Author
|
CI status on
Generated by Claude Code |
Collaborator
Author
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #348
Problem
A dictation into a secure field that degraded to the quiet Copied notice (
targetAppLost/noEditableTarget) was written toNSPasteboard.generalas a plain string — noTransientType, noConcealedType— so clipboard managers (Maccy, Raycast, Alfred) archived the secret. The session already withheld secure dictations from Recent /stt_prompt, butInjectorProtocol.insertnever receivedtargetIsSecure.Fix
InjectorProtocol.insertgainstargetIsSecure:;DictationSession.injectpassescapturedContext?.targetIsSecure == true(the same value that gates the Recent ring).replaceSelection/insertAtFocuspassfalse— no field was read for them.KeyInjector.performInsertthreads it to all three clipboard writes (activation failed, no editable target, the paste itself).ClipboardAccess.write/writeAndPrepareRestoretakeconcealed:;SystemClipboardaddsorg.nspasteboard.ConcealedTypeandTransientTypefor secure writes (some managers record Concealed-only items and merely hide them).Ordinary quiet-Copied writes are unchanged: unmarked, so a manager may keep them for hand-paste.
iPhone's
KeyboardRelayInjectorignores the flag — iOS never hands a secure field to a third-party keyboard.Secure writes also match 1Password's handling of a copied password:
prepareForNewContents(with: .currentHostOnly)keeps them off Universal Clipboard (which ignores the nspasteboard markers), and they're cleared after 90 s (SystemClipboard.concealedLifetime, 1Password's default) unless something has written to the pasteboard since — the same change-count guard as the paste's restore, so a newer user copy survives and the normal paste path (restored at 400 ms) is unaffected.Tests
SystemClipboardTests.concealedWriteExpires/concealedExpirySparesNewerCopy— the 90 s clear (shortened in tests) fires, and spares a newer copy.SystemClipboardTests.concealedWriteIsMarked— secure write carries both markers;writeOverwritesnow also asserts noConcealedType.KeyInjectorFallbackTests.secureFallbackIsConcealed(both quiet paths) andsecurePasteIsConcealed.DictationSessionContextTests— secure field reaches the injector flagged; ordinary field doesn't.🤖 Generated with Claude Code