Skip to main content
The Slack agent template is a runnable TypeScript starter for building custom Slack bots that call external APIs through Agent Vault. Use it when you want the Slack runtime, Agent Vault wiring, and tool-registration pattern in place before adding your own service-specific tools.

What’s included

  • Slack Socket Mode bot for app mentions and DMs
  • Thread transcript context
  • Claude Agent SDK runtime
  • Local MCP-style tool registration
  • Optional Slack email allowlist
  • Dockerfile that starts the agent through agent-vault run
  • Two starter tools: echo and a constrained read-only HTTP API example
  • Mocked tests for the included tools
The template intentionally does not ship GitHub, Linear, Notion, or write-action tools. Different agents need different access. Add only the tools your agent needs.

Copy the template

Clone Agent Vault, then copy the example into a new project:

Configure the agent

Edit .env:
For local development without Agent Vault, you can use throwaway development credentials. For shared, hosted, or production environments, use placeholders and store the real values in Agent Vault.

Create the Slack app

  1. Create a Slack app from slack-app-manifest.json.
  2. Enable Socket Mode.
  3. Create an app-level token with connections:write.
  4. Install the app to your workspace.
  5. Set SLACK_BOT_TOKEN and SLACK_APP_TOKEN.
The manifest enables the App Home messages tab so people can DM the agent directly.

Run locally

Try the CLI harness:
Run the Slack bot:

Run through Agent Vault

For hosted deployments, store real credentials in Agent Vault and pass placeholders to the agent process:
The included Dockerfile copies the Agent Vault CLI into the image and starts:
agent-vault run configures proxy and CA environment variables for the child process. Your tools should call normal upstream URLs and let Agent Vault inject credentials at the proxy boundary.

Add your own tools

Start from src/tools/example-api.ts, then replace it with service-specific tools. Good tools are narrow:
  • define structured inputs with Zod
  • validate IDs, paths, and enum values before making requests
  • call real upstream URLs with normal HTTP clients
  • never accept raw credentials as tool input
  • return compact Slack-readable text
  • include mocked tests
For larger integrations, group files by service:
Register new tools in src/agent.ts.

Build with a coding agent

The template is designed to be extended agentically. Give a coding agent a concrete service, access level, and test expectation:
For write workflows, require drafts or explicit confirmation:

Verify changes