Skip to main content
Describe your agent, gateway, and channel platforms in a single YAML file — no Python required.
The user defines a bot.yaml; the gateway loads it and connects the agent to every configured channel.

How It Works

Config Structure

Quick Start

1

Install

2

Set credentials

3

Create bot.yaml

Leave the model unset to resolve it from whichever provider credential is present — no OpenAI key required:
Or pin a specific model explicitly — an explicit value always wins:
4

Start the gateway with your YAML

The gateway registers the agent and starts all configured channel bots automatically.

Config Options Reference

agent section

Provider auto-detection (model: auto)

Omitting model: and writing model: auto are equivalent — both defer the choice to load time, where the gateway picks a model that matches whichever provider credential is actually present. This is the same detection ladder praisonai setup uses (default_model_for_available_provider), so a bot config is no longer tied to an OpenAI key. Detection walks the available credentials in this order and returns the first match: A detected non-OpenAI provider yields a provider-prefixed id (e.g. anthropic/claude-3-5-sonnet-latest). The list above is illustrative — the SDK helper default_model_for_available_provider is the ground truth, so new providers are picked up automatically. Precedence (highest wins): An explicit model: on the agent always wins; a default_model on the gateway block wins over detection; model: auto (or an unset model) triggers detection; gpt-4o-mini is used only when nothing else resolves.

gateway section

platforms section

Each key under platforms is a platform name. Use ${VAR_NAME} for environment variable interpolation. Supported platforms: telegram, discord, slack, whatsapp, and any platform registered via entry points.

events — inbound platform events (opt-in)

Add an events: list under a channel to receive reactions, edits, deletions, member changes, and thread creations:
See Inbound Platform Events for the full list of accepted classes and what each one enables.

Single-platform shorthand

For one platform, declare a top-level platform: (and optionally token:) instead of a platforms: map:
token: is optional — omit it and the declared platform: resolves the platform’s own documented env var (TELEGRAM_BOT_TOKEN, DISCORD_BOT_TOKEN, etc.):
The declared platform always wins. If other platform credentials are exported in the environment, bot start refuses to auto-enable them and logs a warning:
Earlier versions could silently start the wrong platform if unrelated credentials were set. Now the declared platform always wins — list multiple platforms under channels: explicitly to run them together.

Admission policy (unknown_user_policy / owner_user_id)

Control who may DM a single-bot instance directly from bot.yaml. Since PR #5111, praisonai bot start wires unknown_user_policy and owner_user_id into the running bot for telegram / discord / slack — matching the gateway path exactly.
Both fields also work at the channel level for the multi-channel shape:
Values are case-insensitive on load (ALLOW normalises to allow) and whitespace is trimmed. An unquoted numeric owner_user_id (e.g. 987654321) is coerced to a string automatically.
On startup, praisonai bot start prints the resolved policy so you can confirm it at a glance:
The line reflects the YAML value, or deny when omitted — the secure default is now visible rather than silent. It only prints on platforms that actually wire the policy (telegram / discord / slack).
Named access groups are a gateway-level feature. In standalone bot.yaml, keep using raw ids on allowed_users. See Access Groups.
When allowed_users is empty, the startup banner also names the resolved policy explicitly: ... unknown_user_policy=deny. DMs from users not in allowed_users … are dropped and the bot responds to NOBODY new. for deny, ... unknown_user_policy=allow. Bot will respond to EVERYONE. … for allow, and ... unknown_user_policy=pair. Unknown users must complete pairing … for pair (PR #5112).
A misspelled policy (alow, deney, …) fails closed at load time rather than silently reverting to deny:
Treat this error as intended — fix the typo and restart. The same fail-closed validation now applies to the multi-channel gateway.yaml schema too (PR #5112).

Unknown-User Pairing

Full owner-approval flow, inline buttons, and CLI fallback.

Bot-to-bot inbound (allow_bots / bot_loop_protection)

Wire the bot-to-bot opt-in and the runaway-loop guard directly from bot.yaml — since PR #5242, praisonai bot start reads both allow_bots and bot_loop_protection for telegram / discord / slack and folds them into BotConfig, exactly matching the gateway path.
Default-off preserves today’s “drop bot-authored inbound messages” behaviour. See Bot Loop Protection for the full policy reference.

Slack single-bot shorthand

Slack Socket Mode also needs an app-level token, so add a top-level app_token: alongside token::
app_token: accepts the same three forms as token: — plaintext, ${ENV} interpolation, and the { source, id } secret reference.
app_token is Slack-specific. When platform: is anything other than slack, a top-level app_token: is ignored — this keeps a strict non-Slack adapter from rejecting an unexpected keyword. For the multi-channel form, set app_token under the Slack entry in channels: (see Messaging Bots).
Run a Slack bot in three lines plus the agent block:
Bot startup exit codes: praisonai bot start now exits 1 on any startup failure (bad config path, missing token, unknown platform). This makes systemd Restart=on-failure and if praisonai bot start ... ; then scripting work as expected.

Shell execution keys

Add these per-channel keys to let a bot run shell commands with approval routing.

Bot Shell Execution

Full routing ladder, per-platform ID resolution, and recipes.

Environment Variable Interpolation

Values in the form ${VAR_NAME} are resolved from the current environment at startup:
Tokens stored in ~/.praisonai/.env (written by praisonai-bot onboard) are loaded automatically before interpolation.

When to Pick YAML vs Python


Common Patterns

Multi-platform setup

Custom port from environment

Or set the GATEWAY_PORT environment variable — the CLI reads it automatically when --port is not passed.

Best Practices

Never hardcode tokens in YAML. Use environment variables and store them in ~/.praisonai/.env (written by praisonai-bot onboard) or your secrets manager.
This validates every channel token before starting, so a bad token fails fast instead of silently reconnecting. It also prints a credential availability table for token, app_token, and verify_token — including the secret-reference form — without revealing any value.
Keep dev.yaml, staging.yaml, and prod.yaml — each referencing different environment variables. Pass the right one with --config.

Standalone Bot Gateway (Python)

Python API equivalent — register agents programmatically

Gateway CLI

Full list of gateway CLI commands

BotOS

Multi-platform bot orchestration

praisonai-bot SDK

Full bot-tier SDK reference