File format
Configuration files use the following top-level structure:Adding the
# yaml-language-server comment at the top of your config file enables schema validation and autocompletion in editors that support the YAML Language Server.Static configuration
Theconfig block contains settings that are read once at startup. These control global behaviors that apply to the entire process.
Static config reference
| Field | Description |
|---|---|
config.logging.format | Log format: json or text |
config.logging.level | Log level: trace, debug, info, warn, error |
config.adminAddr | Admin UI address (ip:port) |
config.statsAddr | Prometheus metrics address (ip:port) |
config.readinessAddr | Readiness probe address (ip:port) |
config.dns.lookupFamily | IP family preference for DNS lookups |
config.tracing.otlpEndpoint | OTLP endpoint for OpenTelemetry traces |
config.tracing.randomSampling | CEL expression evaluating to 0.0–1.0 or bool |
config.backend.connectTimeout | Upstream connection timeout |
config.backend.poolMaxSize | Max idle connections per host |
config.session.key | AES-256-GCM key for encrypted session tokens |
config.workerThreads | Number of async worker threads |
config.enableIpv6 | Enable IPv6 support |
Local configuration
The dynamic part of the configuration — binds, listeners, routes, backends, and policies — lives outside theconfig block. When you run Agentgateway with a config file, it watches the file for changes and hot-reloads the configuration without restarting.
File watch reloads
Initial load
At startup, Agentgateway reads the config file and translates it into the Internal Representation (IR). The proxy begins handling traffic.
File change detected
When the file is modified (saved), the file watcher detects the change and re-reads the file.
Validation and translation
The new configuration is validated and translated into a new IR. If validation fails, the old configuration stays in place and an error is logged.
Configuration hierarchy
The dynamic configuration follows a strict hierarchy:binds → listeners → routes → backends, with policies attachable at the route level.
Binds
A Bind defines a TCP port to listen on.Listeners
A Listener defines how connections on a port are handled. Multiple listeners on the same port are distinguished byhostname.
| Field | Description |
|---|---|
name | Optional listener name |
hostname | Hostname to match; supports wildcards like *.example.com |
protocol | Protocol: http |
tls.cert | Path to TLS certificate |
tls.key | Path to TLS private key |
tls.minTLSVersion | Minimum TLS version (1.2 or 1.3) |
tls.maxTLSVersion | Maximum TLS version (1.2 or 1.3) |
tls.cipherSuites | Optional cipher suite allowlist (order preserved) |
Routes
A Route matches incoming requests and applies policies before forwarding to backends.| Match type | Fields | Description |
|---|---|---|
| Path | exact, pathPrefix, regex | Match by request path |
| Header | name + exact or regex | Match by header value |
| Method | method | Match by HTTP method |
| Query | name + exact or regex | Match by query parameter |
Backends
A Backend defines an upstream target. The type is inferred from the fields you provide.- HTTP backend
- MCP backend
- A2A backend
Policies
Policies are attached at the route level and control authentication, authorization, rate limiting, observability, and traffic shaping.Real-world examples
Architecture
Understand how static config, local config, and XDS map to the proxy’s Internal Representation
CEL expressions
Write authorization rules and transformation expressions using CEL