Skip to content

feat(slack): encrypt bot tokens at rest in Chat SDK state - #5131

Merged
RSO merged 2 commits into
mainfrom
slack-bot-token-encryptio
Aug 7, 2026
Merged

RSO merged 2 commits into
mainfrom
slack-bot-token-encryptio

Conversation

@RSO

@RSO RSO commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Wires SLACK_ENCRYPTION_KEY into createSlackAdapter so Slack bot tokens are stored AES-256-GCM encrypted in the Chat SDK state store instead of plaintext.

Reads stay backward compatible with existing plaintext entries, so a follow-up backfill is needed to rewrite them.

RSO added 2 commits August 7, 2026 13:46
Wire SLACK_ENCRYPTION_KEY into createSlackAdapter so the Slack bot token
is stored AES-256-GCM encrypted in the Chat SDK state store instead of
plaintext.

The key is passed explicitly rather than relying on the adapter's env
fallback. It is coerced to undefined when empty because the adapter
resolves the option with `??`, so an empty string would both suppress
that fallback and silently disable encryption.

Reads remain backward compatible with existing plaintext entries; a
follow-up backfill will rewrite them.
@kilo-code-bot

kilo-code-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Wiring SLACK_ENCRYPTION_KEY into createSlackAdapter is correct and follows existing config patterns: the || undefined coercion properly preserves the adapter's env fallback for unset variables, the .env.test fixture decodes to exactly 32 bytes, and the change introduces no memory-leak surface (config string only, no allocations/listeners/caches).

Files Reviewed (5 files)
  • .env.local.example
  • ENVIRONMENT.md
  • apps/web/.env.test
  • apps/web/src/lib/bot/slack-adapter.ts
  • apps/web/src/lib/config.server.ts

Reviewed by kimi-k3 · Input: 43.5K · Output: 11.7K · Cached: 586.7K

Review guidance: REVIEW.md from base branch main

@RSO
RSO merged commit 5ba573b into main Aug 7, 2026
15 of 17 checks passed
@RSO
RSO deleted the slack-bot-token-encryptio branch August 7, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants