Repository navigation
Description
Part of #1645. Guardrail class: G2 (data exfiltration: data-to-provider routing).
Outcome
Content a governance policy names under a providers rule reaches only the inference and embedding providers that rule allows. A hosted turn whose proven recipient is not allowed cannot read, search, recall or be handed that content through any path; a turn whose recipient is allowed sees it as normal.
Why now
The maintainer asked on 2026-10-11 (#1636) for a policy saying which paths or document types may go to which provider. Hosted agents run on a live shared brain, so a file mask alone is not enough: every retained copy (the search index, history, generated-text caches, backend memory, inbox threads) has to follow the same rule.
Shared context
- Decision:
docs/decisions/governed-writable-workers.md, "Data-to-provider routing (G2)", including its "Allowed recipients" subsection (ui-server: let a proven allowed recipient's turn see its provider folders #2695). Embedding opt-out:docs/decisions/embedding-eligibility.md. Supported selectors and limits:docs/supported-inputs.md. - Recipient. Only the actual proven inference recipient authorizes data. Admission names it from the exact origin the turn's host relay forwards to: a fixed first-party table plus the operator mapping
BRAIN_UI_PROVIDER_RECIPIENT_ORIGINS(ui-server: let a proven allowed recipient's turn see its provider folders #2695).classifyRouteis cost classification, not data authority; model labels, custom base URLs, credential-origin lists and unmapped gateways stay unknown recipients, and unknown means denied. - Masks. A denied turn gets an empty read-only tmpfs over each masked folder root,
.githidden, and a turn-private.brain-index/. That index is built from nothing by the brain's own CLI in a worker that sees the same masks, not filtered from the realbrain.db: filtering an existing database leaves recoverable text in SQLite free pages, FTS5 segments and vector shadow tables (module comment,packages/ui-server/src/brain/private-index.ts:1-16). Complete bases can now be reused or advanced off the turn path only with exact checkpoint/policy/mask/recipient freshness (private-index-cache.ts); uncertain reconciliation rebuilds cleanly. The index lives in its own directory so the whole-folder pin covers it (CONTRACT: feat(core): keep the disposable index in .brain-index/ #2667, option B ruling of 2026-10-22). - Selectors. Literal folder rules are enforced directly. A type, glob or single-path selector is translated to whole-folder masks when it maps exactly onto folders, and refused by name otherwise (ui-server: enforce provider type and glob selectors in hosted turns #2694, option C ruling of 2026-10-23). Type translation trusts the taxonomy that the brain's CLI reports from a masked, credential-free worker, and refuses a turn when a document of a translated type sits outside its folders (module comment,
packages/ui-server/src/brain/provider-types.ts:1-12). Type-taxonomy execution now exposes only policy-protected inputs and refuses unprotected or unverifiable executable loads by name (ui-server: protect the code a type-translated turn's taxonomy runs #2699/CONTRACT: fix(ui-server): read a type selector's taxonomy only from protected paths (#2699) #2886); the mid-turn retype limitation remains documented. - Conversation-to-inbox provenance. ui-server: let inbox items written by a born-masked hosted conversation qualify for masked autonomous turns #2816/CONTRACT: feat(ui-server): qualify inbox items a born-masked conversation adds #2829 now records compatible inbox_add evidence from the host lineage of the adding turn (
turnLineage,packages/ui-server/src/inbox/provenance.ts:80-85;recordInboxProvenance, same file:93-117). The lineage must cover every folder the autonomous turn masks through the adding turn. Pre-policy, missing, narrowed-incompatible or superseded-turn evidence still refuses; no model field grants provenance. This consumes the settled backends: keep text from before a provider policy out of denied turns' auto-memory and resumed sessions #2726/ui-server: decide whether masked autonomous turns may read their thread's earlier inbox items #2741 policies rather than changing them. - Embeddings. A path not allowed for the configured embeddings provider is embedding-ineligible: keyword search stays, vectors are removed (CONTRACT: apply provider policy to core embedding eligibility #2200).
Constraints and non-goals
- Per-sentence redaction, and provider choice by content classification.
- Filtered writable live-brain overlays and changed writer concurrency remain excluded. The later ui-sdk: a strict worker never sees its own turn's host applications or their index update #2848/ui-server: a provider-restricted turn's own applications never reach its private search index #2846 A5+B1 ruling permits only the separate read-only turn data tree and private index: frozen startup bytes plus this turn’s provenance-approved effects, with no peer-byte ingestion; the governed live-brain model stays.
- Tool egress and the brain CLI's own provider calls: egress policy (G5), ui-sdk: route the brain CLI's paid provider calls from workers through metered host relays #1673 under Epic: interactive cost and scope limits #1646 (ui-server: let a proven allowed recipient's turn see its provider folders #2695 ruling 3).
- Arbitrary text a user copies from a masked document into an unmasked one.
Binding rulings
- 2026-10-16: qualify whole-folder worker exclusions first, preserving the live-brain model. Production proof covers all writers and publishers, root/ancestor rename and recreation, aliases, absent roots, pre-existing peers and policy changes, with masked history, a private index and server-tool refusal. Refuse unsupported unsafe admission by name.
- 2026-10-22: option B, move the search index into
.brain-index/(CONTRACT:; migration is a rebuild). - 2026-10-23 (ui-server: enforce provider type and glob selectors in hosted turns #2694): option C, translate type/glob/single-path selectors that map exactly onto folders; refuse the rest by name.
- 2026-10-23 (ui-server: let a proven allowed recipient's turn see its provider folders #2695): a fixed first-party recipient table plus an operator gateway mapping; history option A (each session records which recipient saw which folders, and a later incompatible recipient is refused by name); G2 covers the inference recipient only, and cache masks stay on allowed turns until core: move the generated-text caches into a masked directory once allowed routes exist #2725.
Breakdown
Delivered: #2200 (core embedding eligibility), #2222, #2234, #2239, #2246, #2254, #2260, #2268, #2284 (all-writer topology prerequisites), #2667/#2668 (index directory and denied-turn masks), #2690 (bridge tool refusals), #2691 (autonomous turns), #2692 (cache masks), #2693 (native strict private index), #2694 (selector translation), #2695 (allowed recipients), #2696, #2698, #2700, #2718, #2726 (merged #2797), #2741 (merged #2798), #2816 (merged #2829, squash 80faf6e53), #2832 (startup peer wait, merged #2841, squash e1ab48566), #2833 (checkpoint-bound warm-cache advancement, merged #2856, squash 344ab3a2e), #2836 (cross-process type-folder plans, merged #2842, squash d0697d9cd), #2699 (protected taxonomy executable load set, merged #2886, squash d9f4405ce), #2846 (same-turn masked data/index effects, merged #2897, squash 79bab30b4).
Remaining:
| Requirement | Child |
|---|---|
| Generated-text caches move into a masked directory, so allowed turns no longer need cache masks | #2725 |
Definition of done
The 2026-10-25 maintainer completion ruling names #2725 as the remaining required delivery, with the integrated guarantees below preserved. #2701 was detached as a standalone 0.45.0 reproduction investigation, not repaired or waived as a passing test. Native #2865 remains attached as an open fallback-CLI follow-up; this pass preserves that parent and does not claim the follow-up delivered. Do not mistake its attachment for a new release gate overriding the maintainer ruling.
On the qualifying main:
- With
me/**allowed only for one recipient, a denied turn cannot readme/identity.mdthrough Read, Bash,brain_read_baseor another bridge tool,brain search(its private index lacks the document),.githistory, the activity record, the generated-text caches, backend memory or resumed sessions, or its inbox thread (under the delivered ui-server: decide whether masked autonomous turns may read their thread's earlier inbox items #2741 admission rules and the ui-server: let inbox items written by a born-masked hosted conversation qualify for masked autonomous turns #2816 follow-up). An integration test covers each path, interactive and autonomous. - A turn whose proven recipient is allowed reads it through the same paths.
brain indexdrops vectors for a disallowed path and keeps keyword search (core test).- Mutation receipt: skip the mask and the Bash read test fails.
- The decision record and
docs/supported-inputs.mddescribe the enforced selectors, the recipient rules and every documented limitation.
Contract impact across the epic: additive policy keys and environment settings, plus the breaking .brain-index/ relocation (#2667) and cache relocation (#2725); each ships in its own CONTRACT: change.
2026-10-24: converted to an epic: the remaining work already lives in its sub-issues (2026-10-23 status). Replaced the stale "filtered copy of brain.db" with the built-from-nothing private index, replaced the blanket unsupported-selector description with the #2694 translation, folded in the #2695 recipient rulings, and mapped each remaining requirement to its child. The dated delivery inventory moved to a comment.
2026-10-24 continued triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: Aligned the #2701 row with its observed invalid-mount-record refusal and unresolved attribution. A partial/empty mountinfo read remains a hypothesis, not an established parent requirement or selected retry mechanism. Existing G2 rulings, children and no epic readiness remain unchanged.
2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Folded merged #2797/#2726 born-masked lineage and #2798/#2741 origin-thread admission into delivered context. The newly filed #2816 advances this exact G2 outcome; it is the remaining conversation-to-inbox provenance follow-up, not a reopening of the settled policy. Existing type-translation/cache/attribution children remain independent.
2026-10-24 triage at main 80faf6e536a7a4e983f08adcc6a4e9f161581193: verified #2816 is completed by merged #2829 at this exact squash, and inspected the host-bound intake/provenance path, migration 066 and updated G2 contract/decision text. Moved the follow-up into delivered context and removed its remaining-work row. #2699, #2725 and #2701 remain open; the epic remains open without agent-ready. No fresh runtime proof, broader recipient grant or integrated epic completion is claimed.
2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Added the three already-attached G2 follow-ups #2832/#2833/#2836 to the current breakdown. Their separate startup, private-index architecture and cross-process planning deliverables remain open; no new attachment, merged repair or epic readiness is inferred.
2026-10-24 maintainer reconciliation: #2833 selects a host-owned checkpoint-bound cache with exact policy/masks/recipient identity and complete startup-view reconciliation; unsafe/unproven transitions rebuild cleanly, including physical SQLite byte-leakage checks. Warm-turn target and provider isolation stay binding. #2699 selects fail-closed taxonomy admission (B) for unprotected/unverifiable executable load sets, with the supported-input restriction explicitly approved. These are rulings, not delivered repairs; both children remain open.
2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Verified #2832 is completed by merged #2841 at this exact main. Folded the startup peer wait into delivered context and removed its open-work row: admission waits up to 30 seconds for earlier missing-root peers, preserving cancellation and refusal of unsafe peer states. The separate #2836 process/restart translation persistence and #2833 approved cache implementation remain open; no broad G2 completion is inferred.
2026-10-25 triage at main 827861e1fa71cd4a26b52f1ef0f96b849381acdf: Verified merged #2856/#2842 and current cache/gate sources; moved #2833/#2836 into delivered context. Exact checkpoint/policy/mask/recipient isolation and safe rebuild remain binding. #2699 and other open G2 work remain; no epic completion is claimed.
2026-10-25 triage at main ab746a434c4ada11734ffea4e208d1d6211f1aca: Folded the verified #2699/#2886 and #2846/#2897 deliveries into the current G2 specification and incorporated the later maintainer completion ruling: #2725 remains required, #2701 is detached/deferred. Preserve #2865’s existing native parent and open follow-up status; no child is reparented, closed or silently treated as delivered. The epic stays open without readiness.
Activity
schlessera commentedon Oct 12, 2026
Unblocked: #1649, #1650 are closed, so
scripts/sync-project.tsis removing theblockedlabel.78 remaining items
schlessera commentedon Oct 24, 2026
2026-10-24 triage at main
80faf6e536a7a4e983f08adcc6a4e9f161581193: verified #2816 is completed by merged #2829 at this exact squash, and inspected the host-bound intake/provenance path, migration 066 and updated G2 contract/decision text. Moved the follow-up into delivered context and removed its remaining-work row. #2699, #2725 and #2701 remain open; the epic remains open without agent-ready. No fresh runtime proof, broader recipient grant or integrated epic completion is claimed.schlessera commentedon Oct 24, 2026
2026-10-24 triage at main
77f35ef1ba34e4fab7092ada5362ae799852ea24: Added the three already-attached G2 follow-ups #2832/#2833/#2836 to the current breakdown. Their separate startup, private-index architecture and cross-process planning deliverables remain open; no new attachment, merged repair or epic readiness is inferred.schlessera commentedon Oct 24, 2026
2026-10-24 triage at main
e1ab485669565554ca6cb61ce5d130303647230f: Verified #2832 is completed by merged #2841 at this exact main. Folded the startup peer wait into delivered context and removed its open-work row: admission waits up to 30 seconds for earlier missing-root peers, preserving cancellation and refusal of unsafe peer states. The separate #2836 process/restart translation persistence and #2833 approved cache implementation remain open; no broad G2 completion is inferred.schlessera commentedon Oct 25, 2026
2026-10-25 triage at main
827861e1fa71cd4a26b52f1ef0f96b849381acdf: Verified merged #2856/#2842 and current cache/gate sources; moved #2833/#2836 into delivered context. Exact checkpoint/policy/mask/recipient isolation and safe rebuild remain binding. #2699 and other open G2 work remain; no epic completion is claimed.schlessera commentedon Oct 25, 2026
2026-10-25 (maintainer): #2725 is pulled into 0.44.0; #2701 (intermittent mount-record refusals, needs repro) is detached from this epic as a standalone flake in 0.45.0. #1668 closes when #2725 lands.
schlessera commentedon Oct 25, 2026
2026-10-25 triage at main
ab746a434c4ada11734ffea4e208d1d6211f1aca: Folded the verified #2699/#2886 and #2846/#2897 deliveries into the current G2 specification and incorporated the later maintainer completion ruling: #2725 remains required, #2701 is detached/deferred. Preserve #2865’s existing native parent and open follow-up status; no child is reparented, closed or silently treated as delivered. The epic stays open without readiness.schlessera commentedon Oct 25, 2026
2026-10-25 closure: #2725 landed as 800d965 (#2917), the last 0.44.0 deliverable of this epic per the maintainer's 2026-10-25 ruling. #2701 (intermittent mount-record refusals) and #2865 (the
scripts/brain-cli.tsfallback cannot launch in a masked worker; documented by #2699) are detached as standalone 0.45.0 issues. No open sub-issues remain.