Gateway Mode
Gateway mode runs Ante as a long-lived bot reachable from Slack, Discord, or both at the same time. Each conversation — a channel thread or DM — gets its own isolated agent session, so multiple users and teams can talk to Ante in parallel without crossing state.
Basic usage
Since Ante v0.2.2, ante gateway dispatches to a separately installed ante-gateway executable. Install it from the public repository root first:
cargo install --path ante-gateway
# Start an Ante host first
ante serve --sock
# In another terminal, start the gateway
ante gateway
ante gateway and ante-gateway run the same external application. Ante searches ~/.ante/bin, then PATH, then ~/.cargo/bin; if the executable is missing, it prints installation guidance and exits with status 127.
The gateway connects to the host through the Ante SDK (the ante serve --sock socket by default, or an endpoint supplied with --connect), reads ~/.ante/channels.json, and connects to your enabled platforms. It uses the 0.2 SDK/protocol series; run it with a compatible Ante host.
Alternatively, ante gateway --connect stdio spawns an Ante host for each conversation. For stdio, the executable is resolved from a non-empty ANTE environment variable, then --executable PATH, then ante on PATH. ANTE_HOME controls the default directory for channels.json and run/serve.sock; ANTE_SERVE_TOKEN supplies the bearer token for WebSocket hosts. Logs go to stderr, while --output-format controls protocol events on stdout.
Configuration
Create ~/.ante/channels.json. You can enable just Slack, just Discord, or both.
{
"slack": {
"enabled": true,
"bot_token": "env:SLACK_BOT_TOKEN",
"app_token": "env:SLACK_APP_TOKEN",
"allow_from": "open"
},
"discord": {
"enabled": true,
"bot_token": "env:DISCORD_BOT_TOKEN",
"allow_from": ["123456789012345678"]
}
}
Values beginning with env: are read from the environment at startup, so tokens stay out of the file.
Access control
The allow_from field decides who the bot will respond to:
| Value | Who can talk to the bot |
|---|---|
"open" | Anyone on the workspace / server |
["U123", "U456"] | Only the listed user IDs |
| (omitted) | Deny-all (safe default) |
Setting up Slack
- Create an app at api.slack.com/apps → From scratch.
- Settings → Socket Mode: enable it and create an App-Level Token with
connections:write. Copy thexapp-…token — this is yourapp_token. - Features → OAuth & Permissions → Bot Token Scopes: add
chat:write,app_mentions:read,channels:history,im:history,im:write. - Features → Event Subscriptions: enable events and subscribe to
message.channelsandmessage.im. - Features → App Home: enable the Messages Tab and allow users to send messages there.
- Settings → OAuth & Permissions → Install to Workspace. Copy the
xoxb-…Bot User OAuth Token — this is yourbot_token. - In each channel you want the bot in:
/invite @your-bot-name.
export SLACK_BOT_TOKEN="xoxb-..."
export SLACK_APP_TOKEN="xapp-..."
Using the bot in Slack: @mention it in a channel, or just DM it. Replies always come in a thread.
Anytime you change scopes or event subscriptions, you must Reinstall to Workspace for them to take effect.
Setting up Discord
- Create an application at discord.com/developers/applications → New Application.
- Bot: copy the token — this is your
bot_token. Under Privileged Gateway Intents, enable Message Content Intent (required). - OAuth2 → URL Generator: under Scopes check
bot; under Bot Permissions checkSend Messages,Read Message History,View Channels. Open the generated URL to invite the bot to your server.
export DISCORD_BOT_TOKEN="..."
Using the bot in Discord: @mention it in a server channel, or just DM it. The bot replies as a reference to your message — reply to the bot's message to continue the conversation (subsequent replies in the thread route back to the original conversation without requiring explicit bot re-mentions).
Talking to the bot
Once the bot is in your workspace or server and the gateway is running, you chat with it like any other bot. A couple of replies have special meaning.
You can interrupt the bot at any time by sending:
| Command | Effect |
|---|---|
stop | Cancel the current task (like Ctrl+C in the TUI) |
When the bot asks permission to run a tool, reply with one of:
| Reply | Effect |
|---|---|
yes (or y) | Approve this tool call |
no (or n) | Deny this tool call |
always | Approve and allow this tool for the rest of the session |
See Approvals for more on tool approval flows.
CLI reference
ante gateway [--config PATH] [--connect ENDPOINT] [--model MODEL] [--provider PROVIDER] [--output-format FORMAT]
| Flag | Default | Description |
|---|---|---|
--config | ~/.ante/channels.json | Path to the channels config file |
--connect | unix:~/.ante/run/serve.sock | Ante host endpoint: unix:<path>, ws://<addr>, wss://<addr>, or stdio. Start a host with ante serve --sock |
--model | — | Model to request (otherwise uses host settings) |
--provider | — | Provider to request (otherwise resolved by host) |
--output-format | minimal | Gateway stdout format: minimal, human, or json |
By default, ante gateway connects to a local host socket at unix:~/.ante/run/serve.sock. To connect to a different host endpoint, pass --connect (e.g. ante gateway --connect unix:/tmp/ante.sock).
Output formats
| Format | Shows |
|---|---|
minimal | Agent messages, info, and errors only |
human | All events with colored formatting (useful for debugging) |
json | All events as JSON lines (useful for piping to another tool) |
Troubleshooting
Slack: "Sending messages to this app has been turned off" Enable the Messages Tab under App Home and allow users to send messages from it, then Reinstall to Workspace.
Slack: bot doesn't respond to @mentions in a channel
Make sure the bot is invited to that channel (/invite @bot-name) and that message.channels is in your Event Subscriptions. Reinstall after changing events or scopes.
Discord: bot doesn't respond
Confirm Message Content Intent is enabled on the bot and that it has Send Messages and Read Message History permissions in the channel.
Gateway shows no output after a message
Run with --output-format human to see every event, and check ~/.ante/logs/ for error details.