New: Header Allowlist Transform
Adds a header_allowlist transform that strips any request header not present in a configured allowlist before forwarding the request upstream. The allowlist uses a default-deny model — every header must match either a literal name (case-insensitive) or a /regex/ pattern to pass through. Stripped header names are recorded in the trace annotation stripped_headers. An optional rules field scopes the allowlist to specific host/method/path combinations. Place this transform after any transforms that inject headers (e.g. secrets) so injected headers survive the allowlist.
transforms:
- name: header_allowlist
config:
headers:
- "Authorization"
- "Content-Type"
- "User-Agent"
- "Accept"
- "/^X-Trace-.*$/"
# Optional: limit to specific hosts/methods/paths.
# Omit to apply to all requests.
rules:
- host: "api.openai.com"