Skip to main content
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

requestHeaderModifier

Modify headers on the inbound request before it is forwarded to the backend.
object
Headers to be modified on the inbound request.

responseHeaderModifier

Modify headers on the response from the backend before it is returned to the client.
object
Headers to be modified on the outbound response.

requestRedirect

Respond directly to the client with an HTTP redirect without forwarding the request to a backend.
object
Directly respond to the request with a redirect.

urlRewrite

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.
object
Modify the URL path or authority before forwarding.

requestMirror

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.
object
Mirror incoming requests to another destination.

directResponse

Respond directly to the client with a static response body and status code, without forwarding to any backend.
object
Directly respond to the request with a static response.

transformations

Modify request and response bodies, headers, and metadata using structured transformation rules.
object
Modify requests and responses sent to and from the backend.

Combined example

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.