Repository navigation
Description
Context
Split from #1667 (maintainer ruling, 2026-10-22). G6 lists "files the user marks untrusted" as a taint source (docs/decisions/governed-writable-workers.md, "Untrusted input (G6)"), and the taint governance event already reserves source: "user_marked" (taint: kind(1, …), packages/ui-server/src/governance/events.ts:202-207). Nothing can produce it: there is no UI control, HTTP route, storage or frontmatter key for marking a file untrusted.
The other #1667 sources and enforcement are delivered through merged #2676 (8f7430cd6): the host recorder classifies a completed call's input (inputTaintSource, packages/ui-server/src/activity/ingestion-taint.ts) and records the session's first source with recordFirstTaint (packages/ui-server/src/governance/session-taint.ts); a tainted session's outward actions all ask and, on the turn proxy, its egress narrows. A user-marked file only needs to become one more input to that recorder.
Settled policy and approved interaction design
The design brief proposes one confirmed toolbar control, purple glyph-plus-word cues in the viewer/tree, files only and a warning when clearing. The maintainer has selected its Files-only v1 scope, subject to the rename and authority rulings below. The maintainer approval of 2026-10-24 selects revision 3 plus unchanged revision 2 as the design of record, including missing records, role-dependent controls, copy, failure/offline/races and focus. This does not reopen the selected policy or placement.
Maintainer rulings:
- Rename/move semantics — settled (maintainer, 2026-10-23): option B. Keep marks keyed by brain-relative path. When a marked file moves or disappears, retain its old-path mark and expose it as missing/orphaned so the user can recover by marking the new path. Do not silently discard the record and do not automatically follow renames through the journal. The new path remains unmarked until explicitly marked; this limitation must be clear. The approved list and owner-only missing-file dialog below supply the recovery surface.
- Authority — settled (maintainer, 2026-10-23): option B. An authenticated principal with existing read authorization for the file may mark it untrusted. Only the owner may clear a mark, including a retained missing/orphaned mark. Marking grants no new file access. Enforce both checks on the host; hiding a UI control is not authorization. Do not introduce a new role or widen existing principal access.
- Visible scope — settled (maintainer, 2026-10-23): option A. Files views only in v1: a toolbar control, viewer/tree cues, and a
Marked untrustedlist including missing paths. No cues on chat links or attachment rows. The list names user marks only, not every untrusted-content source. Missing records must be explicitly listed from host records rather than inferred from the current filesystem tree. List/recovery states and reader-versus-owner controls follow the approved revision-3/revision-2 criteria below.
The brief’s shell-read item is a factual check, not a policy choice: at inspected main f3c6fdc9f9c6321fda5a384cf8cfd8bf2e4846da, a bounded keyless call to the production commandTaintSource (packages/ui-server/src/activity/command-taint.ts:2-27) classifies plain and rtk proxy-wrapped cat as unclassified_command for both Bash adapters; static ls and brain search remain null (eight observed classifier results). This is source-function evidence, not full shell/worker or universal reader coverage. Copy must not claim coverage beyond qualified admitted paths, and clearing a mark must not claim to erase taint from other sources. Exact additive HTTP fields/routes are implementation design under the chosen authority rule and the existing contract policy; the suggested shape is not preapproved.
The earlier rename B, authority B and Files-only A rulings remain settled. The revision 3 addendum, together with unchanged revision 2, is now approved by the maintainer. Revision 3 supersedes the older missing-record/marker disclosure alternatives and corrects the contacted-host proxy copy; the approved controls, state, copy and focus rules are incorporated below. Both additional disclosure choices remain settled. No design or policy approval is outstanding for this brief.
- Missing-record visibility — settled (maintainer, 2026-10-23): option A, owner only. Only the owner may list or inspect retained marks for missing paths. Non-owners see only present-file marks they currently have read access to, even when they created a now-missing mark themselves. Filter missing records and their contribution to counts on the host; hiding UI rows is insufficient. Recovery and clearing of missing marks belong to the owner. Reader copy explains that moved/deleted-file marks are shown to the owner, without disclosing those paths.
- Marker identity disclosure — settled (maintainer, 2026-10-23): option A. The owner may see the marker’s principal label; other authorized readers see only the marking date. Non-owner host responses must omit marker identity/label fields rather than merely hide them in the UI. This does not widen the visibility of files or missing records. The final revision-3/revision-2 interaction approval now covers this disclosure. The current P0/security scope and native parent Epic: controlled egress, credentials and outward actions #1645 remain correct.
Scope
- A way for authorized readers to mark a brain file untrusted and for the owner to clear the mark, stored host-side (not in
brain.db, which is disposable). - When an admitted file-tool read (Claude
Read/Edit/Grep/Glob, piread_file/edit_file/grep) touches a marked file, the recorder recordstaintwithsource: "user_marked"as the session's first source if none exists. - The capabilities note's untrusted-input sentence names marked files as a source.
- Files-only v1 UI: toolbar control, viewer/tree cues and a
Marked untrustedlist. Missing paths appear only for the owner; non-owners see currently readable present marks.
Out of scope
- Marking content by type, folder glob or provider (provider routing is Epic: policy-restricted content reaches only allowed providers #1668).
- Retroactive taint for sessions that read the file before it was marked.
- Blocking reads of marked files.
- Untrusted-mark cues on chat links or attachment rows in v1.
Acceptance criteria
- Marking a fixture file and reading it in an interactive turn records
taint{ source: "user_marked" }; reading an unmarked file records nothing. A test covers both and fails with the detector removed. - The mark survives a server restart and
brain index --force, including a retained missing/orphaned old-path record. - Rename/move follows selected option B: the old-path mark persists and is discoverable as missing, the new path is not automatically marked, and the UI makes manual re-marking clear. Tests cover retained records and the absence of automatic transfer.
- Record the selected rename, authority, Files-only scope and disclosure policies in the relevant durable decision record as part of implementation; the issue/comment rulings govern until that delivery.
- Host authorization permits marking only with existing authenticated file-read access and clearing only for the owner, including missing/orphaned records. Tests cover authorized reader marking, unreadable-path refusal, non-owner clear refusal and owner clear success; direct HTTP requests cannot bypass the checks. Clearing neither grants file access nor erases existing session taint.
- Clearing the mark stops new sessions from being tainted by that file; an already tainted session stays tainted.
- Missing-record disclosure follows selected option A: direct list/detail requests and counts disclose missing marks only to the owner, including when a non-owner created the mark. Tests prove owner access and non-owner omission/refusal, with no missing paths or hidden-record counts returned to non-owners.
- The Files toolbar, viewer/tree cues and
Marked untrustedlist follow selected scope A. The owner’s list includes retained missing paths and makes manual re-marking discoverable without claiming automatic rename tracking. No chat-link/attachment cues ship in v1. - Marker attribution follows selected option A: owner responses may include the marker principal label; non-owner responses expose only the date. Direct HTTP list/detail tests prove identity fields are omitted for non-owners, rather than relying on UI hiding.
- Implement the approved revision 3 plus unchanged revision 2, including their 320px/desktop mocks, using the criteria below. The October 24 approval supersedes earlier pending-approval notes; it selects no exact HTTP route/field names. Clearing removes only this mark and never guarantees a clean session when another taint source applies.
Approved interaction and copy acceptance
- Toolbar slot: between Copy path and Share, using existing 44px IconButtons. Unmarked authorized readers/owners get
Mark untrusted; marked readers get only the cue; marked owners get pressedUntrusted: clear mark. Clear authority comes from host facts and is checked again by the host. Saving leaves the dialog open and busy; unknown lookup showsCouldn't check the untrusted markplus Retry and no mark control; unsupported servers show neither control nor extra line; forbidden/file-load failure uses the existing viewer failure without a cue. - Present marks use the existing purple unverified glyph plus the word
untrusted, never color alone. Tree rows keepflag="purple", the untrusted meta and accessible-name suffix. Owner cue/rail may show the host principal label orby you; every reader cue/rail/list has the date only, never an identity orby you. Use existing theme tokens. - A
Marked untrustedentry replaces the disabled filter in both drawer and panes and switches only the tree area to a host-record flat list. Keep an already-open viewer. Visible counts, singular/plural accessible names and empty states are principal-filtered.All filesreturns to the tree. Owner rows sort missing first, then present newest-first; reader rows contain only currently readable present files. Rows are individual buttons in a list, never a tree or nested controls. Long paths wrap and remain inert text with a full-path accessible description. - Owner list subtitle:
Files you or others marked. Doesn't list other untrusted sources.Reader subtitle:Files marked by you or others. Doesn't list other untrusted sources. Marks on moved or deleted files are shown to the owner.Reader empty copy is exactlyNo files you can open are marked untrusted./Open a file and use Mark untrusted.It does not hint at hidden counts or particular records. Owner empty copy isNo files are marked untrusted./Open a file and use Mark untrusted. - List loading uses the existing Placeholder with
Loading marked files; refusal readsThis list isn't available with your current access.; offline readsCan't reach your brain right now.plus Try again. Refetch on entry, mark/clear and window focus. A stale action refetches and announcesThe list was out of date and has been refreshed.Reader rows for moved/deleted paths disappear silently; an old-tab/deep-link read uses File not found without a mark cue/detail. - Owner-only missing rows open the approved
Missing filedialog, not a file. Explain that the path may have moved/renamed/deleted, the mark stays with the old path and will apply if a file returns, and the new path must be marked separately.Find it in Filesreturns to the tree withOpen the moved file and use Mark untrusted.;Clear old markopens its own confirmation. Readers have no missing dialog variant. - Mark confirmation title/actions:
Mark this file untrusted?, Cancel / Mark untrusted. Use the approved file-tool coverage explanation: a new chat opening the file with its file tools handles untrusted content until it ends; outward actions ask even when policy allows them; skills/instructions/memory changes are flagged in the journal. The proxy bullet is exactly:On turns that run through the egress proxy, web access is limited to the untrusted allow-list and sites this chat already contacted. Your other web rules still apply.Do not claim shell coverage, blocked reads, retroactive taint or proxy enforcement on other turns. Keep the approved reader-only owner/moved-path paragraphs from revision 3 §1. - Present clear confirmation:
Clear the untrusted mark?, Cancel / Clear mark. Copy:New chats that open this file won't be treated as untrusted because of it. Chats that already opened it stay untrusted until they end. A chat can still be untrusted for other reasons.Missing clear title/action:Clear the old mark?/Clear old mark; explain that only this old-path record is removed, the new location must be marked separately and existing chats stay tainted. - Host acknowledgement owns every visible change: no optimistic cue, pressed state or list row. Retry repeats the captured path and same mark/clear intent, never toggles it; switching files closes the dialog and sends nothing. An uncertain mark stays Checking rather than reoffering a mark, and uncertain clear keeps the marked cue until a fresh host read resolves it. Reconcile concurrent changes and revoked access from the host.
- Exact result/race announcements:
<filename> marked untrusted,Untrusted mark cleared,This file was already marked untrusted.,This mark was already cleared.Refusals retain the dialog and useYou don't have access to this file any more. Nothing was marked.orOnly the owner can clear this mark. Nothing changed.Gone-before-mark usesThere's no file at this path any more. Nothing was marked.and reloads the viewer. Preserve revision-2 unreachable, uncertain and auth-lock recovery:Couldn't reach your brain. Nothing has changed yet.,Couldn't confirm the change. Checking…, then a fresh host result orStill couldn't check. Try again.; after sign-in reload host state.
| Action | Approved focus destination |
|---|---|
| Open mark/clear confirmation | Cancel |
| Cancel / Escape | Triggering toolbar button |
| Mark succeeds, owner | Same button, now Clear |
| Mark succeeds, reader | File title, because the button disappears |
| Clear succeeds | Same button, now Mark |
| Enter list | Marked untrusted heading |
| All files | Entry row |
| Missing dialog Close | Missing row |
| Clear old mark succeeds | Next row or empty-list heading |
- One polite live region per Files surface, with no load announcement. Toolbar tab order remains reveal → title → copy → mark/clear → share → mode. List rows use Tab; tree-only j/k and its footer hint are suspended while the list shows. Buttons/rows have at least 44px effective height, long paths wrap, and dialogs stack actions where required at 320px/200% zoom. Keep both themes and existing accessible tone tokens.
- Native browser/copy proof covers owner/reader marked, unmarked, unknown, unsupported and forbidden states; host-filtered missing records/counts including the reader who originally marked the path; no reader identity/label/by-you bytes; inert hostile-looking path text; each race/uncertain reply/file-switch retry; keyboard focus and live-region text. Test 320×640 and 1440×900 in light/dark, plus 200% zoom at 320px. The exact proxy-string test fails when
already contactedis removed. Use the approved Odysseus moved Antinous letter / present Eurymachus message fixtures dated 2026-07-12.
Verification
ui-server and ui-react tests, then bun run check:pr --base origin/main.
Contract impact
Likely additive: a new HTTP route or field for the mark (CONTRACT: commit, server minor). The taint event shape is unchanged.
2026-10-23 triage at main f3c6fdc9f9c6321fda5a384cf8cfd8bf2e4846da: verified the delivered #1667 detector/first-source storage and reserved user_marked event. Native parent #1645 and P0 security scope are correct. The October 22 design prompt remains usable: placement, marked-state cues and clearing interaction still require approval; files-only scope, sticky session taint, host-side persistence and truthful proxy limitations remain binding. Clarified merged prerequisite versus pending UX. No duplicate prompt, selected design, new policy choice or readiness.
2026-10-24 triage: reconciled actual prerequisite labels with the recorded final disclosure ruling: all named policy choices are settled, while revision 3 still awaits interaction/copy approval. Replace needs: decision with needs: design; no new prompt, approval, readiness or release commitment is inferred.
2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: The latest approval packet still requests approval of revision 3 plus unchanged revision 2; it records no new policy choice or approval. Keep the implementation prerequisite as needs: design until that interaction/copy is approved. All settled authority, rename and disclosure rulings stand; no duplicate prompt is posted.
2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Folded the new explicit maintainer approval of revision 3 plus unchanged revision 2 into the active scope and acceptance criteria, including exact disclosure/copy, host-ack/race recovery, focus and browser proof. Earlier pending notes are historical. The complete brief has no own prerequisite left, so add agent-ready and contract; preserve p0/security and the absence of an invented release milestone.
Activity
schlessera commentedon Oct 22, 2026
needs: design: the detector, the event shape and the enforcement it feeds are decided (#1667). What is left is how a user marks a file untrusted and sees that it is marked: where the control lives, what a marked file looks like in the file views, and how clearing works. That is a judgement about what the user is shown, so the code cannot settle it.schlessera commentedon Oct 23, 2026
2026-10-23 triage at main
f3c6fdc9f9c6321fda5a384cf8cfd8bf2e4846da: verified the delivered #1667 detector/first-source storage and reserved user_marked event. Native parent #1645 and P0 security scope are correct. The October 22 design prompt remains usable: placement, marked-state cues and clearing interaction still require approval; files-only scope, sticky session taint, host-side persistence and truthful proxy limitations remain binding. Clarified merged prerequisite versus pending UX. No duplicate prompt, selected design, new policy choice or readiness.schlessera commentedon Oct 23, 2026
Design brief: marking a file untrusted
Answers the design prompt. Read against main
f3c6fdc9f:ViewerToolbar(packages/ui-react/src/components/files/file-viewer-frame.tsx),TreeRow(file-tree-view.tsx),FilePanes(file-panel.tsx),VALUE_CUE.purple(packages/ui-kit/src/internal/tone-cue.ts).Summary
ViewerToolbar, so it works at every width.unverifiedglyph + the word "untrusted") in two places: under the file title and on the tree row. Colour is never the only cue.1. Where the control lives
The viewer toolbar, and nowhere else in v1.
FileRowtakes a click and the fold keys. Adding a row menu just for this would create a new interaction pattern on every row.The control is a kit
IconButtonwitharia-pressed, 44×44, using theunverifiedglyph. It goes between Copy path and Share.Mark untrustedUntrusted: clear markThe name changes with the state.
aria-pressedalone would announce a "Mark untrusted, pressed" toggle, which reads wrong.Phone, 320px (drawer), not marked. The toolbar already wraps (
flex-wrap, titlebasis-[140px]). The new button sits in the first row because the title shrinks first:Phone, 320px, marked. A cue line goes under the path, inside the title block, so it wraps with the title and costs no new row of controls:
Desktop, laptop+ (panes), marked:
The evidence rail block (wide only) follows the rail's existing rule: shown only when its fact exists. It shows who marked the file and when, from the host record. It has no control of its own. The toolbar is the only place to change the mark.
2. How a marked file reads
Chipuntrusted · marked by youunder the pathunverifiedglyph + the wordFileRow flag="purple",meta="untrusted",metaTone="purple"VALUE_CUE.purple+ the wordLabel text="Untrusted" icon="unverified" tone="purple"+ who/whenThis reuses the purple "untrusted origin" meaning the kit already has. A new tone would create a second word for the same idea.
Stale and untrusted on one row.
FileRowhas oneflag. Untrusted takes the flag, and the meta carries both:untrusted · stale 38d. Stale is a hint. Untrusted changes enforcement.The tree row's accessible name gets the suffix
, untrusted, so screen readers don't depend on the meta line.3. Mark confirmation (exact copy)
This is a modal
Overlay(dialog), opened by the toolbar button. Focus goes to Cancel.What each line maps to:
After confirming, the button becomes pressed, the chip appears, and a polite live region announces
forwarded-offer.md marked untrusted. No toast.Failure: if the server refuses or can't be reached, the dialog stays open with an inline red
Callout:Couldn't save the mark. The file is not marked.The button and chip don't change until the host confirms.4. Clearing (exact copy)
Yes, clearing warns.
"Until they end" is how the user sees sticky session taint. Focus goes to Cancel here too. The live region announces
Untrusted mark cleared.5. Folders
Files only. The button isn't rendered when a folder is selected (folders don't open in the viewer anyway). Folder and glob marking stay out of scope, as the issue says.
Requirements check
title.brain.dbor frontmatter.Open decisions
A. What happens to the mark on rename or move? The host keys the mark by brain path. A
mvby the agent or a pulled commit would silently drop it, and the renamed file would read clean.missingso the user can re-mark.Recommendation: (b). It's honest and needs no journal coupling. (c) can come later.
B. Cue on chat file links and attachment rows? It needs a mark lookup per rendered link, a new read path. Recommendation: not in v1. The trust decision is made in the viewer, and the chat-side signal that matters is the session's taint state, which #1667 owns.
C. Enable the "Untrusted only" filter?
FilePanesdraws it disabled withneeds provenance. User marks are a partial provenance source.Recommendation: (a), relabelled
Marked untrustedso it doesn't claim to cover inbox or workspace origins.D. Shell reads. The copy says "any chat that reads" the file. The issue's detector covers file tools. A
catin Bash is caught only ifcommandTaintSourcealready classifies it, whether as fetching or unclassified.any chat that opens forwarded-offer.md with its file tools.Recommendation: (a), because the plainer copy is better. Otherwise (b).
E. Who can mark? Any authenticated user who can open the file, or the operator only? Recommendation: anyone who can open it. The mark only tightens rules, so it needs no extra authority. Clearing loosens rules for future chats, so it may deserve the same check as other loosening settings.
F. Contract shape. The UI needs the mark on file content responses (
untrusted?: { by, at }) and on directory listing entries (for the tree), plusPUT/DELETEroutes for the mark. All additive. This is for confirmation, not a design choice.schlessera commentedon Oct 23, 2026
2026-10-23 triage at main
f3c6fdc9f9c6321fda5a384cf8cfd8bf2e4846da: read the new design response and folded its unresolved rename/move, authority and visible-scope choices into the body. The proposal is not a maintainer ruling; retain needs: decision and no readiness. The existing native parent, P0 and milestone are preserved. The bounded eight-case production-classifier probe resolves the brief’s ordinary-cat question only; it supplies no new full runtime qualification. The current user interview starts with rename semantics, then authority and design scope. No choice is selected and no duplicate design prompt is posted.schlessera commentedon Oct 23, 2026
Decision (maintainer, 2026-10-23): Option B for rename/move semantics, selected in the current issue interview. Marks remain keyed by brain-relative path. Retain missing/orphaned old-path records and expose them so the user can re-mark a moved file. Do not silently discard them or automatically follow renames through the journal. The new path remains unmarked until explicitly marked. This selects behavior, not the yet-unapproved missing-record UI.
Folded the ruling into the body and acceptance criteria, including persistence and no-transfer proof plus durable decision-record delivery. Authority to mark/clear and the remaining visible scope/design approval are still unresolved; preserve
needs: decision, noagent-ready, parent #1645, priority, assignment and milestone.32 remaining items
schlessera commentedon Nov 2, 2026
Claiming for implementation (claim token
claim-2673-412d7236). Branch:feat/2673-untrusted-file-taintfrom mainb228b1f21. Collision check on the cited files reports only aclosureoverlap with draft evaluation PR #3056 (do-not-merge experiment); no path collision.CONTRACT: feat(ui-server): let a user mark a file untrusted so readin…
feat(ui-react): mark a file untrusted from Files, with cues and the M…
CONTRACT: feat(ui-server): let a user mark a file untrusted so readin…
feat(ui-react): mark a file untrusted from Files, with cues and the M…
fix(ui-react): keep Files focus and the viewer's single status with u…
fix(ui-react): draw the Marked untrusted entry only from a host answe…
CONTRACT: feat(ui-server): let a user mark a file untrusted so readin…
feat(ui-react): mark a file untrusted from Files, with cues and the M…
fix(ui-react): keep Files focus and the viewer's single status with u…
fix(ui-react): draw the Marked untrusted entry only from a host answe…
CONTRACT: feat(ui-server,ui-react): let a user mark a file untrusted …
schlessera commentedon Nov 2, 2026
Delivered by #3287, squash
f7eb0e498on main. Its parent is2bdcfec3band its tree is56d9d10e4, which equals the confirmed candidate checkout80aa87089(candidate run 41473471888). Milestone 0.45.0 is set on the PR and on this issue.074_untrusted_marks.sql) and served by four internal/api/files/untrustedroutes. Readers can mark a file; only the owner can clear a mark or see missing records and marker labels, and the host filters both. An admitted file-tool read or a search naming a marked file recordstaintwithsource: "user_marked".Marked untrustedlist and the Missing file dialog, using the approved revision 3 plus revision 2 copy and focus rules.docs/decisions/governed-writable-workers.md.