Repository navigation
chore(slack): retire the instance-wide Slack env credentials (TASK-151) - #1929
Merged
Merged
Conversation
Sam attested on 2026-09-26, when public distribution was activated, that the Slack app carries no hard-coded information, conditional on the retired `SLACK_BOT_TOKEN` fallbacks being removed so the attestation is fully true. Four production readers and three plumbing paths are removed; a workspace's Slack token is stored per install by the OAuth bind (`botTokenRef` -> `connectorSecrets`) and the webhook path keeps its own `SLACK_SIGNING_SECRET`. Readers: `slackProvider.ts` (the legacy env fallback — a row's own stored copy is still honoured), the whole Slack branch of `buildOpenClawIntegrationChannels`, and the whole Slack block of `applyOpenClawIntegrationChannels` in both provisioners. `SLACK_APP_TOKEN` goes with `SLACK_BOT_TOKEN`. Whole blocks, not single lines: each Slack block also read the signing secret, so cutting only the token assignments would leave `channels.slack` created from a signing secret alone with no token. `channels.slack` stays an empty array in the helpers' output so a consumer that iterates it keeps working. Plumbing: the backend deployment's `SLACK_BOT_TOKEN` reference, the `slack-bot-token` ExternalSecret key, the local-secrets template and its values-local entry, `docker-compose.dev.yml`, both `.env.example` files, the docs-site variable table, and the operator docs that told an operator to create the now-unread Secret Manager key. In the same PR, the runbook gap the 2026-09-26 Slack walk hit: `docs/runbooks/connector-credentials-setup.md` §2.3 now lists `features.app_home.messages_tab_enabled: true` and `messages_tab_read_only_enabled: false` (without them Slack answers the Messages tab with "Sending messages to this app has been turned off" and no DM reaches Commonly), §2.8's acceptance now ends at a DM from Slack, and §2.6/2.7 names the distribution toggle and its acknowledgement. Discord and Telegram keep their env tokens: theirs are live instance credentials for their own connectors, so their mounts are not inert. Only their moltbot-tier blocks are dead, and those retire with the tier. Nothing changes live: `agents.clawdbot` has been parked since 2026-08-20 and `slackProvider`'s legacy branch has no live caller (TASK-140). Gate: Vera.
samxu01
force-pushed
the
kai/task151-slack-env-token-removal
branch
from
September 27, 2026 00:31
d08b84b to
5ba0fbb
Compare
lilyshen0722
added a commit
to thantiklermcirony/commonly
that referenced
this pull request
Oct 9, 2026
…hipped (Team-Commonly#1936) Records the live Telegram re-walk of 2026-09-27 (02:43–02:47Z): the code typed exactly as displayed, spaced and with a capitalised group, binds on the first try (Team-Commonly#1931, Team-Commonly#1932); a second gated pod relays its agent's line to the chat while a typed line goes only to the active pod; C3 and C5 inbound green. Marks the 7ccc6ac C1 red as fixed, TASK-151 as shipped (Team-Commonly#1929 on f5eb556) and TASK-155 as shipped (Team-Commonly#1933 on 9a6253f). Open: TASK-156. Claude-Session: https://claude.ai/code/session_01MCF2UK3EQ6z6EHdvxAkM44 Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Sam attested on 2026-09-26, when public distribution was activated for the Slack app, that it carries no hard-coded information — conditional on the retired
SLACK_BOT_TOKENfallbacks being removed so the attestation is fully true. The env token only ever worked inside our own workspace (a customer's token is stored per install by the OAuth bind), so this is attestation hygiene, not a cross-tenant leak — but an auditor asking "is there a Slack credential configured outside the per-install path?" should get an empty answer.Wren's scope note on TASK-151 is the spec of record (Vera 74557/74563, wren 74561), including the two items that make the attestation fully true: the signing secret's own read inside those blocks, and the injection that would otherwise keep delivering a token nothing reads.
Readers removed (four sites, whole blocks)
integrations/providers/slackProvider.ts— the env fallback intokenFor. A row's own stored copy is still honoured (a pre-TASK-139 row may carry one); the process environment is not read.routes/registry/helpers.ts— the entireif (type === 'slack')branch.channels.slackstays an empty array so a consumer that iterates it keeps working.services/agentProvisionerService.tsandagentProvisionerServiceK8s.ts— the entire Slack block ofapplyOpenClawIntegrationChannels.SLACK_APP_TOKENgoes withSLACK_BOT_TOKEN.Whole blocks, not the token lines. Each of those blocks also read
SLACK_SIGNING_SECRETand createdconfig.channels.slackwhen any of the three was set, so cutting only the token assignments would leave a Slack channel built from a signing secret alone, with no token — the half-true shape this row exists to prevent. The witness for that is a provisioner test with onlySLACK_SIGNING_SECRETset asserting there is nochannels.slackkey: it reddens if only the token lines are cut (M1a/M1b below).Plumbing removed
Wren's item 3 list, all of it: the backend deployment's
SLACK_BOT_TOKENreference, theslack-bot-tokenExternalSecret key,local-secrets.yamland itsvalues-local.yamlentry,docker-compose.dev.yml, both.env.examples,docs-site/deployment/environment-variables.mdx.Five files beyond that enumeration, same class, flagged for the gate rather than slipped in — the operator docs that told an operator to set a variable nothing reads any more, so they go stale in exactly the way item 3 describes:
docs/slack/README.md(step 5 rewritten: signing secret stays on the instance, bot token is the per-installbotTokenRef),docs/development/local-credentials.md(the two bullets become a pointer to the connector runbook),docs/deployment/KUBERNETES.md+K8S_DEPLOYMENT_CHECKLIST.md(the--from-literal=slack-bot-token=''line) andk8s/QUICK_START.md(thegcloud secrets create commonly-dev-slack-bot-tokenline). Each is a removal, not a rewrite.Stays, deliberately
SLACK_SIGNING_SECRETand its live readers (webhooks/slack.ts:61/:221,slackProvider.ts:85,manifests.ts:105); the connector-secret kindSLACK_BOT_TOKEN/slack-bot-token(connectorSecretKinds.ts:46) — same name, different thing, it is the per-workspace OAuth path (installables.ts:327); and the Discord and Telegram env tokens, whose mounts are not inert because they are live instance credentials for their own connectors. Only those two connectors' moltbot-tier blocks are dead, and they retire with the tier (ADR-021/ADR-023,values-dev:167), not in an attestation row.Runbook gap, same PR
docs/runbooks/connector-credentials-setup.md: §2.3's "what to merge" list gainsfeatures.app_home(messages_tab_enabled: true,messages_tab_read_only_enabled: false) — without both, Slack answers the app's Messages tab with "Sending messages to this app has been turned off" and no DM reaches Commonly, which is what the 2026-09-26 walk hit and fixed by hand; §2.8's acceptance now ends at "a DM from Slack lands in the pod"; §2.6/2.7 now names the toggle (Manage Distribution → Activate Public Distribution, including the "Remove Hard Coded Information" acknowledgement) instead of calling it "the step after that".Witnesses and ledger
Mutating one site at a time, baseline committed first (
d08b84b5) so every revert isgit checkout --:creates no slack channel when only the signing secret is setenv fallbacksgreen, and the k8s witness green — the two provisioners are separate armsenv fallbacksgreen, non-k8s witness greenhands the gateway no slack channel at all+hands the gateway no slack verification credential eitherinstance telegram tokengreendoes not fall back to the instance token, which is retiredlegacy row from its own channelgreenAll nine witness/control selections are green on the clean tree before and after the ledger. No mutation survived, so there is no tripwire.
slackProvider's old "falls back to the instance token" test is inverted rather than deleted: it now asserts the row is refused (missing its bot token) and thatSlackApiis never constructed with the env value. Inregistry.helpers.channelTokenSources.test.jsthe Slack cases become "no slack channel at all", keeping the env keys set inbeforeEachso a restored reader shows up as a non-empty array.Scope note on the ExternalSecret
Removing a key cannot freeze
api-keys— the failure mode runbook §0.1 documents is a missingremoteRef, i.e. adding one whose Secret Manager entry does not exist. The Secret Manager entrycommonly-dev-slack-bot-tokenitself is left in place; deleting it is an operator step, not this PR.Verification
Six suites / 69 tests pass on Node 22 (
agentProvisionerService,agentProvisionerServiceK8s,registry.helpers.channelTokenSources,registry.presets— the "manifest readiness, not the legacy bot token" case still green,slackProvider.bindingShape,discordBindingContainment). eslint: 0 errors on the four TS sources; on the two touched.jstest files the counts are identical to the same files at HEAD (17 and 6), measured against baseline copies rather than assumed.CI was red at the first head (
d08b84b5) and is fixed at5ba0fbb2. While measuring the lint baseline above I wrote two scratch copies of the touched test files into the tree (__baseline__*.test.jseach), andgit add -Acommitted them. I caught one in the diffstat and removed it, missed the other —__baseline__slackProvider.bindingShape.test.js— which then failed in CI as a stale copy of the very test this PR inverts (falls back to the instance token…), with the new source underneath it. Both are gone; the diff is 23 files. The head moved after the gate ask, so it is flagged here rather than moved silently; nothing was cleared at the old head.Nothing changes live:
agents.clawdbothas been parked since 2026-08-20, andslackProvider's legacy branch has no live caller (TASK-140).Residual, stated rather than implied
There is no static guard against re-introducing one of these reads; the attestation is a point-in-time state of the tree, and a future reader would be caught by review, not by CI. I did not add one because the row's witness spec names the provisioner test, and a guard over "no file mentions these env keys except the connector-secret kind" would have to scope around docs and history.
Gate: Vera.