Slack Integration
AI Intern connects directly to your team Slack workspace. Developers can trigger coding tasks, inspect plans, and grant approval directly in thread conversations.
Architecture
Section titled “Architecture”The Slack integration is powered by the Orchestrator Worker and Durable Objects:
- Inbound Webhook: Slack sends event notifications (
app_mentionor direct message) toPOST /api/slack/events. - Signature Verification: The Worker validates the
X-Slack-Signatureand timestamp using your configuredSLACK_SIGNING_SECRET. - Task Coordination: The Captain agent parses the prompt, identifies referenced GitHub repositories, and formulates a plan.
- Interactive Card: The agent posts an interactive Block Kit card with Approve Run and Reject buttons.
- Execution Feedback: While the sandbox container runs, streaming status updates keep the team informed in the Slack thread.
Setup Instructions
Section titled “Setup Instructions”-
Create a Slack App Navigate to api.slack.com/apps and create a new application in your workspace.
-
Configure Bot Token Scopes Under OAuth & Permissions, add the following Bot Token Scopes:
chat:write(post messages and replies)app_mentions:read(listen for @AI Intern mentions)channels:history(read thread context)
-
Enable Event Subscriptions Set the Request URL to your Cloudflare Worker endpoint:
https://your-worker.workers.dev/api/slack/eventsSubscribe to bot events:
app_mention. -
Enable Interactivity Under Interactivity & Shortcuts, enable interactivity and set the Request URL:
https://your-worker.workers.dev/api/slack/interactive -
Store Secrets with Wrangler Set the secrets in your Cloudflare environment:
Terminal window pnpm wrangler secret put SLACK_BOT_TOKENpnpm wrangler secret put SLACK_SIGNING_SECRET
Example Interaction
Section titled “Example Interaction”In any public or private channel where the bot is invited:
Developer:
@AI Intern fix the typo in README.md and add pnpm instructionsAI Intern: 📋 Delegation Plan Prepared
- Target:
princepal9120/ai-intern(mainbranch)- Action: Update
README.md- Test Command:
pnpm test[ Approve Run ] [ Reject ]
Once approved, AI Intern spins up an isolated sandbox container, runs the changes, and posts the resulting GitHub PR link directly in the thread.
