Imbi Slack bot
Project description
imbi-slackbot
A Slack bot for the Imbi DevOps service management platform. It behaves like the Imbi assistant — giving Claude live access to Imbi data and actions through tools — but speaks Slack and acts as the Slack user who asked, so every answer and action respects that user's Imbi permissions.
How It Works
The bot connects to Slack over Socket Mode (an outbound websocket, so no public ingress is required). When a user mentions the bot or DMs it, the bot:
- Resolves the Slack user to an Imbi user. It looks up the Slack user's
email (
users.info), finds the matching active ImbiUserin the graph, and mints a short-lived per-user JWT access token signed with the sharedIMBI_AUTH_JWT_SECRET— exactly the token the Imbi API issues at login. The resolution is cached with a TTL. Users with no matching Imbi account get a friendly explanation instead. - Reconstructs the thread context from Slack (
conversations.replies) so follow-up questions in a thread keep their history. Nothing is persisted server-side; the Slack thread is the conversation. - Runs Claude with the Imbi toolset. Tools are built at startup from the
Imbi API's
openapi.jsonvia an in-process FastMCP server, using the sharedimbi_common.mcpexclusion policy (auth/MFA/status/thumbnail and anyx-imbi-ai-tool: falseoperations are filtered out). The user's minted token is forwarded on every tool call, so the API enforces their permissions. - Replies in-thread with Claude's answer.
A tiny FastAPI app exposes /status (port 8004) for health checks; the Socket
Mode connection runs as a background task alongside it.
Configuration
| Environment variable | Purpose |
|---|---|
SLACK_BOT_TOKEN |
Slack bot token (xoxb-…) |
SLACK_APP_TOKEN |
Slack app-level token for Socket Mode (xapp-…) |
ANTHROPIC_API_KEY |
Anthropic API key (enables the bot when set) |
IMBI_AUTH_JWT_SECRET |
Shared HS256 secret used to mint per-user tokens |
IMBI_INTERNAL_API_URL |
In-cluster base URL of the Imbi API |
IMBI_UI_URL |
Public base URL of the Imbi UI, used to build deep links |
IMBI_INTERNAL_UI_URL |
In-cluster UI address for fetching llms.txt (e.g. the Caddy frontend); falls back to IMBI_UI_URL |
POSTGRES_URL |
Imbi graph (Apache AGE) connection URL |
IMBI_SLACKBOT_MODEL |
Claude model (default claude-sonnet-4-6) |
See src/imbi_slackbot/settings.py for the full set.
Development
just setup # install deps + pre-commit hooks
just test # run the test suite with coverage
just lint # ruff + mypy + basedpyright
just serve # run the bot against .env
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imbi_slackbot-2.11.5.tar.gz.
File metadata
- Download URL: imbi_slackbot-2.11.5.tar.gz
- Upload date:
- Size: 150.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23d1d955d5d4d329f78ea8e52bfb935bdeb22f2ff7fbd4b62d8db7967968658a
|
|
| MD5 |
de935e9305cc5774617bc56d528f731f
|
|
| BLAKE2b-256 |
f389b724ae9be7d8241d0b8ec6d88b904067cb47c535fa4fd38d854e9dc1e1d6
|
Provenance
The following attestation bundles were made for imbi_slackbot-2.11.5.tar.gz:
Publisher:
publish.yml on AWeber-Imbi/imbi-slackbot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbi_slackbot-2.11.5.tar.gz -
Subject digest:
23d1d955d5d4d329f78ea8e52bfb935bdeb22f2ff7fbd4b62d8db7967968658a - Sigstore transparency entry: 1804822453
- Sigstore integration time:
-
Permalink:
AWeber-Imbi/imbi-slackbot@74e423b214c1bcc803c2b1adee7ff7b102c89b46 -
Branch / Tag:
refs/tags/v2.11.5 - Owner: https://github.com/AWeber-Imbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74e423b214c1bcc803c2b1adee7ff7b102c89b46 -
Trigger Event:
release
-
Statement type:
File details
Details for the file imbi_slackbot-2.11.5-py3-none-any.whl.
File metadata
- Download URL: imbi_slackbot-2.11.5-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea531dd0a7dc663763cce3e75dc641dac785d542bd194a483b9dd4dfa540845d
|
|
| MD5 |
3bb31dbc6dce258444a4f259efbc1d84
|
|
| BLAKE2b-256 |
90b2e3a8d8e7616d66516b4fac4c503bbb6d45f68fcc6ae3b9d8392657807aa6
|
Provenance
The following attestation bundles were made for imbi_slackbot-2.11.5-py3-none-any.whl:
Publisher:
publish.yml on AWeber-Imbi/imbi-slackbot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbi_slackbot-2.11.5-py3-none-any.whl -
Subject digest:
ea531dd0a7dc663763cce3e75dc641dac785d542bd194a483b9dd4dfa540845d - Sigstore transparency entry: 1804822495
- Sigstore integration time:
-
Permalink:
AWeber-Imbi/imbi-slackbot@74e423b214c1bcc803c2b1adee7ff7b102c89b46 -
Branch / Tag:
refs/tags/v2.11.5 - Owner: https://github.com/AWeber-Imbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74e423b214c1bcc803c2b1adee7ff7b102c89b46 -
Trigger Event:
release
-
Statement type: