A conversation gets a persisted tainted flag (migration 00040), set the first time output from a tool whose declaration trust level is not "trusted" enters the turn, before that output reaches the model. The flag is only ever set, never cleared, so later turns and resumed processes inherit it. In a tainted conversation every non-read-only action is raised to a floor of propose_and_wait, so the existing hold path renders the approval card with the exact judged action; read-only lookups still run, and a hard-rule refusal stays a refusal. An unreadable taint state or a failed taint write fails closed. Trust levels live on connectors.Declaration; unknown levels are untrusted.
9 lines
372 B
SQL
9 lines
372 B
SQL
-- +goose Up
|
|
-- A conversation that has ingested untrusted content is tainted for the rest
|
|
-- of its life: every later turn, including one a restarted process resumes,
|
|
-- tightens controls. The flag is only ever set, never cleared.
|
|
ALTER TABLE chat.sessions ADD COLUMN tainted boolean NOT NULL DEFAULT false;
|
|
|
|
-- +goose Down
|
|
ALTER TABLE chat.sessions DROP COLUMN tainted;
|