Skip to main content

Gateway YAML Configuration

The standalone gateway reads its configuration from <project>/.agentix/gateway.yaml.

File location resolution

  1. --cwd argument (CLI) or cwd argument (build_gateway(cwd=...))
  2. AGENTIX_GATEWAY_PROJECT_CWD environment variable
  3. AGENTIX_CWD environment variable
  4. Process CWD
  5. ~/.agentix/gateway.yaml (user home fallback)

Example gateway.yaml

agent:
name: support-agent
provider: anthropic
model: claude-sonnet-4-20250514
system_prompt: "You are a helpful support agent."
max_iterations: 20

server:
host: "0.0.0.0"
port: 8080

session_ttl: 7200

channels:
slack:
type: slack
bot_token: "${SLACK_BOT_TOKEN}"
signing_secret: "${SLACK_SIGNING_SECRET}"

whatsapp:
type: whatsapp
phone_number_id: "${WA_PHONE_NUMBER_ID}"
access_token: "${WA_ACCESS_TOKEN}"
verify_token: "${WA_VERIFY_TOKEN}"
app_secret: "${WA_APP_SECRET}"

webhook_github:
type: webhook
route: github
secret: "${GITHUB_WEBHOOK_SECRET}"

Environment variable substitution

YAML values in the form ${VAR_NAME} are substituted from the process environment. Use a .env file in the project root for local development:

# <project>/.env
SLACK_BOT_TOKEN=xoxb-...
SLACK_SIGNING_SECRET=...

Loading YAML from Python

from agentix.gateway._config import build_gateway

gateway, server_cfg, config, resolved_path = build_gateway()
# or
gateway, server_cfg, config, resolved_path = build_gateway(cwd="/path/to/project")

print(f"Loaded config from: {resolved_path}")
await gateway.start(host=server_cfg["host"], port=server_cfg["port"])

build_gateway is not re-exported from agentix.gateway. Import directly from agentix.gateway._config.

agent section

Maps to AgentixAgentOptions fields. All fields are optional with the same defaults.

server section

KeyDefaultDescription
host"0.0.0.0"Bind address
port8080HTTP port

channels section

Each key is a channel name; the type field selects the adapter. See individual adapter docs for channel-specific fields.