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
- Config file values — loaded from JSON, override environment variables
- Environment variables — override defaults
- Defaults — built-in fallback values
Config File Discovery
When no explicit config_file is provided, the SDK searches for JSON config
files in this order:
config.jsonagent_config.jsonswml_config.json.swml/config.json~/.swml/config.json/etc/swml/config.json
See ConfigLoader for
the full file discovery logic and environment variable substitution syntax.
Key Configuration Areas
Quick Example
Environment Variables
Complete reference for all environment variables used by the SDK.
ConfigLoader
JSON config file loading with environment variable substitution.
SecurityConfig
SSL, CORS, host allowlists, rate limiting, and HSTS configuration.
AuthHandler
HTTP Basic Auth, Bearer tokens, and API key authentication for FastAPI and Flask.