Configuration
The SignalWire Agents SDK uses a layered configuration system. Settings can come from constructor parameters, environment variables, JSON config files, or sensible defaults. The layers are resolved in priority order:
- Constructor parameters — highest priority
- Environment variables — override config file values
- Config file values — loaded from JSON
- Defaults — built-in fallback values
Config File Discovery
When no explicit config file path is provided, the SDK searches for JSON config
files using ConfigLoader.search(), which checks these locations in order:
- Current working directory
./config/~/.signalwire/
See ConfigLoader for
the full file discovery logic and environment variable substitution syntax.
Key Configuration Areas
Quick Example
Complete reference for all environment variables used by the SDK.
JSON config file loading with environment variable substitution.
HTTP Basic Auth, Bearer tokens, and API key authentication for Hono middleware.
Manages agent prompt text with raw text and structured POM-based prompts.
SWML document validation against structural rules with result caching.
Adapts Hono apps for AWS Lambda, Google Cloud Functions, and Azure Functions.
Stateless HMAC-SHA256 token generation and validation for SWAIG function calls.
SSL/TLS configuration for HTTPS serving with HSTS support.
Structured logging with Logger class and global configuration functions.