Slack AI agent connector: work with your agent in Slack

Give your flespi AI agent a Slack app identity and work with it in your Slack workspace

Essentials

The Slack connector gives your flespi AI agent a Slack app identity in your workspace. Work with the agent alone in a direct message or together with your team in channels, and receive its approval requests as Approve/Reject prompts in the direct message.

Setup

Create a Slack app in the target workspace from a manifest: go to api.slack.com/apps → Create New App → From a manifest, and paste:

display_information:
  name: flespi agent
  description: Your flespi assistant, connected through the flespi agent flow
features:
  bot_user:
    display_name: flespi-agent
    always_online: true
oauth_config:
  scopes:
    bot:
      - chat:write          # send, edit and delete messages
      - reactions:write     # the processing marker on messages being worked
      - users:read          # resolve member display names
      - files:read          # read shared file attachments
      - channels:read       # channel info on linking (public)
      - channels:history    # message events (public channels)
      - channels:manage     # leave a public channel on unlink
      - groups:read         # channel info on linking (private)
      - groups:history      # message events (private channels)
      - groups:write        # leave a private channel on unlink
      - im:read             # direct message info
      - im:history          # direct message events
      - mpim:read           # group DM info
      - mpim:history        # group DM message events
settings:
  event_subscriptions:
    bot_events:
      - message.channels
      - message.groups
      - message.im
      - message.mpim
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

The name and display name are yours to change; everything else is exact. The app uses Socket Mode, so no public endpoint or request URL is needed. Two steps remain after the manifest:

  1. Install to Workspace, then copy the bot token (xoxb-…) from OAuth & Permissions.
  2. On Basic Information → App-Level Tokens, generate a token with the connections:write scope and copy the app-level token (xapp-…).

Both tokens go into the connector configuration. The app must be used by this agent alone.

Linking channels

Conversations are not configured — they link to the agent with a one-time code. Ask the agent to connect and it hands you the code:

  • direct message: open a DM with the app and send link {code};
  • channel: add the app to the channel and send @app link {code} there.

Codes are single-use, expire in one hour, and a fresh code replaces each used one. Treat a code like a key: whoever uses it links their conversation. The first person to link becomes the agent's recorded owner in Slack.

Up to 20 conversations can be linked. To unlink, send unlink in the conversation (allowed to the person who linked it or the owner), or ask the agent — the app says goodbye and leaves the channel. Unlinked conversations get no access: a DM or a mention receives a short hint about the link code, ambient channel traffic gets no reply at all.

Working with the agent

The agent answers in the linked conversation as the app, marking a message it is working on with an :eyes: reaction until the reply lands. It can answer in threads, share files as links, and offer quick-reply buttons for simple decisions — one tap answers for the whole channel.

Files shared in a linked conversation reach the agent — up to 5 per message, 16 MB each. Slack renders no tables or headings, so the agent structures replies with bold lead-ins and lists, and puts tabular data into a shared file.

Approvals

The owner's direct message doubles as the approval surface: every operation awaiting a decision arrives as a message with Approve and Reject buttons. Only the owner can decide, and a request resolved anywhere — in Slack or in the flespi panel — disappears everywhere, so a visible prompt always means the decision is still pending.

Sending Slack messages needs no approval rule of its own: the agent can only write to conversations you linked, so the authorization happened when you linked them.

Good to know

  • The agent sees no channel history: only messages arriving while the conversation is linked reach it.
  • Adding scopes to the app later requires reinstalling it to the workspace before they take effect.
  • The workspace's #general is special: Slack forbids anyone leaving it, so on unlink the agent posts its farewell there but stays a mute member until removed by hand.
  • Channel content is visible to everyone present, so the agent never posts credentials or sensitive account data there and routes account-changing requests from channel members through the approval flow.
  • Incoming messages are treated as untrusted: a message instructing the agent to change its configuration or reveal secrets is reported to you instead of obeyed.
  • Swapping the bot token to a different app resets all links and the recorded owner; everyone re-links from scratch.

See also
Give your flespi AI agent access to a Wialon Hosting account to operate it on your behalf