diff --git a/assets/agw-docs/pages/operations/agctl-install.md b/assets/agw-docs/pages/operations/agctl-install.md index cdb6d05f7..4b29d2ac0 100644 --- a/assets/agw-docs/pages/operations/agctl-install.md +++ b/assets/agw-docs/pages/operations/agctl-install.md @@ -16,7 +16,8 @@ Install `agctl`, the command-line tool that you use to inspect and debug agentga | `agctl costs` | Manage the model cost catalogs that price LLM requests, including importing catalog data from supported pricing sources. |{{< /version >}}{{< version exclude-if="1.3.x,1.2.x,1.1.x,1.0.x,2.2.x" >}} | `agctl catalog` | Manage the model catalogs that price LLM requests, including importing catalog data from supported pricing sources. |{{< /version >}}{{< version exclude-if="1.3.x,1.2.x,1.1.x,1.0.x,2.2.x" >}} | `agctl migrate` | Migrate agentgateway resources to newer configurations. |{{< /version >}} -| `agctl version` | Print version information for the `agctl` CLI. | +| `agctl version` | Print version information for the `agctl` CLI. |{{< version include-if="main" >}}{{< conditional-text include-if="kubernetes" >}} +| `agctl bug-report` | Collect agentgateway resources, logs, and metrics from your cluster into an archive that you can attach to a bug report. Secret values are redacted. |{{< /conditional-text >}}{{< /version >}} | `agctl completion` | Turn on autocompletion for your shell in `bash`, `zsh`, `fish`, or `powershell`. | For a complete list of subcommands and flags, see the [`agctl` CLI reference]({{< link-hextra path="/reference/agctl/" >}}). diff --git a/assets/agw-docs/pages/reference/agctl/main/agctl-bug-report.md b/assets/agw-docs/pages/reference/agctl/main/agctl-bug-report.md new file mode 100644 index 000000000..04a582aaf --- /dev/null +++ b/assets/agw-docs/pages/reference/agctl/main/agctl-bug-report.md @@ -0,0 +1,46 @@ +Collect agentgateway resources, logs, and metrics into an archive + +### Synopsis + +Collect agentgateway resources, logs, and metrics into an archive for bug reports. + +Captured resources are all Gateway API resources, and all resources with a category containing +"agentgateway". Services, ConfigMaps, Secrets, and Events are captured from every namespace holding one of +those resources, or the controller. Secret values are redacted. + +Logs and metrics are captured from agentgateway proxy pods and all pods in the controller namespace. + +``` +agctl bug-report [flags] +``` + +### Examples + +``` +agctl bug-report +agctl bug-report -n team-a -n team-b --since 1h +agctl bug-report --config-dump -o /tmp/report.tar.gz +``` + +### Options + +``` + --config-dump Capture /config_dump from each proxy + -h, --help help for bug-report + -n, --namespace strings Only capture namespaced resources and proxies in these namespaces. The controller namespace is always captured. + -o, --output string Output archive (default "bug-report.tar.gz") + --since duration Only capture logs newer than this duration (default 24h0m0s) + --tail int Maximum log lines per container; 0 for no limit (default 5000) + --timeout duration Deadline for the whole collection; anything collected before it is still written (default 5m0s) +``` + +### Options inherited from parent commands + +``` + -k, --kubeconfig string kubeconfig +``` + +### SEE ALSO + +* [agctl](../agctl/) - agctl controls and inspects Agentgateway resources + diff --git a/assets/agw-docs/pages/reference/agctl/main/agctl.md b/assets/agw-docs/pages/reference/agctl/main/agctl.md index 9002ad593..3e486cc4b 100644 --- a/assets/agw-docs/pages/reference/agctl/main/agctl.md +++ b/assets/agw-docs/pages/reference/agctl/main/agctl.md @@ -9,6 +9,7 @@ agctl controls and inspects Agentgateway resources ### SEE ALSO +* [agctl bug-report](agctl_bug-report.md) - Collect agentgateway resources, logs, and metrics into an archive * [agctl catalog](../agctl-catalog/) - Manage model catalogs * [agctl controller](../agctl-controller/) - Inspect and manage the agentgateway controller * [agctl migrate](../agctl-migrate/) - Migrate agentgateway resources to newer configurations diff --git a/assets/agw-docs/pages/reference/api/main/agentgateway.dev_agentgatewaybackends.yaml.html b/assets/agw-docs/pages/reference/api/main/agentgateway.dev_agentgatewaybackends.yaml.html index 02b8d8bbe..d3dc48c50 100644 --- a/assets/agw-docs/pages/reference/api/main/agentgateway.dev_agentgatewaybackends.yaml.html +++ b/assets/agw-docs/pages/reference/api/main/agentgateway.dev_agentgatewaybackends.yaml.html @@ -2761,22 +2761,22 @@
SNI) to use in the TLSSNI is automatically set based on theBackend of type ai.{"fast": "gpt-3.5-turbo", "smart": "gpt-4-turbo"}."/v1/chat/completions".* wildcard matches any path.completions type.Backend of type mcp.jwtAuthentication.mcp, which ensures authentication runs beforeaud claimclientId (for example Entra ID confidential clients,clientSecret key;clientSecretRef.key.iss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).jwks document is used before it is re-fetched from the IdP.5m.jwks endpoint, relative to the root, commonly".well-known/jwks.json".Strict.exp.iss; a non-empty audiences list alsoaud, regardless of these options. An empty requiredClaimsexp is present.exp, nbf, aud, sub.["exp"] when omitted. An empty list adds no requirementsiss, which is always required, and aud, which is requiredexp is present.403 error, this policy works at theMCPBackend level.list_tools, will have each item evaluated.call_tool, will evaluate the specificprocessors is the ordered list of policy processors applied to matchedmcp.params on requests or mcp.result on responses).merge to preserve fields you do not wish to mutate; null leaves the body unchanged.methods is the allowlist of JSON-RPC methods (e.g. tools/call,tools/list) routed through this processor, keyed by method name with thetools/*), a suffix*/list), or * for all methods; the most specific match wins.remote configures a gRPC policy server.allowedRequestHeaders lists the incoming request headers forwarded toMcpRequest.headers. If empty, all headers and:authority, :method, ...) are forwarded. Matching isdisallowedRequestHeaders lists header names never forwarded to theallowedRequestHeaders. Matching isfailureMode controls behavior when the policy server is unreachableFailOpen allows the request; FailClosedmetadata is static or CEL-evaluated context surfaced to the policymetadata_context google.protobuf.Struct,request.headers["x-session-id"] or string(source.address).All disables all TLS verificationHostname trusts the CA certificate but ignores hostname/SAN mismatches.verifySubjectAltNames where possible.SNI) to use in the TLSSNI is automatically set based on theHTTPS_PROXYbackendRef selects a backend for this policy.url.gateway.networking.k8s.io. Empty selects the core API groupService. Defaults to ServiceServiceService appProtocol, HTTP2 for gRPC, the original protocol forHTTP1 for HTTPS because clients often upgrade HTTPSBackend of type mcp.jwtAuthentication.mcp, which ensures authentication runs beforeaud claimclientId (for example Entra ID confidential clients,clientSecret key;clientSecretRef.key.iss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).jwks document is used before it is re-fetched from the IdP.5m.jwks endpoint, relative to the root, commonly".well-known/jwks.json".Strict.exp.iss; a non-empty audiences list alsoaud, regardless of these options. An empty requiredClaimsexp is present.exp, nbf, aud, sub.["exp"] when omitted. An empty list adds no requirementsiss, which is always required, and aud, which is requiredexp is present.403 error, this policy works at theMCPBackend level.list_tools, will have each item evaluated.call_tool, will evaluate the specificprocessors is the ordered list of policy processors applied to matchedmcp.params on requests or mcp.result on responses).merge to preserve fields you do not wish to mutate; null leaves the body unchanged.methods is the allowlist of JSON-RPC methods (e.g. tools/call,tools/list) routed through this processor, keyed by method name with thetools/*), a suffix*/list), or * for all methods; the most specific match wins.remote configures a gRPC policy server.allowedRequestHeaders lists the incoming request headers forwarded toMcpRequest.headers. If empty, all headers and:authority, :method, ...) are forwarded. Matching isdisallowedRequestHeaders lists header names never forwarded to theallowedRequestHeaders. Matching isfailureMode controls behavior when the policy server is unreachableFailOpen allows the request; FailClosedmetadata is static or CEL-evaluated context surfaced to the policymetadata_context google.protobuf.Struct,request.headers["x-session-id"] or string(source.address).All disables all TLS verificationHostname trusts the CA certificate but ignores hostname/SAN mismatches.verifySubjectAltNames where possible.SNI) to use in the TLSSNI is automatically set based on theHTTPS_PROXYbackendRef selects a backend for this policy.url.gateway.networking.k8s.io. Empty selects the core API groupService. Defaults to ServiceServiceMessages. Tool calls generated by the model are not inspected unlessToolInput is listed explicitly; ToolOutput covers results ofAll disables all TLS verificationHostname trusts the CA certificate but ignores hostname/SAN mismatches.verifySubjectAltNames where possible.SNI) to use in the TLSSNI is automatically set based on theSNI) to use in the TLSSNI is automatically set based on the$patch: delete with an overlay instead. Note that$(VAR_NAME), but it's highly discouraged.$$(VAR_NAME) avoids expansion and results in a literal$(VAR_NAME).SESSION_KEY is specified, it takes precedence over theGateway session key Secret.$patch: delete with an overlay instead. Note that$(VAR_NAME), but it's highly discouraged.$$(VAR_NAME) avoids expansion and results in a literal$(VAR_NAME).SESSION_KEY is specified, it takes precedence over theGateway session key Secret.sectionName or port may be set.Gateway.Gateway (optionally, with asectionName indicating the listener), ListenerSet, or RoutesectionName indicating the route rule).Gateway <Listener < Route < Route Rule. For example, policy A setstimeouts and retries, and policy B sets retries; the effectivetimeouts from policy A, and retries from policy B.Gateway (optionally, with asectionName indicating the listener), ListenerSet, or RoutesectionName indicating the route rule).Gateway <Listener < Route < Route Rule. For example, policy A setstimeouts and retries, and policy B sets retries; the effectivetimeouts from policy A, and retries from policy B.ConfigMap resourcessecretRef orsecretSelector for Secret-backed credentials. If the same key iskeyHash; a raw key value is rejected.ConfigMap data represents one API key. The key iskeyHash, plus optional metadata. keyHash contains a hashed APIsha256:<hex> format. metadata contains arbitrary JSONapiKey.group == 'sales'.apiVersion: v1
kind: ConfigMap
@@ -2594,170 +2594,172 @@
The name of the header to set.Validation
Pattern^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256
HTTP status code to return.Validation
Formatint32Minimum200Maximum599Documentation References (1)
HTTP status code to return.Validation
Formatint32Minimum200Maximum599Documentation References (1)
-External authentication configuration for the policy.
This selects the external server to send requests to for authentication.An extAuth policy can be conditionally set by nesting configuration under the conditional field.Validation
Ruleexactly one of backendRef or url must be set unless conditional is setRuleexactly one of the fields in [grpc http] must be setRuleforwardBody cannot be used with http.bodyRuleurl path is only valid with httpRulehttp.path may not be set when url includes a pathRuleconditional cannot be set with any other field
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (2)
-Name is the name of the referent.Validation
Min length1Max length253Documentation References (2)
-Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (2)
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (2)
-Conditional policy execution. Set this or the top-level extAuth fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
-Policy to apply when the condition matches.Validation
Ruleexactly one of backendRef or url is requiredRuleexactly one of the fields in [grpc http] must be setRuleforwardBody cannot be used with http.bodyRuleurl path is only valid with httpRulehttp.path may not be set when url includes a pathDocumentation References (1)
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (1)
-Name is the name of the referent.Validation
Min length1Max length253Documentation References (1)
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (1)
-Caches authorization results.WARNING: the safety of this feature depends on the cache key accurately
capturing every request property that the authorization service uses to
make a decision. For example, if the service returns different results
based on both path and authorization header, both must be included in
key; otherwise, one request may incorrectly reuse another request's
authorization result.If any key expression fails to evaluate or produces an unsupported value,
the request is still sent to the authorization service, but its result is
not read from or written to the cache.
-Ordered list of CEL expressions evaluated against the request
to construct the cache key.Validation
Min items1Max items16
-Maximum number of authorization results to keep in
the cache. If unset, this defaults to 10000.Validation
Formatint32Minimum1
-Duration string, such as 5m, or a CEL expression that
returns the duration that cached authorization results may be reused, or a
timestamp when the cached authorization result expires. The expression is
evaluated after the authorization response has been applied to the request.Validation
Min length1Max length16384
-Behavior when the external authorization service is
unavailable or returns an error. "FailOpen" allows the request to continue.
"FailClosed" (default) denies the request.Validation
EnumFailClosed, FailOpenDocumentation References (1)
-Uses the gRPC External Authorization
[protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.Documentation References (1)
-Uses HTTP to connect to
the authorization server. The authorization server must return a 200
status code, otherwise the request is considered an authorization
failure.Documentation References (1)
-Headers from the authorization response that
will be copied into the request to the backend.Validation
Max items64Documentation References (1)
-Path to send to the authorization server. If
unset, this defaults to the original request path.
This is a CEL expression, which allows customizing the path based on the
incoming request. For example, to add a prefix, use
"/prefix/" + request.path.Validation
Min length1Max length16384Documentation References (1)
-External processing configuration for the policy.Validation
Ruleexactly one of backendRef or url must be set unless conditional is setRuleurl must not include a pathRuleconditional cannot be set with any other fieldDocumentation References (2)
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (1)
-Name is the name of the referent.Validation
Min length1Max length253Documentation References (1)
-Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (1)
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (1)
-Conditional policy execution. Set this or the top-level extProc fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (2)
-CEL expression that must evaluate to true for this policy to execute.Validation
Min length1Max length16384Documentation References (2)
-Policy to apply when the condition matches.Validation
Ruleexactly one of backendRef or url is requiredRuleurl must not include a pathDocumentation References (2)
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (2)
-Name is the name of the referent.Validation
Min length1Max length253Documentation References (2)
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (2)
-Behavior when the external processor is unavailable or returns an error.
"FailOpen" allows the request to continue, as long as the request body has not
been sent (or started streaming) to the ext_proc. Once the request body has
started streaming to the ext_proc, the request will fail closed on error.
"FailClosed" (default) rejects the request on any failure.Validation
EnumFailClosed, FailOpen
-Metadata to send to the external processor in the
metadata_context.filter_metadata field of the ProcessingRequest.
Keyed by metadata namespace, then by key within that namespace; values are
CEL expressions evaluated per request.Validation
Max properties64
-How request and response phases are sent to ext_proc.Documentation References (1)
-Allows ext_proc mode_override values from matching header responses to update
subsequent request/response processing phases for this exchange. Defaults to false.
-How request bodies are sent to the external processor.
Defaults to FullDuplexStreamed.Validation
EnumBuffered, BufferedPartial, FullDuplexStreamed, NoneDocumentation References (1)
-Whether request headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
-Whether request trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
-How response bodies are sent to the external processor.
Defaults to FullDuplexStreamed.Validation
EnumBuffered, BufferedPartial, FullDuplexStreamed, NoneDocumentation References (1)
-Whether response headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
-Whether response trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
-Request attributes to send to the external processor in the request
attributes field of the ProcessingRequest. Values are CEL expressions
evaluated per request.Validation
Max properties64
-Response attributes to send to the external processor in the response
attributes field of the ProcessingRequest. Values are CEL expressions
evaluated per response.Validation
Max properties64
-Allows ext_proc mode_override values from matching header responses to update
subsequent request/response processing phases for this exchange. Defaults to false.Documentation References (1)
-Whether request headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
-Whether request trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
-Whether response headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
-Whether response trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
-Request and response header modification policy.Validation
Ruleat least one of the fields in [request response] must be set
-Header changes to apply before forwarding a request.
-Add adds the given header(s) (name, value) to the request
before the action. It appends to any existing values associated
with the header name.Input:
GET /foo HTTP/1.1
my-header: fooConfig:
add:
- name: "my-header"
value: "bar,baz"Output:
GET /foo HTTP/1.1
my-header: foo,bar,bazValidation
Max items16List typemapList map keysname
-Remove the given header(s) from the HTTP request before the action. The
value of Remove is a list of HTTP header names. Note that the header
names are case-insensitive (see
https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).Input:
GET /foo HTTP/1.1
my-header1: foo
my-header2: bar
my-header3: bazConfig:
remove: ["my-header1", "my-header3"]Output:
GET /foo HTTP/1.1
my-header2: barValidation
Max items16List typeset
-Set overwrites the request with the given header (name, value)
before the action.Input:
GET /foo HTTP/1.1
my-header: fooConfig:
set:
- name: "my-header"
value: "bar"Output:
GET /foo HTTP/1.1
my-header: barValidation
Max items16List typemapList map keysname
-Header changes to apply before returning a response.
-How to rewrite the Host header for requests.If the HTTPRoute urlRewrite filter already specifies a host rewrite,
this setting is ignored.
-Hostname rewrite mode.The following may be specified:
* Auto: automatically set the Host header based on the destination.
* None: do not rewrite the Host header. The original Host header
will be passed through.This setting defaults to Auto when connecting to hostname-based
Backend types, and None otherwise, for Service or IP-based
backends.Validation
EnumAuto, None
-Authenticates users based on JWT tokens.Validation
RulejwtAuthentication.mcp requires exactly one providerRulejwtAuthentication.mcp requires mode StrictDocumentation References (13)
-Where JWT credentials are read from.
If omitted, credentials are read from the Authorization header with the Bearer prefix.Validation
Ruleexactly one of the fields in [header queryParameter cookie expression] must be set
-Enables MCP OAuth metadata endpoint handling
and MCP-specific authentication behavior on top of standard JWT validation.
When set, the gateway will serve the MCP OAuth metadata discovery endpoints.
-Client ID to use for short-circuiting Dynamic Client Registration.
If set, the gateway will not proxy registration requests to the IDP and instead return this client ID.
-Identity provider to use for MCP authentication flows.Validation
EnumAuth0, Authentik, Descope, Entra, Keycloak, Okta
-Metadata to use for MCP resources,
served at the MCP OAuth metadata endpoints.
-Validation mode for JWT authentication. Defaults to Strict.Validation
EnumOptional, Permissive, StrictDocumentation References (12)
-Keeps a successfully validated JWT in its original location. By default, the gateway removes
the JWT after validation. When the token only needs to be forwarded to the selected backend,
prefer backendAuth.passthrough so it is not exposed to other policies in the request path.Documentation References (1)
-No description for this field.Validation
Min items1Max items64Documentation References (13)
-Allowed audiences that are allowed
access. This corresponds to the aud claim
([RFC 7519 §4.1.3](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)).
If unset, any audience is allowed.Validation
Min items1Max items64Documentation References (9)
-IdP that issued the JWT. This corresponds to the
iss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).Validation
Min length1Max length256Documentation References (13)
-JSON Web Key Set used to validate the signature of the
JWT.Validation
Ruleexactly one of the fields in [remote inline] must be setDocumentation References (13)
-Inline JSON Web Key Set used to validate the
signature of the JWT.Validation
Min length2Max length65536Documentation References (3)
-How to reach the JSON Web Key Set from a remote
address.Validation
RulejwksPath is required when backendRef is setRulejwksPath may not be set when url is setRuleexactly one of the fields in [backendRef url] must be setDocumentation References (10)
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (10)
-Group of the referent, for example gateway.networking.k8s.io. Empty selects the core API groupValidation
Pattern^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Max length253Documentation References (8)
-Kubernetes resource kind of the referent, for example Service. Defaults to ServiceValidation
DefaultServicePattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63Documentation References (10)
-Name is the name of the referent.Validation
Min length1Max length253Documentation References (10)
-Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (10)
-How long a fetched jwks document is used before it is re-fetched from the IdP.
Defaults to 5m.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32RulecacheDuration must be at least 5m.
-Path to the IdP jwks endpoint, relative to the root, commonly
".well-known/jwks.json".Validation
Min length1Max length1024Documentation References (10)
-The phase to apply the traffic policy to. If the phase is PreRouting,
the targetRef must be a Gateway or a Listener. PreRouting is
typically used only when a policy needs to influence the routing
decision.Even when using PostRouting mode, the policy can target the
Gateway or Listener. This is a helper for applying the policy to all
routes under that Gateway or Listener, and follows the merging logic
described above.Note: PreRouting and PostRouting rules do not merge together. These
are independent execution phases. That is, all PreRouting rules will
merge and execute, then all PostRouting rules will merge and execute.If unset, this defaults to PostRouting.Validation
EnumPostRouting, PreRouting
-Rate limiting configuration for the policy.
This limits the rate at which requests are processed.Validation
Ruleat least one of the fields in [conditional global local] must be setRuleconditional cannot be set with any other fieldDocumentation References (10)
-Conditional policy execution. Set this or the top-level rateLimit fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
-Policy to apply when the condition matches.Validation
Ruleat least one of the fields in [global local] must be setDocumentation References (1)
-Global rate limiting policy using an external service.Validation
Ruleurl must not include a pathRuleexactly one of the fields in [backendRef url] must be set
-Dimensions for rate limiting. These values are
passed to the rate limit service which applies configured limits based
on them. Each descriptor represents a single rate limit rule with one or
more entries.Validation
Min items1Max items16
-Common Expression Language (CEL) expression that determines
the cost of the request for this descriptor. If unset, Requests costs
default to 1, and Tokens costs default to the total token count.Tokens cost are evaluated after the request has completed. For non-streaming requests, request, llm, and
response fields are all available; for streaming requests, response is not available (however, all LLM
attributes are in llm). For Requests, cost is computed during the request phase.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
-Individual components that make up this descriptor.Validation
Min items1Max items16
-Common Expression Language (CEL) expression that
defines the value for the descriptor.For example, to rate limit based on the Client IP: source.address.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
-Name of the descriptor.Validation
Min length1Max length64
-Common Expression Language (CEL) expression that returns a dynamic
limit override for this descriptor. The expression must evaluate to an
object containing unit and requestsPerUnit, for example
{"unit":"minute","requestsPerUnit":5}.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
-Cost unit. If unspecified,
Requests is used.Validation
EnumRequests, Tokens
-Domain under which this limit should apply.
This is an arbitrary string that enables a rate limit server to distinguish between different applications.Validation
Min length1Max length256
-Behavior when the remote rate limit service is
unavailable or returns an error. FailOpen allows the request to continue.
FailClosed (default) denies the request.Validation
EnumFailClosed, FailOpen
-Local rate limiting policy.Validation
Min items1Max items16Documentation References (1)
-Allowance of requests above the request-per-unit
that should be allowed within a short period of time.Validation
Formatint32Minimum0
-CEL expression selecting the bucket the request counts against, for example jwt.sub for a
per-user limit or jwt.team for a per-team limit. Each distinct value gets its own bucket with
the limit above. Requests without a value, or whose expression cannot be evaluated, share one
bucket. When unset, all requests share one bucket. Each proxy instance keeps a bounded number
of buckets per rule and drops the least used ones.Validation
Min length1Max length16384
-Number of HTTP requests per unit of time that
are allowed. Requests exceeding this limit will fail with a 429
error.Validation
Formatint32Minimum1Documentation References (1)
-Number of LLM tokens per unit of time that are
allowed. Requests exceeding this limit will fail with a 429 error.Both input and output tokens are counted. However, token counts are not known until the request completes. As a
result, token-based rate limits will apply to future requests only.Validation
Formatint32Minimum1
-Unit of time for the limit.Validation
EnumHours, Minutes, SecondsDocumentation References (1)
-Global rate limiting policy using an external service.Validation
Ruleurl must not include a pathRuleexactly one of the fields in [backendRef url] must be set
-backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service reference
-Kubernetes resource kind of the referent, for example Service. Defaults to ServiceValidation
DefaultServicePattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63Documentation References (2)
-Name is the name of the referent.Validation
Min length1Max length253
-Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (2)
-Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535
-Dimensions for rate limiting. These values are
passed to the rate limit service which applies configured limits based
on them. Each descriptor represents a single rate limit rule with one or
more entries.Validation
Min items1Max items16
-Individual components that make up this descriptor.Validation
Min items1Max items16
-Common Expression Language (CEL) expression that
defines the value for the descriptor.For example, to rate limit based on the Client IP: source.address.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
-Name of the descriptor.Validation
Min length1Max length64
-Common Expression Language (CEL) expression that returns a dynamic
limit override for this descriptor. The expression must evaluate to an
object containing unit and requestsPerUnit, for example
{"unit":"minute","requestsPerUnit":5}.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384Documentation References (1)
-Cost unit. If unspecified,
Requests is used.Validation
EnumRequests, TokensDocumentation References (2)
-Domain under which this limit should apply.
This is an arbitrary string that enables a rate limit server to distinguish between different applications.Validation
Min length1Max length256
-Local rate limiting policy.Validation
Min items1Max items16Documentation References (9)
-Allowance of requests above the request-per-unit
that should be allowed within a short period of time.Validation
Formatint32Minimum0
-CEL expression selecting the bucket the request counts against, for example jwt.sub for a
per-user limit or jwt.team for a per-team limit. Each distinct value gets its own bucket with
the limit above. Requests without a value, or whose expression cannot be evaluated, share one
bucket. When unset, all requests share one bucket. Each proxy instance keeps a bounded number
of buckets per rule and drops the least used ones.Validation
Min length1Max length16384Documentation References (3)
-Number of HTTP requests per unit of time that
are allowed. Requests exceeding this limit will fail with a 429
error.Validation
Formatint32Minimum1
-Number of LLM tokens per unit of time that are
allowed. Requests exceeding this limit will fail with a 429 error.Both input and output tokens are counted. However, token counts are not known until the request completes. As a
result, token-based rate limits will apply to future requests only.Validation
Formatint32Minimum1
-Unit of time for the limit.Validation
EnumHours, Minutes, SecondsDocumentation References (9)
-Retry policy.Documentation References (3)
-Attempts specifies the maximum number of times an individual request
from the gateway to a backend should be retried.If the maximum number of retries has been attempted without a successful
response from the backend, the Gateway MUST return an error.When this field is unspecified, the number of times to attempt to retry
a backend request is implementation-specific.Support: ExtendedValidation
Minimum1Documentation References (3)
-Minimum duration to wait between retry attempts, in Gateway API Duration format. Implementations may add jitter or use exponential backoff, and must not exceed a configured request timeout. Support: ExtendedValidation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Documentation References (3)
-Codes defines the HTTP response status codes for which a backend request
should be retried.Support: ExtendedValidation
List typesetDocumentation References (3)
-condition is a CEL expression evaluated against each response to decide
whether to retry. A response is retried when its status code is in codes or
this expression evaluates to true.Validation
Min length1Max length16384
-precondition is a CEL expression evaluated against the request before any
attempt is made. When it evaluates to false, retries are disabled and only
the initial attempt is made, for example request.method == "GET".
Retrying requires buffering the request body in memory for replay, so this lets
us skip that cost when the request is known to be non-retriable (for example
streaming uploads or long-lived connections like websockets).Validation
Min length1Max length16384
-Request timeouts.
It is applicable to HTTPRoute resources and ignored for other targeted
kinds.Validation
Ruleat least one of the fields in [request responseIdle] must be setDocumentation References (2)
-Maximum time allowed from the start of downstream request processing until response headers
are received. The response body is not included; use responseIdle to bound gaps between body frames.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32Rulerequest must be at least 1msDocumentation References (2)
-Maximum time to wait for a frame from the upstream response body.Limits how long the gateway waits for more response data from the backend.
Time spent processing the response or waiting for the client to receive it does not count.This complements Request rather than overlapping it: Request stops applying once the response
headers arrive, so it places no bound on how long the response body may take, and it cannot
distinguish a stalled stream from a slow one.This does not apply to responses that switch protocols, so upgraded WebSocket connections and
CONNECT tunnels are never terminated by it.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32RuleresponseIdle must be at least 1ms
-Mutates and transforms requests and responses
before forwarding them to the destination.Validation
Ruleat least one of the fields in [conditional request response] must be setRuleconditional cannot be set with any other fieldDocumentation References (22)
-Conditional policy execution. Set this or the top-level transformation fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
-Policy to apply when the condition matches.Validation
Ruleat least one of the fields in [request response] must be setDocumentation References (1)
-Request transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (1)
-Headers to add to the request and what each value
should be set to. If there is already a header with these values then
append the value as an extra entry.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (1)
-The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (1)
-CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (1)
-Request transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (15)
-HTTP body transformation.Validation
Min length1Max length16384
-Header names to remove from the request or
response.Validation
Min items1Max items16List typeset
-Headers to set and the values to use.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (10)
-The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (10)
-CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (10)
-Response transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (6)
-Headers to add to the request and what each value
should be set to. If there is already a header with these values then
append the value as an extra entry.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (1)
-The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (1)
-CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (1)
-HTTP body transformation.Validation
Min length1Max length16384Documentation References (1)
-Header names to remove from the request or
response.Validation
Min items1Max items16List typesetDocumentation References (1)
-Headers to set and the values to use.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (5)
-The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (5)
-CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (5)
-Current policy status.
-Ancestor resources (usually Gateways) associated with the policy, with the policy's status for each. At most 16 entries; an empty list means the policy is not relevant to any ancestorValidation
Max items16List typeatomic
-AncestorRef corresponds with a ParentRef in the spec that this
PolicyAncestorStatus struct describes the status of.
-Group is the group of the referent.
When unspecified, "gateway.networking.k8s.io" is inferred.
To set the core API group (such as for a "Service" kind referent),
Group must be explicitly set to "" (empty string).Support: CoreValidation
Defaultgateway.networking.k8s.ioPattern^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Max length253
-Kind is kind of the referent.There are two kinds of parent resources with "Core" support:* Gateway (Gateway conformance profile)
* Service (Mesh conformance profile, ClusterIP Services only)Support for other resources is Implementation-Specific.Validation
DefaultGatewayPattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63
-Name is the name of the referent.Support: CoreValidation
Min length1Max length253
-Namespace of the referent. Defaults to the Route's local namespace. Cross-namespace references must be explicitly allowed, for example via ReferenceGrant. Support: CoreValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63
-Port this Route targets on the parent, interpreted per parent kind (for example a Gateway listener port or Service port). Support: ExtendedValidation
Formatint32Minimum1Maximum65535
-Name of a section within the target resource, for example a Gateway Listener name or Service port name. Empty references the entire resource. Support: CoreValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Min length1Max length253
-Conditions describing the status of the policy for this ancestorValidation
Min items1Max items8List typemapList map keystype
-lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.Validation
Formatdate-time
-message is a human readable message indicating details about the transition.
This may be an empty string.Validation
Max length32768
-observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.Validation
Formatint64Minimum0
-reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.Validation
Pattern^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$Min length1Max length1024
-status of the condition, one of True, False, Unknown.Validation
EnumTrue, False, Unknown
-type of condition in CamelCase or in foo.example.com/CamelCase.Validation
Pattern^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$Max length316
-ControllerName is a domain/path string that indicates the name of the
controller that wrote this status. This corresponds with the
controllerName field on GatewayClass.Example: "example.net/gateway-controller".The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are
valid Kubernetes names
(https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).Controllers MUST populate this field when writing status. Controllers should ensure that
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary.Validation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$Min length1Max length253
+External authentication configuration for the policy.
This selects the external server to send requests to for authentication.An extAuth policy can be conditionally set by nesting configuration under the conditional field.Validation
Ruleexactly one of backendRef or url must be set unless conditional is setRuleexactly one of the fields in [grpc http] must be setRuleforwardBody cannot be used with http.bodyRuleurl path is only valid with httpRulehttp.path may not be set when url includes a pathRuleconditional cannot be set with any other field
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service reference
+Group of the referent, for example gateway.networking.k8s.io. Empty selects the core API groupValidation
Pattern^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Max length253Documentation References (1)
+Kubernetes resource kind of the referent, for example Service. Defaults to ServiceValidation
DefaultServicePattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63Documentation References (1)
+Name is the name of the referent.Validation
Min length1Max length253
+Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (2)
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (2)
+Conditional policy execution. Set this or the top-level extAuth fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
+Policy to apply when the condition matches.Validation
Ruleexactly one of backendRef or url is requiredRuleexactly one of the fields in [grpc http] must be setRuleforwardBody cannot be used with http.bodyRuleurl path is only valid with httpRulehttp.path may not be set when url includes a pathDocumentation References (1)
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (1)
+Name is the name of the referent.Validation
Min length1Max length253Documentation References (1)
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (1)
+Caches authorization results.WARNING: the safety of this feature depends on the cache key accurately
capturing every request property that the authorization service uses to
make a decision. For example, if the service returns different results
based on both path and authorization header, both must be included in
key; otherwise, one request may incorrectly reuse another request's
authorization result.If any key expression fails to evaluate or produces an unsupported value,
the request is still sent to the authorization service, but its result is
not read from or written to the cache.
+Ordered list of CEL expressions evaluated against the request
to construct the cache key.Validation
Min items1Max items16
+Maximum number of authorization results to keep in
the cache. If unset, this defaults to 10000.Validation
Formatint32Minimum1
+Duration string, such as 5m, or a CEL expression that
returns the duration that cached authorization results may be reused, or a
timestamp when the cached authorization result expires. The expression is
evaluated after the authorization response has been applied to the request.Validation
Min length1Max length16384
+Behavior when the external authorization service is
unavailable or returns an error. "FailOpen" allows the request to continue.
"FailClosed" (default) denies the request.Validation
EnumFailClosed, FailOpenDocumentation References (1)
+Uses the gRPC External Authorization
[protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.Documentation References (1)
+Uses HTTP to connect to
the authorization server. The authorization server must return a 200
status code, otherwise the request is considered an authorization
failure.Documentation References (2)
+Headers from the authorization response that
will be copied into the request to the backend.Validation
Max items64Documentation References (1)
+Path to send to the authorization server. If
unset, this defaults to the original request path.
This is a CEL expression, which allows customizing the path based on the
incoming request. For example, to add a prefix, use
"/prefix/" + request.path.Validation
Min length1Max length16384Documentation References (2)
+External processing configuration for the policy.Validation
Ruleexactly one of backendRef or url must be set unless conditional is setRuleurl must not include a pathRuleconditional cannot be set with any other fieldDocumentation References (2)
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (1)
+Name is the name of the referent.Validation
Min length1Max length253Documentation References (1)
+Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (1)
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (1)
+Conditional policy execution. Set this or the top-level extProc fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (2)
+CEL expression that must evaluate to true for this policy to execute.Validation
Min length1Max length16384Documentation References (2)
+Policy to apply when the condition matches.Validation
Ruleexactly one of backendRef or url is requiredRuleurl must not include a pathDocumentation References (2)
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (2)
+Name is the name of the referent.Validation
Min length1Max length253Documentation References (2)
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (2)
+Behavior when the external processor is unavailable or returns an error.
"FailOpen" allows the request to continue, as long as the request body has not
been sent (or started streaming) to the ext_proc. Once the request body has
started streaming to the ext_proc, the request will fail closed on error.
"FailClosed" (default) rejects the request on any failure.Validation
EnumFailClosed, FailOpen
+Metadata to send to the external processor in the
metadata_context.filter_metadata field of the ProcessingRequest.
Keyed by metadata namespace, then by key within that namespace; values are
CEL expressions evaluated per request.Validation
Max properties64
+How request and response phases are sent to ext_proc.Documentation References (1)
+Allows ext_proc mode_override values from matching header responses to update
subsequent request/response processing phases for this exchange. Defaults to false.
+How request bodies are sent to the external processor.
Defaults to FullDuplexStreamed.Validation
EnumBuffered, BufferedPartial, FullDuplexStreamed, NoneDocumentation References (1)
+Whether request headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
+Whether request trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
+How response bodies are sent to the external processor.
Defaults to FullDuplexStreamed.Validation
EnumBuffered, BufferedPartial, FullDuplexStreamed, NoneDocumentation References (1)
+Whether response headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
+Whether response trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, Skip
+Request attributes to send to the external processor in the request
attributes field of the ProcessingRequest. Values are CEL expressions
evaluated per request.Validation
Max properties64
+Response attributes to send to the external processor in the response
attributes field of the ProcessingRequest. Values are CEL expressions
evaluated per response.Validation
Max properties64
+Allows ext_proc mode_override values from matching header responses to update
subsequent request/response processing phases for this exchange. Defaults to false.Documentation References (1)
+Whether request headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
+Whether request trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
+Whether response headers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
+Whether response trailers are sent to the external processor.
Defaults to Send.Validation
EnumSend, SkipDocumentation References (1)
+Request and response header modification policy.Validation
Ruleat least one of the fields in [request response] must be set
+Header changes to apply before forwarding a request.
+Add adds the given header(s) (name, value) to the request
before the action. It appends to any existing values associated
with the header name.Input:
GET /foo HTTP/1.1
my-header: fooConfig:
add:
- name: "my-header"
value: "bar,baz"Output:
GET /foo HTTP/1.1
my-header: foo,bar,bazValidation
Max items16List typemapList map keysname
+Remove the given header(s) from the HTTP request before the action. The
value of Remove is a list of HTTP header names. Note that the header
names are case-insensitive (see
https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).Input:
GET /foo HTTP/1.1
my-header1: foo
my-header2: bar
my-header3: bazConfig:
remove: ["my-header1", "my-header3"]Output:
GET /foo HTTP/1.1
my-header2: barValidation
Max items16List typeset
+Set overwrites the request with the given header (name, value)
before the action.Input:
GET /foo HTTP/1.1
my-header: fooConfig:
set:
- name: "my-header"
value: "bar"Output:
GET /foo HTTP/1.1
my-header: barValidation
Max items16List typemapList map keysname
+Header changes to apply before returning a response.
+How to rewrite the Host header for requests.If the HTTPRoute urlRewrite filter already specifies a host rewrite,
this setting is ignored.
+Hostname rewrite mode.The following may be specified:
* Auto: automatically set the Host header based on the destination.
* None: do not rewrite the Host header. The original Host header
will be passed through.This setting defaults to Auto when connecting to hostname-based
Backend types, and None otherwise, for Service or IP-based
backends.Validation
EnumAuto, None
+Authenticates users based on JWT tokens.Validation
RulejwtAuthentication.mcp requires exactly one providerRulejwtAuthentication.mcp requires mode StrictDocumentation References (13)
+Where JWT credentials are read from.
If omitted, credentials are read from the Authorization header with the Bearer prefix.Validation
Ruleexactly one of the fields in [header queryParameter cookie expression] must be set
+Enables MCP OAuth metadata endpoint handling
and MCP-specific authentication behavior on top of standard JWT validation.
When set, the gateway will serve the MCP OAuth metadata discovery endpoints.
+Client ID to use for short-circuiting Dynamic Client Registration.
If set, the gateway will not proxy registration requests to the IDP and instead return this client ID.
+Identity provider to use for MCP authentication flows.Validation
EnumAuth0, Authentik, Descope, Entra, Keycloak, Okta
+Metadata to use for MCP resources,
served at the MCP OAuth metadata endpoints.
+Validation mode for JWT authentication. Defaults to Strict.Validation
EnumOptional, Permissive, StrictDocumentation References (12)
+Keeps a successfully validated JWT in its original location. By default, the gateway removes
the JWT after validation. When the token only needs to be forwarded to the selected backend,
prefer backendAuth.passthrough so it is not exposed to other policies in the request path.Documentation References (1)
+No description for this field.Validation
Min items1Max items64Documentation References (13)
+Allowed audiences that are allowed
access. This corresponds to the aud claim
([RFC 7519 §4.1.3](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)).
If unset, any audience is allowed.Validation
Min items1Max items64Documentation References (9)
+IdP that issued the JWT. This corresponds to the
iss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).Validation
Min length1Max length256Documentation References (13)
+JSON Web Key Set used to validate the signature of the
JWT.Validation
Ruleexactly one of the fields in [remote inline] must be setDocumentation References (13)
+Inline JSON Web Key Set used to validate the
signature of the JWT.Validation
Min length2Max length65536Documentation References (3)
+How to reach the JSON Web Key Set from a remote
address.Validation
RulejwksPath is required when backendRef is setRulejwksPath may not be set when url is setRuleexactly one of the fields in [backendRef url] must be setDocumentation References (10)
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service referenceDocumentation References (10)
+Group of the referent, for example gateway.networking.k8s.io. Empty selects the core API groupValidation
Pattern^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Max length253Documentation References (8)
+Kubernetes resource kind of the referent, for example Service. Defaults to ServiceValidation
DefaultServicePattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63Documentation References (10)
+Name is the name of the referent.Validation
Min length1Max length253Documentation References (10)
+Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535Documentation References (10)
+How long a fetched jwks document is used before it is re-fetched from the IdP.
Defaults to 5m.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32RulecacheDuration must be at least 5m.
+Path to the IdP jwks endpoint, relative to the root, commonly
".well-known/jwks.json".Validation
Min length1Max length1024Documentation References (10)
+The phase to apply the traffic policy to. If the phase is PreRouting,
the targetRef must be a Gateway or a Listener. PreRouting is
typically used only when a policy needs to influence the routing
decision.Even when using PostRouting mode, the policy can target the
Gateway or Listener. This is a helper for applying the policy to all
routes under that Gateway or Listener, and follows the merging logic
described above.Note: PreRouting and PostRouting rules do not merge together. These
are independent execution phases. That is, all PreRouting rules will
merge and execute, then all PostRouting rules will merge and execute.If unset, this defaults to PostRouting.Validation
EnumPostRouting, PreRouting
+Rate limiting configuration for the policy.
This limits the rate at which requests are processed.Validation
Ruleat least one of the fields in [conditional global local] must be setRuleconditional cannot be set with any other fieldDocumentation References (10)
+Conditional policy execution. Set this or the top-level rateLimit fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
+Policy to apply when the condition matches.Validation
Ruleat least one of the fields in [global local] must be setDocumentation References (1)
+Global rate limiting policy using an external service.Validation
Ruleurl must not include a pathRuleexactly one of the fields in [backendRef url] must be set
+Dimensions for rate limiting. These values are
passed to the rate limit service which applies configured limits based
on them. Each descriptor represents a single rate limit rule with one or
more entries.Validation
Min items1Max items16
+Common Expression Language (CEL) expression that determines
the cost of the request for this descriptor. If unset, Requests costs
default to 1, and Tokens costs default to the total token count.Tokens cost are evaluated after the request has completed. For non-streaming requests, request, llm, and
response fields are all available; for streaming requests, response is not available (however, all LLM
attributes are in llm). For Requests, cost is computed during the request phase.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
+Individual components that make up this descriptor.Validation
Min items1Max items16
+Common Expression Language (CEL) expression that
defines the value for the descriptor.For example, to rate limit based on the Client IP: source.address.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
+Name of the descriptor.Validation
Min length1Max length64
+Common Expression Language (CEL) expression that returns a dynamic
limit override for this descriptor. The expression must evaluate to an
object containing unit and requestsPerUnit, for example
{"unit":"minute","requestsPerUnit":5}.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
+Cost unit. If unspecified,
Requests is used.Validation
EnumRequests, Tokens
+Domain under which this limit should apply.
This is an arbitrary string that enables a rate limit server to distinguish between different applications.Validation
Min length1Max length256
+Behavior when the remote rate limit service is
unavailable or returns an error. FailOpen allows the request to continue.
FailClosed (default) denies the request.Validation
EnumFailClosed, FailOpen
+Local rate limiting policy.Validation
Min items1Max items16Documentation References (1)
+Allowance of requests above the request-per-unit
that should be allowed within a short period of time.Validation
Formatint32Minimum0
+CEL expression selecting the bucket the request counts against, for example jwt.sub for a
per-user limit or jwt.team for a per-team limit. Each distinct value gets its own bucket with
the limit above. Requests without a value, or whose expression cannot be evaluated, share one
bucket. When unset, all requests share one bucket. Each proxy instance keeps a bounded number
of buckets per rule and drops the least used ones.Validation
Min length1Max length16384
+Number of HTTP requests per unit of time that
are allowed. Requests exceeding this limit will fail with a 429
error.Validation
Formatint32Minimum1Documentation References (1)
+Number of LLM tokens per unit of time that are
allowed. Requests exceeding this limit will fail with a 429 error.Both input and output tokens are counted. However, token counts are not known until the request completes. As a
result, token-based rate limits will apply to future requests only.Validation
Formatint32Minimum1
+Unit of time for the limit.Validation
EnumHours, Minutes, SecondsDocumentation References (1)
+Global rate limiting policy using an external service.Validation
Ruleurl must not include a pathRuleexactly one of the fields in [backendRef url] must be set
+backendRef selects a backend for this policy.
Mutually exclusive with url.Validation
RuleMust have port for Service reference
+Kubernetes resource kind of the referent, for example Service. Defaults to ServiceValidation
DefaultServicePattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63Documentation References (2)
+Name is the name of the referent.Validation
Min length1Max length253
+Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespaceValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63Documentation References (2)
+Destination port number. Required when the referent is a Kubernetes ServiceValidation
Formatint32Minimum1Maximum65535
+Dimensions for rate limiting. These values are
passed to the rate limit service which applies configured limits based
on them. Each descriptor represents a single rate limit rule with one or
more entries.Validation
Min items1Max items16
+Individual components that make up this descriptor.Validation
Min items1Max items16
+Common Expression Language (CEL) expression that
defines the value for the descriptor.For example, to rate limit based on the Client IP: source.address.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384
+Name of the descriptor.Validation
Min length1Max length64
+Common Expression Language (CEL) expression that returns a dynamic
limit override for this descriptor. The expression must evaluate to an
object containing unit and requestsPerUnit, for example
{"unit":"minute","requestsPerUnit":5}.See https://agentgateway.dev/docs/standalone/latest/reference/cel/ for more info.Validation
Min length1Max length16384Documentation References (1)
+Cost unit. If unspecified,
Requests is used.Validation
EnumRequests, TokensDocumentation References (2)
+Domain under which this limit should apply.
This is an arbitrary string that enables a rate limit server to distinguish between different applications.Validation
Min length1Max length256
+Local rate limiting policy.Validation
Min items1Max items16Documentation References (9)
+Allowance of requests above the request-per-unit
that should be allowed within a short period of time.Validation
Formatint32Minimum0
+CEL expression selecting the bucket the request counts against, for example jwt.sub for a
per-user limit or jwt.team for a per-team limit. Each distinct value gets its own bucket with
the limit above. Requests without a value, or whose expression cannot be evaluated, share one
bucket. When unset, all requests share one bucket. Each proxy instance keeps a bounded number
of buckets per rule and drops the least used ones.Validation
Min length1Max length16384Documentation References (3)
+Number of HTTP requests per unit of time that
are allowed. Requests exceeding this limit will fail with a 429
error.Validation
Formatint32Minimum1
+Number of LLM tokens per unit of time that are
allowed. Requests exceeding this limit will fail with a 429 error.Both input and output tokens are counted. However, token counts are not known until the request completes. As a
result, token-based rate limits will apply to future requests only.Validation
Formatint32Minimum1
+Unit of time for the limit.Validation
EnumHours, Minutes, SecondsDocumentation References (9)
+Retry policy.Documentation References (3)
+Attempts specifies the maximum number of times an individual request
from the gateway to a backend should be retried.If the maximum number of retries has been attempted without a successful
response from the backend, the Gateway MUST return an error.When this field is unspecified, the number of times to attempt to retry
a backend request is implementation-specific.Support: ExtendedValidation
Minimum1Documentation References (3)
+Minimum duration to wait between retry attempts, in Gateway API Duration format. Implementations may add jitter or use exponential backoff, and must not exceed a configured request timeout. Support: ExtendedValidation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Documentation References (3)
+Codes defines the HTTP response status codes for which a backend request
should be retried.Support: ExtendedValidation
List typesetDocumentation References (3)
+condition is a CEL expression evaluated against each response to decide
whether to retry. A response is retried when its status code is in codes or
this expression evaluates to true.Validation
Min length1Max length16384
+precondition is a CEL expression evaluated against the request before any
attempt is made. When it evaluates to false, retries are disabled and only
the initial attempt is made, for example request.method == "GET".
Retrying requires buffering the request body in memory for replay, so this lets
us skip that cost when the request is known to be non-retriable (for example
streaming uploads or long-lived connections like websockets).Validation
Min length1Max length16384
+Request timeouts.
It is applicable to HTTPRoute resources and ignored for other targeted
kinds.Validation
Ruleat least one of the fields in [request responseIdle] must be setDocumentation References (2)
+Maximum time allowed from the start of downstream request processing until response headers
are received. The response body is not included; use responseIdle to bound gaps between body frames.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32Rulerequest must be at least 1msDocumentation References (2)
+Maximum time to wait for a frame from the upstream response body.Limits how long the gateway waits for more response data from the backend.
Time spent processing the response or waiting for the client to receive it does not count.This complements Request rather than overlapping it: Request stops applying once the response
headers arrive, so it places no bound on how long the response body may take, and it cannot
distinguish a stalled stream from a slow one.This does not apply to responses that switch protocols, so upgraded WebSocket connections and
CONNECT tunnels are never terminated by it.Validation
Pattern^([0-9]{1,5}(h|m|s|ms)){1,4}$Max length32RuleresponseIdle must be at least 1ms
+Mutates and transforms requests and responses
before forwarding them to the destination.Validation
Ruleat least one of the fields in [conditional request response] must be setRuleconditional cannot be set with any other fieldDocumentation References (22)
+Conditional policy execution. Set this or the top-level transformation fields.
The first matching policy will be executed.
A single policy may be provided without a condition set; if so, it must be the last policy and will be the fallback
in case no conditions are met.Validation
Min items1Max items16Ruleconditional entries without condition must be lastDocumentation References (1)
+Policy to apply when the condition matches.Validation
Ruleat least one of the fields in [request response] must be setDocumentation References (1)
+Request transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (1)
+Headers to add to the request and what each value
should be set to. If there is already a header with these values then
append the value as an extra entry.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (1)
+The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (1)
+CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (1)
+Request transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (15)
+HTTP body transformation.Validation
Min length1Max length16384
+Header names to remove from the request or
response.Validation
Min items1Max items16List typeset
+Headers to set and the values to use.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (10)
+The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (10)
+CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (10)
+Response transformation settings.Validation
Ruleat least one of the fields in [add body metadata remove set] must be setDocumentation References (6)
+Headers to add to the request and what each value
should be set to. If there is already a header with these values then
append the value as an extra entry.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (1)
+The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (1)
+CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (1)
+HTTP body transformation.Validation
Min length1Max length16384Documentation References (1)
+Header names to remove from the request or
response.Validation
Min items1Max items16List typesetDocumentation References (1)
+Headers to set and the values to use.Validation
Min items1Max items16List typemapList map keysnameDocumentation References (5)
+The name of the header to add.Validation
Pattern^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$Min length1Max length256Rulepseudo-headers must be one of :authority, :method, :path, :scheme, or :statusDocumentation References (5)
+CEL expression that generates the output value for
the header.Validation
Min length1Max length16384Documentation References (5)
+Current policy status.
+Ancestor resources (usually Gateways) associated with the policy, with the policy's status for each. At most 16 entries; an empty list means the policy is not relevant to any ancestorValidation
Max items16List typeatomic
+AncestorRef corresponds with a ParentRef in the spec that this
PolicyAncestorStatus struct describes the status of.
+Group is the group of the referent.
When unspecified, "gateway.networking.k8s.io" is inferred.
To set the core API group (such as for a "Service" kind referent),
Group must be explicitly set to "" (empty string).Support: CoreValidation
Defaultgateway.networking.k8s.ioPattern^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Max length253
+Kind is kind of the referent.There are two kinds of parent resources with "Core" support:* Gateway (Gateway conformance profile)
* Service (Mesh conformance profile, ClusterIP Services only)Support for other resources is Implementation-Specific.Validation
DefaultGatewayPattern^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$Min length1Max length63
+Name is the name of the referent.Support: CoreValidation
Min length1Max length253
+Namespace of the referent. Defaults to the Route's local namespace. Cross-namespace references must be explicitly allowed, for example via ReferenceGrant. Support: CoreValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Min length1Max length63
+Port this Route targets on the parent, interpreted per parent kind (for example a Gateway listener port or Service port). Support: ExtendedValidation
Formatint32Minimum1Maximum65535
+Name of a section within the target resource, for example a Gateway Listener name or Service port name. Empty references the entire resource. Support: CoreValidation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$Min length1Max length253
+Conditions describing the status of the policy for this ancestorValidation
Min items1Max items8List typemapList map keystype
+lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.Validation
Formatdate-time
+message is a human readable message indicating details about the transition.
This may be an empty string.Validation
Max length32768
+observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.Validation
Formatint64Minimum0
+reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.Validation
Pattern^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$Min length1Max length1024
+status of the condition, one of True, False, Unknown.Validation
EnumTrue, False, Unknown
+type of condition in CamelCase or in foo.example.com/CamelCase.Validation
Pattern^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$Max length316
+ControllerName is a domain/path string that indicates the name of the
controller that wrote this status. This corresponds with the
controllerName field on GatewayClass.Example: "example.net/gateway-controller".The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are
valid Kubernetes names
(https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).Controllers MUST populate this field when writing status. Controllers should ensure that
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary.Validation
Pattern^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$Min length1Max length253
basicAuth contains the claims from a verified basic authentication Key. This is only present if the Basic authentication policy is enabled.llm contains attributes about an LLM request or response. This is only present when using an ai backend.llmRequest contains the raw LLM request before processing. This is only present *during* LLM policies;llmRequest contains the raw JSON LLM request during route and LLM policies.source contains attributes about the source of the request.{resourceName}.openai.azure.com{resourceName}.services.ai.azure.comproject_name to construct paths like /api/projects/{project}/openai/v1/...{resourceName}.services.ai.azure.comproject_name to construct paths like /api/projects/{project}/openai/v1/...{resourceName}.services.ai.azure.com,{resourceName}.cognitiveservices.azure.com.project_name for paths like /api/projects/{project}/openai/v1/....{resourceName}.services.ai.azure.com,{resourceName}.cognitiveservices.azure.com.project_name for paths like /api/projects/{project}/openai/v1/....resourceType is foundry./api/projects/{projectName}/openai/v1/....resourceName which is used for the host./api/projects/{projectName}/openai/v1/....resourceName which is used for the host.