Reference for request and response transformation policies — header modification, URL rewriting, redirects, mirroring, and body transformations.
Transformation policies allow you to modify requests and responses as they pass through Agentgateway. Transformations are applied at the route level under binds[].listeners[].routes[].policies.Agentgateway supports the following transformation types:
requestHeaderModifier — add, set, or remove request headers
responseHeaderModifier — add, set, or remove response headers
requestRedirect — respond directly with an HTTP redirect
urlRewrite — modify the URL path or authority before forwarding
requestMirror — mirror requests to a secondary backend
directResponse — respond directly with a static body without forwarding
transformations — modify request and response bodies and headers
Modify the URL path or authority before forwarding the request to the backend. Unlike requestRedirect, the client does not see the rewrite — it receives the backend’s response as if the original URL was used.
Mirror (shadow) incoming requests to a secondary backend in addition to the primary backend. The client only receives the response from the primary backend. The mirror backend’s response is discarded.
requestHeaderModifier and responseHeaderModifier operate on individual HTTP headers, while transformations provides a broader object with support for request/response body modifications. Both can be used together on the same route.