logo
icon

OpenAB Native

Deploy OpenAB with the native Rust coding agent (openab-agent) as a Discord/Slack bot. Single static binary, no Node.js or Python runtime, ~50ms cold start. Supports Anthropic API key or OpenAI Codex (ChatGPT Plus/Pro) subscription via OAuth device flow. Source: https://github.com/openabdev/openab

template cover
Deployed0 times
PublisherzeaburZeabur
Created2026-05-27
Tags
AIDiscord BotDeveloper Tools

OpenAB Native

One-click deployment of OpenAB with openab-agent — a native Rust coding agent built into OpenAB itself. No Node.js, no Python, no adapter layer.

Why native?

openab-nativeOther agent templates
RuntimeNone (single Rust binary)Node.js / Python
Cold start~50ms1–3s
Image size~20MB layer300–800MB
Adapter layerNone (ACP built in)Required (codex-acp / pi-acp / agy-acp)
Tools4 only: read / write / edit / bashVaries per CLI

Designed for fast, deterministic agent loops without the supply-chain surface of npm/pip.

Important Notes

  • Image tag: This template tracks the beta tag. To pin a specific version, change the image tag in Zeabur Dashboard → Service → Settings.
  • Persistent storage: /home/agent is mounted as a persistent volume. Config and auth tokens (~/.openab/agent/auth.json) survive restarts.
  • Config location: config.toml is generated at /home/agent/.config/openab/config.toml on first boot. Edit it directly after that — env vars are only used for initial setup.

Setup

1. Create a Discord Bot

  1. Go to Discord Developer Portal
  2. Create a new application and add a Bot
  3. Enable Message Content Intent under Privileged Gateway Intents
  4. Copy the bot token and paste it as DISCORD_BOT_TOKEN
  5. Go to OAuth2 → URL Generator → check scope bot → check permissions: Send Messages, Send Messages in Threads, Create Public Threads, Read Message History, Add Reactions, Manage Messages
  6. Invite the bot to your server with the generated URL

2. Choose an LLM provider (pick one)

Option A — Anthropic API key (simplest): Paste your Anthropic API key into ANTHROPIC_API_KEY. The agent defaults to claude-sonnet-4-20250514. Done.

Option B — OpenAI Codex subscription (ChatGPT Plus/Pro): Leave ANTHROPIC_API_KEY empty. After deployment, open the Exec tab in Zeabur Dashboard and run:

openab-agent auth codex-device

Follow the URL + code shown in your browser to authorize. Tokens persist at ~/.openab/agent/auth.json.

Verify with:

openab-agent auth status

3. Configure Channels (Optional)

Set OPENAB_ALLOWED_CHANNELS to restrict which channels the bot responds in. Leave empty to allow all channels.

Slack Setup (Optional)

  1. Go to https://api.slack.com/apps → Create New App → From scratch
  2. Enable Socket Mode → generate App-Level Token with scope connections:write
  3. Enable Event Subscriptions → add bot events: app_mention, message.channels, message.groups
  4. OAuth & Permissions → add scopes: app_mentions:read, chat:write, channels:history, groups:history, channels:read, groups:read, reactions:write, files:read, users:read
  5. Install App → copy xoxb-... token and xapp-... token

Choosing a model

Add env vars in Zeabur Dashboard → Service → Variables:

VariableDefaultNotes
OPENAB_AGENT_PROVIDERauto-detectanthropic or codex to force one
OPENAB_AGENT_MODELclaude-sonnet-4-20250514 (Anthropic)Any Anthropic model ID
OPENAB_AGENT_OPENAI_MODELgpt-4.1-nano (Codex)Used when provider is codex
OPENAB_AGENT_MAX_TOKENS8192Output max tokens

Auto-detect order: tries ANTHROPIC_API_KEY first, then OAuth token store.

Customization

FileDescription
/home/agent/.config/openab/config.tomlOpenAB config (sessions, reactions, etc.)
/home/agent/.openab/agent/auth.jsonOAuth tokens (Codex flow only)

To reset config to defaults: rm /home/agent/.config/openab/config.toml and restart.

Security

The native agent's bash tool filters environment variables by default — ANTHROPIC_API_KEY, *_TOKEN, *_SECRET, etc. are stripped from child processes to prevent prompt-injection exfiltration. Add safe vars to OPENAB_AGENT_BASH_ENV_ALLOW (comma-separated) if needed.