Chat policy decisions are audited and revocable #2075
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2075
Reference in new issue
Block a user
Why: today a chat turn's security events are scattered — judgement decisions keyed by turn id, approvals in the approvals store, held actions in chat.actions, tool calls in chat.events — so answering "which person, in which conversation, made which tool do what" means joining tables by hand. And while an admin can suspend an identity, that person's already-queued or running chat turns keep acting with their access, and nobody can switch a single tool off for chat without a code change.
Today:
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: #2067 tool discovery, #2068 taint tracking itself, #2069 memory scopes and erasure, #2070 connector credential modes, #2071 admin tools refused in chat, #2072 approval binding, #2073 image/CSP rendering, #2074 budgets/rate limits, #2078 enforcement on every entry point, #2079 chat-triggered workflow execution contracts, #2080 disclosure authorization per audience/destination. The effective-permissions simulator is in no child of #2066 and is not part of this issue.
Design notes: modules/judgement already owns decision records and modules/approvals approval records — reach them only through their API packages (Judge.ForRun, approvals ForRun); the chat-correlated audit record (person + session + turn) belongs to modules/chat, which owns sessions and turns (modules/chat/internal/store). Cheapest correct shape: write the audit records from the same places that already write (call and hold in modules/chat/tools.go, Signal/settled in modules/chat/actions.go), or serve a read API joining the three stores — see open questions. Enforce the owner-lifecycle checks through the governance API (PrincipalFor plus an identity read), never by joining governance tables from the chat store — a module never reads another module's tables. Kill switch: per AGENTS.md a setting must work end to end, so if the disabled-tool list is a setting it needs an admin API plus enforcement in tools.go tools (omit from the list) and call (hard refuse). Deny by default throughout; never trust model-supplied identity; a resumed or approved-then-rerun action (runApproved) still acts as its owner and is audited under the same turn. No migration needed for existing rows — decisions are already keyed by turn id.
Tests (security boundary — table cases, fakes, no DB, per AGENTS.md; extend the fakes in modules/chat/access_test.go: fakeStore, fakeJudge, fakeToolbox, fakePeople):
Done when: task check passes, and on a running binary: suspend a person with a turn in flight → the turn ends visibly (cancelled/failed), their next API call is refused, and their queued turns never run; as admin, disable a tool for chat via the control-plane API → the next chat turn does not list it, a model-forced call is refused and shown, and the turn's audit view shows every decision (allowed/refused/held), approval event and taint change with person, session and turn, and no credentials.
Open questions for the maintainer:
Part of #2066.