Connectors declare whether chat uses the person's credentials or a shared one #2070

Open
opened 2026-11-20 08:41:09 +00:00 by sam · 0 comments
Owner

Why: Every accepted connector today runs with org-level credentials sealed in the credential store and bound at acceptance, which is effectively a shared service account, and a chat turn invokes actions with that credential while the input — including any person or org identifier — is whatever the model wrote. A prompt-injected turn can therefore act as the service account (the confused deputy) or put another person's id into a query, and the downstream system sees the shared credential, not the person chatting.

Today: modules/connectors/module.go acceptAs stores a store.Accepted whose Credentials map binds credential slots to named credentials; launch resolves them via secrets in modules/connectors/credentials.go (plus splitSecretSettings for _ref settings) and passes them as Spec.Secrets at Configure time. Neither store.Accepted nor the connector proto's DescribeResponse declares a credential binding mode: there are no user-delegated tokens, no per-person account linking, no sandbox profile. Connector.Invoke sends Invocation{Action, Input, IdempotencyKey} verbatim — the input is model-supplied, and Digest covers only the action name and canonical input. Declarations offers every lookup and action to chat, and Declaration carries only ReadOnly. modules/chat/tools.go call checks only allowed(ActionRun/ActionRead, KindConnector, name); the governance action vocabulary in modules/governance/access.go has no binding actions (install, link_own_account, bind_to_agent, use_binding, rotate, revoke), though KindBinding exists as a resource kind. Extensions are egress-confined (modules/connectors/internal/host opens an egress gate from Spec.Egress) but still receive their secrets.

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:

  1. Every accepted connector declares exactly one binding mode — user-delegated account, shared service account, or sandbox — and a connector with no declared mode is not offered to chat (deny by default). (RFC 5.2, RFC 1)
  2. User-delegated bindings run with the invoking person's own linked downstream account: linking happens through an authenticated private flow with state, redirect validation and PKCE where applicable; the linked account and organization are verified and bound to the platform user and tenant; tokens are vaulted with minimum scopes and revoked on unlink; there is never a silent fallback to a workspace credential. If the person has not linked their account, the turn pauses with an account-linking card instead of running anything. (RFC 5.2, RFC 3 stage 6)
  3. Shared service account bindings are chat-eligible only for named, reviewed operations with a provable mapping from platform authorization to downstream rows, fields and effects (object checks, row/column policies or constrained views), with credentials scoped by tenant, environment and function. If equivalent enforcement cannot be demonstrated, the binding is not chat-eligible at all — using a binding is a distinct permission on the binding resource, and it grants no right to inspect, export, replace or rebind its secret. (RFC 5.2, RFC 2)
  4. Sandbox is an execution isolation profile, not a credential mode: no ambient credentials or cloud identity, isolated storage, bounded CPU/time/files, deny-by-default network through the policy proxy, isolated per tenant and task/principal; an authenticated browser task gets a specific brokered capability, not the user's general browser session. (RFC 5.2)
  5. For every binding, pin the downstream organization/account and the allowed operations; validate actual network targets including redirects; prohibit infrastructure and metadata endpoints outside the explicit contract. (RFC 5.2, RFC 3 stage 6)
  6. No raw authenticated HTTP, arbitrary SQL or arbitrary code is exposed as a chat substitute for missing business tools, and "export connector secret" is not an approvable chat action (refused per #2071). (RFC 5.2)
  7. The connector proxy (the host side of Invoke/Lookup) selects the credential for the binding, injects reserved context (verified principal, org, session) overwriting any model-supplied values, and enforces route and destination; the model and arbitrary tool code never receive a reusable credential. The judged digest is computed over the post-injection input, so the judged action is the one that runs. (RFC 3 stage 6, RFC 1)
  8. The mode gate is enforced at execution time in chat's call, not only at discovery, and a resumed turn still acts as its owner. (RFC 3, RFC 1)

Out of scope: #2067 tool discovery and admission filtering; #2068 taint tracking; #2069 memory scopes; #2071 admin actions refused in chat; #2072 approval binding; #2073 image/CSP rendering; #2074 budgets and rate limits; #2075 audit, revocation and kill-switch; #2078 enforcement on every entry point; #2079 chat-triggered workflow execution contracts; #2080 disclosure authorization per audience and destination; plus anything else this issue does not cover.

Design notes: modules/connectors owns the mode (stored on store.Accepted, set through the accept API in module.go), credential resolution (secrets, splitSecretSettings — skip slot resolution entirely for sandbox mode), and the injection/refusal inside Connector.Invoke/Lookup, which is the connector proxy; reuse connectors.Canonical so the digest covers the post-injection input, and host.Spec.Egress for sandbox egress. modules/chat owns pausing the turn and the linking card. modules/governance owns the binding actions on KindBinding in the Actions vocabulary and their shipped policies. Pitfalls: never trust model-supplied identity fields (injection overwrites them); a resumed turn must still act as its owner via actingAs; deny by default when the mode is unset. Migration: existing accepted connectors all hold shared credentials today — they are not chat-eligible until re-accepted with a declared mode and, for shared mode, demonstrated equivalent enforcement.

Tests (security-seam table tests with fakes, no DB, per AGENTS.md):

  • modules/connectors: Invoke injects and overwrites reserved context from the principal in ctx and the digest covers the injected input — guards "model-supplied identity is never trusted".
  • modules/connectors: a shared-mode binding without demonstrated equivalent enforcement is not chat-eligible and refuses invocation — guards the not-chat-eligible rule.
  • modules/connectors: user-delegated mode with no linked account returns a step-up/linking outcome, never an execution; sandbox mode resolves no secrets — guards "no silent fallback to a shared credential".
  • modules/chat: call refuses a connector whose mode gate fails at execution time — guards the execution-time gate.
  • modules/governance: the binding actions are denied to roles the shipped policies do not name (fake policy store) — guards business-action grants over credentials.

Done when: the accept API stores a mode and rejects an empty one; in chat, a user-delegated connector without a linked account shows the linking card and runs nothing; a shared-mode connector runs only named reviewed operations with the injected context visible in the recorded decision calls; a sandbox connector starts with no secrets and deny-by-default egress; a connector with no mode is not offered. Manual check on a running binary: accept one connector per mode in the dashboard, drive each from a chat turn, and watch the turn's tool calls and recorded decisions.

Open questions for the maintainer:

  • Where is the mode declared — in the extension's Describe (a proto contract change) or on the acceptance record — and which wins when they disagree?
  • Existing accepted connectors all hold shared credentials today: is the migration "not chat-eligible until re-accepted", or is a shared binding grandfathered while the equivalent-enforcement proof is done later?
  • The user-delegated linking flow needs a redirect-based flow and a per-person token store: does that land in this repo now, or is the linking card a stub that refuses until the flow exists?

Part of #2066.

**Why**: Every accepted connector today runs with org-level credentials sealed in the credential store and bound at acceptance, which is effectively a shared service account, and a chat turn invokes actions with that credential while the input — including any person or org identifier — is whatever the model wrote. A prompt-injected turn can therefore act as the service account (the confused deputy) or put another person's id into a query, and the downstream system sees the shared credential, not the person chatting. **Today**: modules/connectors/module.go acceptAs stores a store.Accepted whose Credentials map binds credential slots to named credentials; launch resolves them via secrets in modules/connectors/credentials.go (plus splitSecretSettings for `_ref` settings) and passes them as Spec.Secrets at Configure time. Neither store.Accepted nor the connector proto's DescribeResponse declares a credential binding mode: there are no user-delegated tokens, no per-person account linking, no sandbox profile. Connector.Invoke sends Invocation{Action, Input, IdempotencyKey} verbatim — the input is model-supplied, and Digest covers only the action name and canonical input. Declarations offers every lookup and action to chat, and Declaration carries only ReadOnly. modules/chat/tools.go call checks only allowed(ActionRun/ActionRead, KindConnector, name); the governance action vocabulary in modules/governance/access.go has no binding actions (install, link_own_account, bind_to_agent, use_binding, rotate, revoke), though KindBinding exists as a resource kind. Extensions are egress-confined (modules/connectors/internal/host opens an egress gate from Spec.Egress) but still receive their secrets. **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**: 1. Every accepted connector declares exactly one binding mode — user-delegated account, shared service account, or sandbox — and a connector with no declared mode is not offered to chat (deny by default). (RFC 5.2, RFC 1) 2. User-delegated bindings run with the invoking person's own linked downstream account: linking happens through an authenticated private flow with state, redirect validation and PKCE where applicable; the linked account and organization are verified and bound to the platform user and tenant; tokens are vaulted with minimum scopes and revoked on unlink; there is never a silent fallback to a workspace credential. If the person has not linked their account, the turn pauses with an account-linking card instead of running anything. (RFC 5.2, RFC 3 stage 6) 3. Shared service account bindings are chat-eligible only for named, reviewed operations with a provable mapping from platform authorization to downstream rows, fields and effects (object checks, row/column policies or constrained views), with credentials scoped by tenant, environment and function. If equivalent enforcement cannot be demonstrated, the binding is not chat-eligible at all — using a binding is a distinct permission on the binding resource, and it grants no right to inspect, export, replace or rebind its secret. (RFC 5.2, RFC 2) 4. Sandbox is an execution isolation profile, not a credential mode: no ambient credentials or cloud identity, isolated storage, bounded CPU/time/files, deny-by-default network through the policy proxy, isolated per tenant and task/principal; an authenticated browser task gets a specific brokered capability, not the user's general browser session. (RFC 5.2) 5. For every binding, pin the downstream organization/account and the allowed operations; validate actual network targets including redirects; prohibit infrastructure and metadata endpoints outside the explicit contract. (RFC 5.2, RFC 3 stage 6) 6. No raw authenticated HTTP, arbitrary SQL or arbitrary code is exposed as a chat substitute for missing business tools, and "export connector secret" is not an approvable chat action (refused per #2071). (RFC 5.2) 7. The connector proxy (the host side of Invoke/Lookup) selects the credential for the binding, injects reserved context (verified principal, org, session) overwriting any model-supplied values, and enforces route and destination; the model and arbitrary tool code never receive a reusable credential. The judged digest is computed over the post-injection input, so the judged action is the one that runs. (RFC 3 stage 6, RFC 1) 8. The mode gate is enforced at execution time in chat's call, not only at discovery, and a resumed turn still acts as its owner. (RFC 3, RFC 1) **Out of scope**: #2067 tool discovery and admission filtering; #2068 taint tracking; #2069 memory scopes; #2071 admin actions refused in chat; #2072 approval binding; #2073 image/CSP rendering; #2074 budgets and rate limits; #2075 audit, revocation and kill-switch; #2078 enforcement on every entry point; #2079 chat-triggered workflow execution contracts; #2080 disclosure authorization per audience and destination; plus anything else this issue does not cover. **Design notes**: modules/connectors owns the mode (stored on store.Accepted, set through the accept API in module.go), credential resolution (secrets, splitSecretSettings — skip slot resolution entirely for sandbox mode), and the injection/refusal inside Connector.Invoke/Lookup, which is the connector proxy; reuse connectors.Canonical so the digest covers the post-injection input, and host.Spec.Egress for sandbox egress. modules/chat owns pausing the turn and the linking card. modules/governance owns the binding actions on KindBinding in the Actions vocabulary and their shipped policies. Pitfalls: never trust model-supplied identity fields (injection overwrites them); a resumed turn must still act as its owner via actingAs; deny by default when the mode is unset. Migration: existing accepted connectors all hold shared credentials today — they are not chat-eligible until re-accepted with a declared mode and, for shared mode, demonstrated equivalent enforcement. **Tests** (security-seam table tests with fakes, no DB, per AGENTS.md): - modules/connectors: Invoke injects and overwrites reserved context from the principal in ctx and the digest covers the injected input — guards "model-supplied identity is never trusted". - modules/connectors: a shared-mode binding without demonstrated equivalent enforcement is not chat-eligible and refuses invocation — guards the not-chat-eligible rule. - modules/connectors: user-delegated mode with no linked account returns a step-up/linking outcome, never an execution; sandbox mode resolves no secrets — guards "no silent fallback to a shared credential". - modules/chat: call refuses a connector whose mode gate fails at execution time — guards the execution-time gate. - modules/governance: the binding actions are denied to roles the shipped policies do not name (fake policy store) — guards business-action grants over credentials. **Done when**: the accept API stores a mode and rejects an empty one; in chat, a user-delegated connector without a linked account shows the linking card and runs nothing; a shared-mode connector runs only named reviewed operations with the injected context visible in the recorded decision calls; a sandbox connector starts with no secrets and deny-by-default egress; a connector with no mode is not offered. Manual check on a running binary: accept one connector per mode in the dashboard, drive each from a chat turn, and watch the turn's tool calls and recorded decisions. **Open questions for the maintainer**: - Where is the mode declared — in the extension's Describe (a proto contract change) or on the acceptance record — and which wins when they disagree? - Existing accepted connectors all hold shared credentials today: is the migration "not chat-eligible until re-accepted", or is a shared binding grandfathered while the equivalent-enforcement proof is done later? - The user-delegated linking flow needs a redirect-based flow and a per-person token store: does that land in this repo now, or is the linking card a stub that refuses until the flow exists? Part of #2066.
sam added a new dependency 2026-11-20 08:52:55 +00:00
sam added the featurehigh labels 2026-11-20 10:04:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#2070