Chat-triggered workflows are classified by transitive effects and run under a declared execution contract #2079
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2079
Reference in new issue
Block a user
Why: Chat cannot start a workflow today, but nothing structural stands between a chat turn and a workflow run: runs are started by triggers and schedules with no initiator, no grant check and no declared execution identity, and a workflow's danger is judged only step by step as actions execute. The RFC makes
workflow:executeplus an input schema insufficient — a read step feeding a send step is a disclosure no single step's tier captures — and a schedule must be bound to a revocable grant, not to whoever happened to create it.Today:
modules/chat/tools.gobuiltins()offers onlyrun_list,run_get,approval_list,memory_list/memory_save/memory_forgetanddashboard_navigate— there is no chat tool that starts a workflow. Runs start frommodules/events/events.godispatch(one run per matching trigger, keyed by event id and trigger) andtick(interval schedules), viaruns.Start, which checks only that the workflow exists, parses and accepts the input (modules/runs/runs.go);CheckTriggerchecks the same for triggers. A run pins its version at start (loadDocumentloadsrun.Version), but nothing classifies the document's transitive effects:modules/runs/checks.govalidates the step vocabulary only (switch, parallel and retry are rejected as unsupported), and each agent tool call is judged individually incall/runUnattended/settleOne(modules/runs/interpreter.go) with the workflow name as judgement'sWorkflowprincipal (rc.requestinmodules/runs/dry.go) — no read-then-send composition is detected. There is no execution contract: runs carry no initiator or on-behalf-of person and no run-as identity (Options.Owneris the process name for leases), schedules (everyon triggers) have no owner, expiry or per-run recheck, and disabling or removing a person stops nothing. The permission vocabulary hasKindWorkflowandActionRun(modules/governance/access.go) and the shipped role policies grantrun, but no code callsAuthorizeon a workflow resource beforeStart.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 (#2067), taint (#2068), memory scopes (#2069), connector credential modes (#2070), admin tools refused in chat (#2071), approval binding (#2072), image/CSP (#2073), budgets and rate limits (#2074 — the cumulative limits here are the workflow-level ones RFC 5.3 names), audit/revocation/kill-switch (#2075), plus the disclosure-per-audience issue and the enforcement-parity issue filed alongside this one. Beyond those, this issue does not cover the workflow step vocabulary or DSL, judgement guard internals, or approval card mechanics.
Design notes: owning modules:
modules/chatfor the trigger tool (builtins()),modules/runsfor effect classification atInstall/validateDocumentand version pinning inStart/loadDocument,modules/eventsfor triggers and schedules (putTrigger,tick),modules/governancefor theKindWorkflowrun/schedule grants. Seams:Engine.Start/CheckTrigger,dispatch,Context.request. Pitfalls: a resumed turn still acts as its owner, so the grant is re-read from current memberships; never take the workflow name, version or "run as me" from the model; deny by default — a document whose effects cannot be classified is not chat-eligible; fail closed when policy or grant lookup is unavailable. Migrations: the runs table needs initiator and execution-contract fields; triggers and schedules need owner, expiry and contract.Tests: security-seam table tests with fakes, no DB:
runon the workflow resource is refused beforeStart;Done when:
task checkpasses with the new tests. Manual check on a running binary (task dev): from chat, trigger a workflow the person may run — the run's trail shows the pinned version, the declared execution contract and a reauthorization on each protected step; trigger one without the grant — refused; remove the grant from a scheduled workflow — its next firing executes no protected step.Open questions for the maintainer: should chat gain a workflow-trigger tool in the first release, or should chat-triggered runs go through an explicit request-and-approval action instead; which existing workflows, if any, are intended as organizational service operations, and who owns their service principal today; what happens to a departed person's schedules — reassign by policy to a named owner, or require manual takeover?
Part of #2066.