Chat authorizes disclosures per audience and destination, not just tool calls #2080
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2080
Reference in new issue
Block a user
Why: Today chat authorizes only the tool call itself: once
allowed()inmodules/chat/tools.gopasses and judgement runs the action, the reply, every tool output and every approval card can flow anywhere the platform sends it — the composer, every delivering connector channel, the model provider, the browser — with no decision about audience or destination. Picture a support rep asking chat about a customer's case: the rep may read the case, but nothing stops the reply, or its tool traces, being fanned out to a channel, a notification, an export or a provider the case's confidentiality does not permit.Today:
modules/chat/tools.goallowed()checksActionRun/ActionReadon the connector resource before a tool runs, andguarded()wraps each builtin; that is the only authorization on the reply path. Sessions are per person sincecf6108ad1:modules/chat/internal/store/store.goscopes every session and turn query by org and owner,caller()inmodules/chat/api.gomaps a request to its principal, andserveEventsplusmodules/dashboard/stream.godeliver only to the owner's topic — there is no shared or channel chat session in this binary today. But every streamed event (reasoning, deltas, tool outputs viarecord()inmodules/chat/turn.go, approval and action cards) is persisted whole inchat.events— only credential-like parameter keys are redacted bysummarizeParametersinmodules/chat/parameters.go— andgenerate()sends the system prompt with all memory notes (memoryBlock) plus up to 20 history turns to the model provider with no processor check. Outbound,modules/deliveries/deliveries.gosend()writes each message to the composer and a row per connector that deliversmessage, andWork()sends to all of them: chat'ssettled()inmodules/chat/actions.gonotifies the action result andhold()delivers approval requests, all fanned out to every channel with no destination decision. Rendering is client-side only:ui/src/chat/markdown.tskeeps anyhttps:image URL (SAFE_SRC) which the browser fetches directly (ChatMarkdown.vue), andmodules/dashboard/dashboard.gosets no CSP or other security headers; there is no server-side image proxy. Nothing inmodules/chat,modules/deliveriesormodules/judgementlabels data with readers or classification — judgement classes are action-autonomy classes, not data classes.Source: the revised RFC exported at transcripts/2026-11-20-chat-authorization-rfc-3fa43269.md in sam/archie-product; citations below are RFC section numbers.
Required behaviour:
Out of scope: tool discovery filtering (#2067), taint (#2068), memory scopes (#2069), connector credential modes (#2070), admin tools refused in chat (#2071), approval binding (#2072), CSP headers and image rendering policy (#2073 — sink authorization for image fetches is here, the header and rendering work is there), budgets and rate limits (#2074), audit/revocation/kill-switch (#2075), plus the enforcement-parity issue and the chat-triggered-workflows issue filed alongside this one. Beyond those, this issue does not cover ingress authentication of channels, the workflow step vocabulary, or judgement guard internals.
Design notes: owning modules:
modules/chatowns the turn and its release path (turn.go,actions.go,api.go,internal/store),modules/deliveriesowns the outbound sinks,modules/dashboardowns serving and streams; the provider-processor check belongs ingenerate()inturn.go. Seams:record()/serveEventsfor transcript audience,settled()→Notifier.NotifyandApprover.Askfor channel fan-out,deliveries.sendper-channel rows,summarizeParameters/toolCallfor what is stored. Pitfalls: a resumed turn still acts as its owner; never take identity, audience or classification facts from the model; deny by default and fail closed when a policy, ACL or lookup is unavailable (asallowed()already does onErrChainUnavailable); a private result must not land in a shared transcript first. Migration:chat.eventsand deliveries rows need audience/classification columns owned by their modules' schemas.Tests: security-seam table tests with fakes, no DB, alongside
modules/chat/access_test.go:Done when:
task checkpasses with the new tests. Manual check on a running binary (task dev): ask chat for something confidential, then try to send the answer to a channel — the channel receives nothing (or an access-controlled link with a non-sensitive title and no preview), the private reply appears only in the owner's conversation and event stream, and a second signed-in user streaming or replaying the turn's events sees nothing.Open questions for the maintainer: does the product intend any shared or channel chat surface in this binary (the composer is currently the only shared sink), or is chat private-only with deliveries as the outbound path — RFC 4's removal of "post publicly" assumes a shared-channel warning exists somewhere; which model providers meet the retention and processor policy, and is that a per-tenant setting; is a server-side image proxy in scope here or under the image/CSP issue?
Part of #2066.