Skip to search

AgentgatewayPolicy

agentgateway.dev / v1alpha1

apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayPolicy metadata: name: example
View raw schema
apiVersion string
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind string
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata object
spec object required
Desired policy configuration.
backend object
Settings for how to connect to destination backends. A backend policy can target a `Gateway` (optionally, with a `sectionName` indicating the listener), `ListenerSet`, `Route` (optionally, with a `sectionName` indicating the route rule), or a `Service` or `Backend` (optionally, with a `sectionName` indicating the numeric port for `Service`, or sub-backend for `Backend`). Note that a backend policy applies when connecting to a specific destination backend. Targeting a higher level resource, like `Gateway`, is just a way to easily apply a policy to a group of backends. When multiple policies are selected for a given request, they are merged on a field-level basis, but not a deep merge. Precedence is given to more precise policies: `Gateway` < `Listener` < `Route` < `Route Rule` < `Backend` or `Service`. For example, if a `Gateway` policy sets `tcp` and `tls`, and a `Backend` policy sets `tls`, the effective policy would be `tcp` from the `Gateway`, and `tls` from the `Backend`.
ai object
Settings for AI workloads. This is only applicable when connecting to a `Backend` of type `ai`.
defaults []object
Defaults to merge with user input fields. If the field is already set, the field in the request is used.
minItems: 1
maxItems: 64
field string required
Name of the field.
minLength: 1
maxLength: 256
value object required
Default value for the field. This can be any JSON data type.
finalTransformations []object
CEL transformations to compute and set fields in the request body. The expression result overwrites any existing value for that field. This has a higher priority than `overrides` if both are set for the same key. Those transformations are applied after the request is converted to the provider's format, so they can be used to set provider-specific fields.
minItems: 1
maxItems: 64
expression string required
CEL expression used to compute the field value.
minLength: 1
maxLength: 16384
field string required
Name of the field to set.
minLength: 1
maxLength: 256
modelAliases object
Maps friendly model names to actual provider model names. Example: `{"fast": "gpt-3.5-turbo", "smart": "gpt-4-turbo"}`. Note: This field is only applicable when using the agentgateway data plane.
overrides []object
Overrides to merge with user input fields. If the field is already set, the field is overwritten.
minItems: 1
maxItems: 64
field string required
Name of the field.
minLength: 1
maxLength: 256
value object required
Default value for the field. This can be any JSON data type.
prompt object
Enriches requests sent to the LLM provider by appending and prepending system prompts. This can be configured only for LLM providers that use the `CHAT` or `CHAT_STREAMING` API route type.
append []object
Messages to append to the prompt sent by the client.
content string required
String content of the message.
role string required
Role of the message. The available roles depend on the backend LLM provider model, such as `SYSTEM` or `USER` in the OpenAI API.
prepend []object
Messages to prepend to the prompt sent by the client.
content string required
String content of the message.
role string required
Role of the message. The available roles depend on the backend LLM provider model, such as `SYSTEM` or `USER` in the OpenAI API.
promptCaching object
Automatic prompt caching for supported providers, currently AWS Bedrock. Reduces API costs by caching static content like system prompts and tool definitions. Only applicable for Bedrock Claude 3+ and Nova models.
cacheMessageOffset integer
Shifts the message cache point further back in the conversation. 0 (default) places it at the second-to-last message. Higher values move it N additional messages towards the start, clamped to bounds.
minimum: 0
cacheMessages boolean
Enables caching for conversation messages. Caches all messages in the conversation for cost savings.
cacheSystem boolean
Enables caching for system prompts. Inserts a cache point after all system messages.
cacheTools boolean
Enables caching for tool definitions. Inserts a cache point after all tool specifications.
minTokens integer
Minimum estimated token count before caching is enabled. Uses rough heuristic (word count × 1.3) to estimate tokens. Bedrock requires at least 1,024 tokens for caching to be effective.
minimum: 0
promptGuard object
Guardrails for LLM requests and responses.
request []object
Prompt guards to apply to requests sent by the client.
minItems: 1
maxItems: 8
bedrockGuardrails object
AWS Bedrock Guardrails settings for prompt guarding.
action string
Action controls whether the guardrail's verdict is enforced or only observed. `Reject` (the default) enforces the guardrail: a blocked assessment rejects the request/response and an anonymized assessment masks the matched content. `Audit` runs the guardrail in observe mode: it is invoked and its assessment recorded (metrics + structured log), but the request/response is never blocked or masked.
enum: Audit, Reject
identifier string required
Identifier of the Guardrail policy to use for the backend.
minLength: 1
maxLength: 256
policies object
Policies for communicating with AWS Bedrock Guardrails.
auth object
Settings for authenticating to AWS Bedrock Guardrails.
aws object
AWS authentication method for Bedrock Guardrails. Use `aws: {}` for default AWS SDK credential discovery.
assumeRole object
AWS STS AssumeRole settings to use before signing backend requests. Ambient AWS credentials are used as the source credentials for STS.
roleArn string required
AWS IAM role ARN to assume.
pattern: ^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$
minLength: 1
sessionName string
SessionName is a custom session name (RoleSessionName) for CloudTrail and Cost & Usage Report attribution. If unset, AWS generates a random name.
pattern: ^[\w+=,.@-]{2,64}$
sessionNameExpression string
SessionNameExpression is a CEL expression evaluated against each request to produce the session name (RoleSessionName), for example `jwt.sub` or `request.headers["x-team"]`. If the expression does not produce a valid session name at request time, the request is rejected.
minLength: 1
maxLength: 16384
tags []object
Session tags passed to STS AssumeRole for cost attribution in the AWS Cost & Usage Report, once activated. STS allows at most 50 per role session.
maxItems: 50
expression string
CEL expression evaluated against each request to produce the tag value, for example `jwt.sub` or `request.headers["x-app"]`. Requests with invalid tag values are rejected.
minLength: 1
maxLength: 16384
key string required
Key is the tag key.
minLength: 1
maxLength: 128
value string
Value is a static tag value.
maxLength: 256
region string
AWS SigV4 signing region, for example `us-east-1`. Set this when the target AWS service is in a different region than the gateway. If unset, typed AWS backends may provide this automatically; otherwise the ambient AWS region is used.
minLength: 1
maxLength: 256
secretRef object
Credential source for AWS credentials, defaulting to a Kubernetes `Secret`. The default Secret resolver expects `accessKey`, `secretKey`, and optional `sessionToken` keys.
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
serviceName string
AWS SigV4 signing service name, for example `bedrock`, `bedrock-agentcore`, or `execute-api`). If unset, typed AWS backends may provide this automatically.
minLength: 1
maxLength: 256
key string
Inline API key to use as the value of the `Authorization` header. This option is the least secure; usage of a `Secret` is preferred.
maxLength: 2048
location object
Where API keys are inserted. Defaults to the `Authorization` header with the `Bearer ` prefix. Applies to `key` and `secretRef`.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
secretRef object
Credential source for the API key, defaulting to a Kubernetes `Secret`. By default, the value is read from the `Authorization` key; set `secretRef.key` to override it. A `Bearer ` prefix is stripped only from the default `Authorization` key.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
region string required
AWS region where the guardrail is deployed, for example `us-west-2`).
minLength: 1
maxLength: 256
version string required
Version of the Guardrail policy to use for the backend.
minLength: 1
maxLength: 256
googleModelArmor object
Google Model Armor settings for prompt guarding.
action string
Action controls whether flagged content is rejected or only observed. `Reject` (the default) rejects flagged content; `Audit` records the would-be rejection without blocking.
enum: Audit, Reject
location string
Google Cloud location, for example `us-central1`. Defaults to `us-central1` if not specified.
minLength: 1
maxLength: 256
policies object
Policies for communicating with Google Model Armor.
auth object
Settings for authenticating to Google Model Armor.
gcp object
Google authentication method for Model Armor. Use `gcp: {}` for default Google credential discovery.
audience string
Explicit `aud` value for the ID token. Only valid with `IdToken` type. If not set, the `aud` is automatically derived from the backend hostname.
minLength: 1
maxLength: 256
secretRef object
Credential source for ADC-compatible Google credential JSON, defaulting to a Kubernetes `Secret`. By default, the value is read from `credentials.json`; set `secretRef.key` to override it. When omitted, ambient credentials are used.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
type string
The type of token to generate. To authenticate to GCP services, generally an `AccessToken` is used. To authenticate to Cloud Run, an `IdToken` is used.
enum: AccessToken, IdToken
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
projectId string required
Google Cloud project ID.
minLength: 1
maxLength: 256
templateId string required
Template ID for Google Model Armor.
minLength: 1
maxLength: 256
openAIModeration object
Passes prompt data through the OpenAI Moderations endpoint. See https://developers.openai.com/api/reference/resources/moderations for more information.
action string
Action controls whether flagged content is rejected or only observed. `Reject` (the default) rejects flagged content; `Audit` records the would-be rejection without blocking.
enum: Audit, Reject
model string
Moderation model to use. For example, `omni-moderation`.
policies object
Policies for communicating with OpenAI.
auth object
Settings for authenticating to OpenAI.
key string
Inline key to use as the value of the `Authorization` header. This option is the least secure; usage of a `Secret` is preferred.
maxLength: 2048
location object
Where backend credentials are inserted. Defaults to the `Authorization` header with the `Bearer ` prefix. Applies to `key` and `secretRef`.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
secretRef object
Credential source for the authorization value, defaulting to a Kubernetes `Secret`. By default, the value is read from the `Authorization` key; set `secretRef.key` to override it. A `Bearer ` prefix is stripped only from the default `Authorization` key.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
regex object
Regular expression (regex) matching for prompt guards and data masking.
action string
The action to take if a regex pattern is matched in a request or response. The action applies to request and response matches alike. Note that `Mask` is not applied to streamed responses: matched content in a streamed response is passed through unmodified. Defaults to `Mask`.
enum: Audit, Mask, Reject
builtins []string
Built-in regex patterns to match against the request or response. Matches and built-ins are additive.
matches []string
Regex patterns to match against the request or response. Matches and built-ins are additive.
response object
Custom response message to return to the client. If not specified, defaults to `The request was rejected due to inappropriate content`.
message string
Custom response message to return to the client. If not specified, defaults to `The request was rejected due to inappropriate content`.
statusCode integer
Status code to return to the client. Defaults to 403.
format: int32
minimum: 200
maximum: 599
scope []string
Which parts of the request this guard inspects. When unset, defaults to `SystemPrompt` and `Messages`. Tool call inputs and outputs are not inspected unless `ToolInput`/`ToolOutput` are listed explicitly. In APIs that send tool arguments as opaque JSON, such as Completions, the arguments are masked as a single string, meaning a prompt guard has the potential to rewrite the arguments into invalid JSON.
minItems: 1
maxItems: 4
webhook object
Webhook that receives requests for prompt guarding.
action string
Action controls whether the webhook's verdict is enforced or only observed. `Reject` (the default) enforces it; `Audit` records the would-be action without blocking or masking.
enum: Audit, Reject
backendRef object required
Webhook server to reach. Supported types: Service and Backend.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
failureMode string
Behavior when the webhook guardrail is unavailable or returns an error. `FailOpen` allows the request to continue. `FailClosed` (default) rejects the request.
enum: FailClosed, FailOpen
forwardHeaderMatches []object
HTTP header matches used to select the headers to forward to the webhook. Request headers are used when forwarding requests and response headers are used when forwarding responses. By default, no headers are forwarded.
name string required
Name of the HTTP header to match, case-insensitive. When names are equivalent, only the first matching entry is used
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
type string
How to match against the header value: `Exact` (default) or `RegularExpression`. The regex dialect is implementation-specific
enum: Exact, RegularExpression
value string required
Value of the HTTP header to match
minLength: 1
maxLength: 4096
headers object
CEL-computed headers to include in webhook requests.
response []object
Prompt guards to apply to responses returned by the LLM provider.
minItems: 1
maxItems: 8
bedrockGuardrails object
AWS Bedrock Guardrails settings for prompt guarding.
action string
Action controls whether the guardrail's verdict is enforced or only observed. `Reject` (the default) enforces the guardrail: a blocked assessment rejects the request/response and an anonymized assessment masks the matched content. `Audit` runs the guardrail in observe mode: it is invoked and its assessment recorded (metrics + structured log), but the request/response is never blocked or masked.
enum: Audit, Reject
identifier string required
Identifier of the Guardrail policy to use for the backend.
minLength: 1
maxLength: 256
policies object
Policies for communicating with AWS Bedrock Guardrails.
auth object
Settings for authenticating to AWS Bedrock Guardrails.
aws object
AWS authentication method for Bedrock Guardrails. Use `aws: {}` for default AWS SDK credential discovery.
assumeRole object
AWS STS AssumeRole settings to use before signing backend requests. Ambient AWS credentials are used as the source credentials for STS.
roleArn string required
AWS IAM role ARN to assume.
pattern: ^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$
minLength: 1
sessionName string
SessionName is a custom session name (RoleSessionName) for CloudTrail and Cost & Usage Report attribution. If unset, AWS generates a random name.
pattern: ^[\w+=,.@-]{2,64}$
sessionNameExpression string
SessionNameExpression is a CEL expression evaluated against each request to produce the session name (RoleSessionName), for example `jwt.sub` or `request.headers["x-team"]`. If the expression does not produce a valid session name at request time, the request is rejected.
minLength: 1
maxLength: 16384
tags []object
Session tags passed to STS AssumeRole for cost attribution in the AWS Cost & Usage Report, once activated. STS allows at most 50 per role session.
maxItems: 50
expression string
CEL expression evaluated against each request to produce the tag value, for example `jwt.sub` or `request.headers["x-app"]`. Requests with invalid tag values are rejected.
minLength: 1
maxLength: 16384
key string required
Key is the tag key.
minLength: 1
maxLength: 128
value string
Value is a static tag value.
maxLength: 256
region string
AWS SigV4 signing region, for example `us-east-1`. Set this when the target AWS service is in a different region than the gateway. If unset, typed AWS backends may provide this automatically; otherwise the ambient AWS region is used.
minLength: 1
maxLength: 256
secretRef object
Credential source for AWS credentials, defaulting to a Kubernetes `Secret`. The default Secret resolver expects `accessKey`, `secretKey`, and optional `sessionToken` keys.
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
serviceName string
AWS SigV4 signing service name, for example `bedrock`, `bedrock-agentcore`, or `execute-api`). If unset, typed AWS backends may provide this automatically.
minLength: 1
maxLength: 256
key string
Inline API key to use as the value of the `Authorization` header. This option is the least secure; usage of a `Secret` is preferred.
maxLength: 2048
location object
Where API keys are inserted. Defaults to the `Authorization` header with the `Bearer ` prefix. Applies to `key` and `secretRef`.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
secretRef object
Credential source for the API key, defaulting to a Kubernetes `Secret`. By default, the value is read from the `Authorization` key; set `secretRef.key` to override it. A `Bearer ` prefix is stripped only from the default `Authorization` key.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
region string required
AWS region where the guardrail is deployed, for example `us-west-2`).
minLength: 1
maxLength: 256
version string required
Version of the Guardrail policy to use for the backend.
minLength: 1
maxLength: 256
googleModelArmor object
Google Model Armor settings for prompt guarding.
action string
Action controls whether flagged content is rejected or only observed. `Reject` (the default) rejects flagged content; `Audit` records the would-be rejection without blocking.
enum: Audit, Reject
location string
Google Cloud location, for example `us-central1`. Defaults to `us-central1` if not specified.
minLength: 1
maxLength: 256
policies object
Policies for communicating with Google Model Armor.
auth object
Settings for authenticating to Google Model Armor.
gcp object
Google authentication method for Model Armor. Use `gcp: {}` for default Google credential discovery.
audience string
Explicit `aud` value for the ID token. Only valid with `IdToken` type. If not set, the `aud` is automatically derived from the backend hostname.
minLength: 1
maxLength: 256
secretRef object
Credential source for ADC-compatible Google credential JSON, defaulting to a Kubernetes `Secret`. By default, the value is read from `credentials.json`; set `secretRef.key` to override it. When omitted, ambient credentials are used.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
type string
The type of token to generate. To authenticate to GCP services, generally an `AccessToken` is used. To authenticate to Cloud Run, an `IdToken` is used.
enum: AccessToken, IdToken
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
projectId string required
Google Cloud project ID.
minLength: 1
maxLength: 256
templateId string required
Template ID for Google Model Armor.
minLength: 1
maxLength: 256
regex object
Regular expression (regex) matching for prompt guards and data masking.
action string
The action to take if a regex pattern is matched in a request or response. The action applies to request and response matches alike. Note that `Mask` is not applied to streamed responses: matched content in a streamed response is passed through unmodified. Defaults to `Mask`.
enum: Audit, Mask, Reject
builtins []string
Built-in regex patterns to match against the request or response. Matches and built-ins are additive.
matches []string
Regex patterns to match against the request or response. Matches and built-ins are additive.
response object
Custom response message to return to the client. If not specified, defaults to `The response was rejected due to inappropriate content`.
message string
Custom response message to return to the client. If not specified, defaults to `The request was rejected due to inappropriate content`.
statusCode integer
Status code to return to the client. Defaults to 403.
format: int32
minimum: 200
maximum: 599
webhook object
Webhook that receives responses for prompt guarding.
action string
Action controls whether the webhook's verdict is enforced or only observed. `Reject` (the default) enforces it; `Audit` records the would-be action without blocking or masking.
enum: Audit, Reject
backendRef object required
Webhook server to reach. Supported types: Service and Backend.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
failureMode string
Behavior when the webhook guardrail is unavailable or returns an error. `FailOpen` allows the request to continue. `FailClosed` (default) rejects the request.
enum: FailClosed, FailOpen
forwardHeaderMatches []object
HTTP header matches used to select the headers to forward to the webhook. Request headers are used when forwarding requests and response headers are used when forwarding responses. By default, no headers are forwarded.
name string required
Name of the HTTP header to match, case-insensitive. When names are equivalent, only the first matching entry is used
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
type string
How to match against the header value: `Exact` (default) or `RegularExpression`. The regex dialect is implementation-specific
enum: Exact, RegularExpression
value string required
Value of the HTTP header to match
minLength: 1
maxLength: 4096
headers object
CEL-computed headers to include in webhook requests.
streaming string
Apply prompt guards to streaming responses and realtime websocket messages. Defaults to disabled to preserve streaming throughput unless explicitly enabled.
enum: Enabled
routes object
Rules for identifying the type of traffic to handle. The keys are URL path suffixes matched using ends-with comparison, for example `"/v1/chat/completions"`. The special `*` wildcard matches any path. If not specified, all traffic defaults to `completions` type.
transformations []object
CEL transformations to compute and set fields in the request body. The expression result overwrites any existing value for that field. This has a higher priority than `overrides` if both are set for the same key.
minItems: 1
maxItems: 64
expression string required
CEL expression used to compute the field value.
minLength: 1
maxLength: 16384
field string required
Name of the field to set.
minLength: 1
maxLength: 256
auth object
Settings for managing authentication to the backend
aws object
Explicit AWS authentication method for the backend. When omitted, default AWS SDK credential discovery is used.
assumeRole object
AWS STS AssumeRole settings to use before signing backend requests. Ambient AWS credentials are used as the source credentials for STS.
roleArn string required
AWS IAM role ARN to assume.
pattern: ^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$
minLength: 1
sessionName string
SessionName is a custom session name (RoleSessionName) for CloudTrail and Cost & Usage Report attribution. If unset, AWS generates a random name.
pattern: ^[\w+=,.@-]{2,64}$
sessionNameExpression string
SessionNameExpression is a CEL expression evaluated against each request to produce the session name (RoleSessionName), for example `jwt.sub` or `request.headers["x-team"]`. If the expression does not produce a valid session name at request time, the request is rejected.
minLength: 1
maxLength: 16384
tags []object
Session tags passed to STS AssumeRole for cost attribution in the AWS Cost & Usage Report, once activated. STS allows at most 50 per role session.
maxItems: 50
expression string
CEL expression evaluated against each request to produce the tag value, for example `jwt.sub` or `request.headers["x-app"]`. Requests with invalid tag values are rejected.
minLength: 1
maxLength: 16384
key string required
Key is the tag key.
minLength: 1
maxLength: 128
value string
Value is a static tag value.
maxLength: 256
region string
AWS SigV4 signing region, for example `us-east-1`. Set this when the target AWS service is in a different region than the gateway. If unset, typed AWS backends may provide this automatically; otherwise the ambient AWS region is used.
minLength: 1
maxLength: 256
secretRef object
Credential source for AWS credentials, defaulting to a Kubernetes `Secret`. The default Secret resolver expects `accessKey`, `secretKey`, and optional `sessionToken` keys.
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
serviceName string
AWS SigV4 signing service name, for example `bedrock`, `bedrock-agentcore`, or `execute-api`). If unset, typed AWS backends may provide this automatically.
minLength: 1
maxLength: 256
azure object
Azure authentication method for the backend.
managedIdentity object
Managed identity authentication settings. Leave this object empty to use the system-assigned identity. To use a user-assigned identity, set one of `clientId`, `objectId`, or `resourceId`.
clientId string
Client ID of the user-assigned managed identity.
objectId string
Object ID of the user-assigned managed identity.
resourceId string
Resource ID of the user-assigned managed identity.
secretRef object
Credential source for Azure credentials, defaulting to a Kubernetes `Secret`. The default Secret resolver expects `clientID`, `tenantID`, and `clientSecret` keys.
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
workloadIdentity object
Workload identity authentication settings. Uses the federated token and Azure env vars projected into the data plane pod. Recommended on AKS with Workload Identity enabled.
credentials []object
Credentials is a list of additional credentials to inject on the backend request. Each entry resolves a Secret key and writes its value to the entry's location. `credentials` is independent of the primary `key`/`secretRef`/`passthrough` mechanism and may be set on its own or alongside it.
minItems: 1
maxItems: 8
location object required
Where the credential is inserted on the backend request.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
secretRef object required
SecretRef references a Kubernetes Secret holding the credential value, and optionally overrides the key read from it. Defaults to `Authorization`, matching the key convention used by the top-level `secretRef`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
crossAppAccess object
Cross App Access (Identity Assertion / ID-JAG) authentication.
accessTokenScopes []string
Scopes requested when exchanging the ID-JAG for an access token. When omitted, defaults to Scopes. Set to an empty list to omit scope.
maxItems: 64
audience string required
Identifier of the resource authorization server. The issued ID-JAG is bound to this audience.
minLength: 1
maxLength: 256
cache object
Response cache configuration.
inMemory object
defaultTtl string
TTL used when the token endpoint omits expires_in. Default 300s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
maxEntries integer
Default 8192; 0 disables the cache.
format: int32
identityProvider object required
User identity provider authorization server, used for the RFC 8693 ID-JAG exchange.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
clientAuth object required
Client authentication for the token endpoint.
clientId string required
Client ID sent to the token endpoint.
minLength: 1
method string
Client authentication method. Defaults to ClientSecretBasic.
enum: ClientSecretBasic, ClientSecretPost, PrivateKeyJwt
privateKeyJwt object
Client assertion settings. Required when method is PrivateKeyJwt.
alg string
JWS signing algorithm. Defaults to RS256.
enum: ES256, ES384, PS256, RS256, RS384, RS512
assertionAudience string required
Audience for the client assertion, typically the token endpoint URL.
minLength: 1
certificateHeader string
JWS certificate header. Required when certificateRef is set.
enum: x5c, x5t#S256
certificateRef object
PEM-encoded X.509 certificate chain, leaf first, for certificateHeader. The leaf public key should match signingKeyRef; a mismatch only logs a warning but the token endpoint will reject the assertions. Required when certificateHeader is set. The key defaults to `certificate`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
kid string
Optional JWS key ID header.
signingKeyRef object required
PEM-encoded RSA or EC private key; key defaults to `signingKey`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
secretRef object
Secret providing the `clientSecret` key by default; override via `secretRef.key`. When omitted, client_id is sent without a secret, which is only valid with ClientSecretPost.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
path string
Token endpoint path; defaults to "/". Must start with "/".
pattern: ^/
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
resourceAuthorizationServer object required
Resource authorization server, used for the RFC 7523 jwt-bearer exchange.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
clientAuth object required
Client authentication for the token endpoint.
clientId string required
Client ID sent to the token endpoint.
minLength: 1
method string
Client authentication method. Defaults to ClientSecretBasic.
enum: ClientSecretBasic, ClientSecretPost, PrivateKeyJwt
privateKeyJwt object
Client assertion settings. Required when method is PrivateKeyJwt.
alg string
JWS signing algorithm. Defaults to RS256.
enum: ES256, ES384, PS256, RS256, RS384, RS512
assertionAudience string required
Audience for the client assertion, typically the token endpoint URL.
minLength: 1
certificateHeader string
JWS certificate header. Required when certificateRef is set.
enum: x5c, x5t#S256
certificateRef object
PEM-encoded X.509 certificate chain, leaf first, for certificateHeader. The leaf public key should match signingKeyRef; a mismatch only logs a warning but the token endpoint will reject the assertions. Required when certificateHeader is set. The key defaults to `certificate`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
kid string
Optional JWS key ID header.
signingKeyRef object required
PEM-encoded RSA or EC private key; key defaults to `signingKey`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
secretRef object
Secret providing the `clientSecret` key by default; override via `secretRef.key`. When omitted, client_id is sent without a secret, which is only valid with ClientSecretPost.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
path string
Token endpoint path; defaults to "/". Must start with "/".
pattern: ^/
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
resources []string
Resources sent to the token endpoint.
minItems: 1
maxItems: 64
scopes []string
Scopes requested when obtaining the ID-JAG from the identity provider.
minItems: 1
maxItems: 64
subjectToken object
Subject token sent to the identity provider. Defaults to an OpenID Connect ID token read from the Authorization Bearer header.
source object
Where to read the subject token. Defaults to the Authorization Bearer header.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
tokenType string
OAuth RFC 8693 subject token type. Defaults to IdToken
gcp object
Google authentication method for the backend. When omitted, default Google credential discovery is used.
audience string
Explicit `aud` value for the ID token. Only valid with `IdToken` type. If not set, the `aud` is automatically derived from the backend hostname.
minLength: 1
maxLength: 256
secretRef object
Credential source for ADC-compatible Google credential JSON, defaulting to a Kubernetes `Secret`. By default, the value is read from `credentials.json`; set `secretRef.key` to override it. When omitted, ambient credentials are used.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
type string
The type of token to generate. To authenticate to GCP services, generally an `AccessToken` is used. To authenticate to Cloud Run, an `IdToken` is used.
enum: AccessToken, IdToken
jwtSign object
Signs a short-lived JWT with a private key on each request and sends it to the backend, for upstreams that require per-request keypair JWTs (e.g. the Snowflake SQL API) rather than a static credential.
alg string
JWS signing algorithm. Defaults to RS256.
enum: ES256, ES384, PS256, RS256, RS384, RS512
claims object
Static claims added to every token (e.g. iss, sub, aud). Values may be any JSON value (e.g. a string, number, bool, or array). iat, exp, and nbf are reserved for the signer and cannot be configured here; the controller rejects them at translation time.
kid string
Optional JWS key ID header.
location object
Where the signed token is written on the backend request. Defaults to the Authorization header with a "Bearer " prefix.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
signingKeyRef object required
Secret providing the `signingKey` key with a PEM-encoded RSA or EC private key.
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
ttl string
Token lifetime used for exp. Defaults to 300s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
key string
Inline key to use as the value of the `Authorization` header. This option is the least secure; usage of a `Secret` is preferred.
maxLength: 2048
location object
Where backend credentials are inserted. If omitted, credentials are written to the `Authorization` header with the `Bearer ` prefix. This applies to `key`, `secretRef`, and `passthrough`. Entries in `credentials` carry their own location.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
oauthTokenExchange object
OAuth 2.0 token exchange (RFC 8693) / jwt-bearer (RFC 7523) authentication.
actorToken object
RFC 8693 delegation actor token. TokenExchange grant only.
mayAct string
may_act claim validation mode. When omitted, may_act is not enforced.
enum: Required
source object required
Where to read the actor token. Actor tokens have no default source.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
tokenType string
OAuth token type. Empty defaults to AccessToken. Custom absolute URI values are supported for actor tokens.
additionalParams object
Extra form params; values are CEL expressions over the incoming request.
audiences []string
Audiences sent to the token endpoint.
minItems: 1
maxItems: 64
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cache object
Response cache configuration.
inMemory object
defaultTtl string
TTL used when the token endpoint omits expires_in. Default 300s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
maxEntries integer
Default 8192; 0 disables the cache.
format: int32
clientAuth object
Client authentication for the token endpoint. When unset, none is sent.
clientId string required
Client ID sent to the token endpoint.
minLength: 1
method string
Client authentication method. Defaults to ClientSecretBasic.
enum: ClientSecretBasic, ClientSecretPost, PrivateKeyJwt
privateKeyJwt object
Client assertion settings. Required when method is PrivateKeyJwt.
alg string
JWS signing algorithm. Defaults to RS256.
enum: ES256, ES384, PS256, RS256, RS384, RS512
assertionAudience string required
Audience for the client assertion, typically the token endpoint URL.
minLength: 1
certificateHeader string
JWS certificate header. Required when certificateRef is set.
enum: x5c, x5t#S256
certificateRef object
PEM-encoded X.509 certificate chain, leaf first, for certificateHeader. The leaf public key should match signingKeyRef; a mismatch only logs a warning but the token endpoint will reject the assertions. Required when certificateHeader is set. The key defaults to `certificate`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
kid string
Optional JWS key ID header.
signingKeyRef object required
PEM-encoded RSA or EC private key; key defaults to `signingKey`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
secretRef object
Secret providing the `clientSecret` key by default; override via `secretRef.key`. When omitted, client_id is sent without a secret, which is only valid with ClientSecretPost.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
grantType string
RFC followed by the request. Defaults to TokenExchange (RFC 8693).
enum: JwtBearer, TokenExchange
location object
Where the exchanged token is written to the backend request. Defaults to Authorization: Bearer.
cookie object
name string required
minLength: 1
maxLength: 256
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
path string
Token endpoint path; defaults to "/". Must start with "/".
pattern: ^/
requestedTokenType string
RFC 8693 requested_token_type. Unlike subject/actor token types, only the built-in values may be requested; custom URIs are not supported here.
enum: AccessToken, Jwt, IdToken, IdJag
resources []string
Resources sent to the token endpoint.
minItems: 1
maxItems: 64
scopes []string
Scopes sent to the token endpoint.
minItems: 1
maxItems: 64
subjectToken object
Subject token / assertion source and type. Defaults to Authorization Bearer, AccessToken. The token type may be a built-in value or a custom absolute URI for providers that support custom token exchange profiles.
source object
Where to read the token. CEL `expression` variant is permitted.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
tokenType string
OAuth token type. Empty defaults to AccessToken. Custom absolute URI values are supported for subject tokens.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
passthrough object
Reuses a client token already validated by another policy. Those policies may strip client credentials; passthrough adds the original token back to the backend request. Without client auth policies, this has no effect.
secretRef object
Credential source for the authorization value, defaulting to a Kubernetes `Secret`. By default, the value is read from the `Authorization` key; set `secretRef.key` to override it. A `Bearer ` prefix is stripped only from the default `Authorization` key.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
extAuth object
External authentication configuration for requests sent to this backend.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cache object
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.
key []string required
Ordered list of CEL expressions evaluated against the request to construct the cache key.
minItems: 1
maxItems: 16
maxEntries integer
Maximum number of authorization results to keep in the cache. If unset, this defaults to 10000.
format: int32
minimum: 1
ttl string required
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.
minLength: 1
maxLength: 16384
failureMode string
Behavior when the external authorization service is unavailable or returns an error. "FailOpen" allows the request to continue. "FailClosed" (default) denies the request.
enum: FailClosed, FailOpen
forwardBody object
Whether to include the HTTP body in the authorization request. If enabled, the request body will be buffered.
maxSize string | integer required
Largest body, in bytes, that will be buffered and sent to the authorization server. If the body size is larger than `maxSize`, then the request will be rejected with a response.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
grpc object
Uses the gRPC External Authorization [protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.
contextExtensions object
Additional arbitrary key-value pairs to send to the authorization server in the `context_extensions` field.
requestMetadata object
Metadata to send to the authorization server. This maps to the `metadata_context.filter_metadata` field of the request, and allows dynamic CEL expressions. If unset, by default the `envoy.filters.http.jwt_authn` key is set if the JWT policy is used as well, for compatibility.
http object
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.
addRequestHeaders object
Additional headers to add to the request to the authorization server. While `allowedRequestHeaders` just passes the original headers through, `addRequestHeaders` allows defining custom headers based on CEL expressions.
allowedRequestHeaders []string
Additional headers from the client request that will be sent to the authorization server. If unset, the following headers are sent by default: `Authorization`.
maxItems: 64
allowedResponseHeaders []string
Headers from the authorization response that will be copied into the request to the backend.
maxItems: 64
body string
Body is a CEL expression that produces the HTTP authorization request body. Strings and bytes are used directly; other values are JSON-encoded.
minLength: 1
maxLength: 16384
path string
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`.
minLength: 1
maxLength: 16384
redirect string
Optional expression that determines a path to redirect to on authorization failure. This is useful to redirect to a sign-in page.
minLength: 1
maxLength: 16384
responseMetadata object
Metadata fields to construct from the authorization response. These will be included under the `extauthz` variable in future CEL expressions. Setting this is useful for things like logging usernames, without needing to include them as headers to the backend, as `allowedResponseHeaders` would.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
health object
Settings for passive and active health checking.
eviction object
Settings for evicting unhealthy backends.
consecutiveFailures integer
Number of consecutive unhealthy responses required before the backend is evicted. For example, a value of 5 means the backend must receive 5 unhealthy responses in a row before being evicted. When both consecutiveFailures and healthThreshold are set, the backend is evicted when either condition is met. When neither is set, a single unhealthy response can trigger eviction.
format: int32
minimum: 0
duration string
Base time a backend should be evicted after being marked unhealthy. Subsequent evictions use multiplicative backoff (duration * times_evicted). If all endpoints are evicted, the load balancer falls back to returning evicted endpoints rather than failing entirely. If unset, defaults to `3s`.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
healthThreshold integer
EWMA health score threshold, from 0 to 100. When set, a backend is evicted only if its computed health drops below this value after an unhealthy response (e.g. 50 evicts when EWMA health falls below 50%). Unlike consecutiveFailures, this sliding-window average lets a single success delay eviction. If both are set, either condition evicts; if neither, a single unhealthy response evicts.
format: int32
minimum: 0
maximum: 100
restoreHealth integer
Health score from 0 to 100 assigned to a backend when it returns from eviction. For gradual recovery, set below 100; for full recovery immediately, set 100. If unset, the backend resumes with the health it had when evicted.
format: int32
minimum: 0
maximum: 100
unhealthyCondition string
CEL expression that determines whether a response indicates an unhealthy backend. When the expression evaluates to true, the backend is considered unhealthy and may be evicted. For example, to evict on 5xx responses: `response.code >= 500`. When unset, any 5xx response, or a connection failure, is treated as unhealthy. This default lowers the backend's health score but does not trigger eviction on its own.
minLength: 1
maxLength: 16384
http object
Settings for managing HTTP requests to the backend
requestTimeout string
Deadline for receiving a response from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
version string
HTTP protocol version for backend connections. If unset, it is inferred: `Service` appProtocol, `HTTP2` for gRPC, the original protocol for plaintext HTTP, or `HTTP1` for HTTPS because clients often upgrade HTTPS to HTTP/2 even when the backend does not support it.
enum: HTTP1, HTTP2
mcp object
Settings for MCP workloads. This is only applicable when connecting to a `Backend` of type `mcp`.
authentication object
MCP backend-specific authentication rules. This field is deprecated; prefer to use traffic policy `jwtAuthentication.mcp`, which ensures authentication runs before other policies such as transformation and rate limiting.
audiences []string
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.
minItems: 1
maxItems: 64
clientId string
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.
clientSecretRef object
Reference to a Kubernetes Secret holding the OAuth client secret of the app registration identified by `clientId` (for example Entra ID confidential clients, which require the secret at the token endpoint). The gateway injects it into the token requests it proxies to the provider. Defaults to the `clientSecret` key; override via `clientSecretRef.key`.
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
issuer string
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)).
minLength: 1
maxLength: 256
jwks object required
Remote JSON Web Key used to validate the signature of the JWT.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cacheDuration string
How long a fetched `jwks` document is used before it is re-fetched from the IdP.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
jwksPath string
Path to the IdP `jwks` endpoint, relative to the root, commonly `".well-known/jwks.json"`.
minLength: 1
maxLength: 1024
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
mode string
Validation mode for JWT authentication.
enum: Optional, Permissive, Strict
provider string
Identity provider to use for authentication.
enum: Auth0, Authentik, Descope, Entra, Keycloak, Okta
resourceMetadata object
Metadata to use for MCP resources.
authorization object
MCP backend authorization. Unlike authorization at the HTTP level, which rejects unauthorized requests with a `403` error, this policy works at the `MCPBackend` level. List operations, such as `list_tools`, will have each item evaluated. Items that do not meet the rule will be filtered. Get or call operations, such as `call_tool`, will evaluate the specific item and reject requests that do not meet the rule.
action string
The effect of this rule when it matches. If unspecified, defaults to `Allow`. `Require` rules are cumulative: all require rules must match.
enum: Allow, Deny, Require
policy object required
The authorization rule to evaluate. * `Allow`: any matching allow rule allows the request. * `Require`: every require rule must match for the request to be allowed. * `Deny`: any matching deny rule denies the request. `Deny` is not recommended because expression failures fail to deny; prefer `Allow` or `Require`. If used, design expressions defensively against evaluation errors. If at least one `Allow` rule is configured, requests are denied unless at least one allow rule matches.
matchExpressions []string required
CEL expressions that must all evaluate to true for the rule to match.
minItems: 1
maxItems: 256
guardrails object
`guardrails` routes selected JSON-RPC methods through a remote policy server.
processors []object required
`processors` is the ordered list of policy processors applied to matched methods. Processors run in the order listed; the first to reject a request short-circuits the chain.
minItems: 1
maxItems: 16
methods object required
`methods` is the allowlist of JSON-RPC methods (e.g. `tools/call`, `tools/list`) routed through this processor, keyed by method name with the phase it runs in. Keys may be exact, a prefix wildcard (`tools/*`), a suffix wildcard (`*/list`), or `*` for all methods; the most specific match wins. Methods matching no key, including unknown ones, bypass this processor.
remote object
`remote` configures a gRPC policy server.
allowedRequestHeaders []string
`allowedRequestHeaders` lists the incoming request headers forwarded to the policy server in `McpRequest.headers`. If empty, all headers and pseudo-headers (`:authority`, `:method`, ...) are forwarded. Matching is case-insensitive.
maxItems: 64
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
disallowedRequestHeaders []string
`disallowedRequestHeaders` lists header names never forwarded to the policy server, even if listed in `allowedRequestHeaders`. Matching is case-insensitive.
maxItems: 64
failureMode string
`failureMode` controls behavior when the policy server is unreachable or returns an error. `FailOpen` allows the request; `FailClosed` (default) denies it.
enum: FailClosed, FailOpen
metadata object
`metadata` is static or CEL-evaluated context surfaced to the policy server as fields of the `metadata_context` google.protobuf.Struct, keyed by config key. Values are CEL expressions.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
tcp object
Settings for managing TCP connections to the backend
connectTimeout string
Deadline for establishing a connection to the destination.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
tls object
Settings for managing TLS connections to the backend When set, TLS is originated to the backend using the system trusted CA certificates, and SNI is inferred from the destination.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
caCertificateRefs []object
CA certificate source to use to verify the server certificate. Omitted kind and `ConfigMap` select a ConfigMap; `Secret` selects a Secret. The `ca.crt` key is required. If unset, the system's trusted certificates are used.
maxItems: 1
kind string
Kind of the referenced CA certificate source. Omitted defaults to ConfigMap.
enum: ConfigMap, Secret
name string required
Name of the referenced CA certificate source.
minLength: 1
maxLength: 253
certificateSource string
Source for the gateway's client identity and trust roots (`Inline` default, or `SPIFFE`).
enum: Inline, SPIFFE
insecureSkipVerify string
Originates TLS but skips verification of the backend's certificate WARNING: insecure; only use if the risks are understood Modes: * `All` disables all TLS verification * `Hostname` trusts the CA certificate but ignores hostname/SAN mismatches. Still insecure; prefer `verifySubjectAltNames` where possible.
enum: All, Hostname
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS connection. For example: `X25519_MLKEM768,X25519`.
mtlsCertificateRef []object
Enables mutual TLS to the backend using `tls.key` and `tls.crt` from the referenced credential source (defaulting to a Kubernetes `Secret`). An optional `ca.cert`, if present, verifies the server certificate, but `caCertificateRefs` takes priority. If unspecified, no client certificate is used.
maxItems: 1
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
sni string
Server Name Indicator (`SNI`) to use in the TLS handshake. If unset, the `SNI` is automatically set based on the destination hostname.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
verifySubjectAltNames []string
Subject Alternative Names (`SAN`) to verify in the server certificate. If not present, the destination hostname is automatically used.
minItems: 1
maxItems: 16
transformation object
Mutates and transforms requests and responses sent to and from the backend.
request object
Request transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
response object
Response transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
tunnel object
Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
mode string
How requests are sent through the proxy. Defaults to `Auto`.
enum: Auto, Connect
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
frontend object
Settings for how to handle incoming traffic. A frontend policy can only target a `Gateway`. `Listener` and `ListenerSet` are not valid targets. When multiple policies are selected for a given request, they are merged on a field-level basis, but not a deep merge. For example, policy A sets `tcp` and `tls`, and policy B sets `tls`; the effective policy would be `tcp` from policy A, and `tls` from policy B.
accessLog object
Access logging configuration.
attributes object
Customizations to the key-value pairs that are logged.
add []object
Additional key-value pairs to add to each entry. The value is a CEL expression. If the CEL expression fails to evaluate, the pair will be excluded.
minItems: 1
expression string required
A Common Expression Language (CEL) expression.
minLength: 1
maxLength: 16384
name string required
minLength: 1
maxLength: 256
remove []string
Default fields to remove. For example, `http.method`.
minItems: 1
maxItems: 32
filter string
CEL expression used to filter logs. A log will only be emitted if the expression evaluates to `true`.
minLength: 1
maxLength: 16384
otlp object
OTLP access log export to an OpenTelemetry-compatible backend.
attributes object
Customizations to the key-value pairs exported over OTLP. If unset, the parent access log attributes are used.
add []object
Additional key-value pairs to add to each entry. The value is a CEL expression. If the CEL expression fails to evaluate, the pair will be excluded.
minItems: 1
expression string required
A Common Expression Language (CEL) expression.
minLength: 1
maxLength: 16384
name string required
minLength: 1
maxLength: 256
remove []string
Default fields to remove. For example, `http.method`.
minItems: 1
maxItems: 32
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
filter string
CEL expression used to filter OTLP logs. A log will only be exported if the expression evaluates to `true`. If unset, the parent access log filter is used.
minLength: 1
maxLength: 16384
path string
OTLP/HTTP path to use. This is only applicable when `protocol` is `HTTP`. If unset, this defaults to `/v1/logs`.
minLength: 1
maxLength: 1024
protocol string
OTLP protocol variant to use.
enum: GRPC, HTTP
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
connect object
Settings for downstream HTTP CONNECT handling. If unset, CONNECT requests are rejected with Method Not Allowed.
mode string required
Whether downstream CONNECT requests are accepted.
enum: Deny, Route, Tunnel
http object
Settings for managing incoming HTTP requests.
http1HeaderCase string
Controls HTTP/1 request header name casing when encoding responses on the same connection. This only applies to `HTTP/1`. If a request is HTTP/2 in either the incoming or outgoing request, this will be ignored. HTTP/2 requests are always lower case. Modifying the headers from other policies may result in the original case being lost.
enum: Lowercase, Preserve
http1IdleTimeout string
Timeout before an unused connection is closed. If unset, this defaults to 10 minutes.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
http1MaxHeaders integer
Maximum number of headers allowed in `HTTP/1.1` requests. If unset, this defaults to 100.
format: int32
minimum: 1
maximum: 4096
http2ConnectionWindowSize string | integer
Initial window size for connection-level flow control for received data.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
http2FrameSize string | integer
Maximum frame size to use. If unset, this defaults to `16kb`.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
http2KeepaliveInterval string
Interval between `HTTP/2` keepalive pings. If unset, keepalive pings are not sent.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
http2KeepaliveTimeout string
Time to wait for a response to an `HTTP/2` keepalive ping before the connection is closed. Only applies when `http2KeepaliveInterval` is set.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
http2MaxHeaderSize string | integer
Maximum aggregate size of decoded HTTP/2 request headers. If unset, this defaults to `16Ki`.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
http2WindowSize string | integer
Initial window size for stream-level flow control for received data.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
maxBufferSize string | integer
Maximum HTTP body size that will be buffered into memory. Bodies will only be buffered for policies which require buffering. If unset, this defaults to `2mb`.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
maxConcurrentRequests integer
Maximum number of in-flight HTTP requests across this gateway/port. This includes HTTP/1 requests and HTTP/2 streams. Requests over the limit are rejected immediately with a 503 response. Unset means unlimited.
format: int32
minimum: 1
maxConnectionDuration string
Maximum time a connection is allowed to remain open. After this duration, the connection is gracefully closed after the current in-flight request completes. Useful for ensuring even traffic distribution behind load balancers during scaling events.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
metrics object
Custom Prometheus metric label configuration. CEL expressions are evaluated per-request and added as labels to all Prometheus metrics exposed by agentgateway.
attributes object required
Customizations to the labels that are added to Prometheus metrics.
add []object
Additional key-value pairs to add as custom labels to all Prometheus metrics. The value is a CEL expression evaluated per-request. If the CEL expression fails to evaluate, the label value is set to "unknown". WARNING: High-cardinality labels (e.g., per-user IDs) can significantly increase Prometheus storage and memory usage. Prefer low-cardinality dimensions like team or environment.
minItems: 1
maxItems: 16
expression string required
A Common Expression Language (CEL) expression.
minLength: 1
maxLength: 16384
name string required
minLength: 1
maxLength: 256
networkAuthorization object
CEL authorization on downstream network connections. This runs before protocol handling and is intended for L4 access control, for example using `source.address` with `cidr(...).containsIP(...)`.
action string
The effect of this rule when it matches. If unspecified, defaults to `Allow`. `Require` rules are cumulative: all require rules must match.
enum: Allow, Deny, Require
policy object required
The authorization rule to evaluate. * `Allow`: any matching allow rule allows the request. * `Require`: every require rule must match for the request to be allowed. * `Deny`: any matching deny rule denies the request. `Deny` is not recommended because expression failures fail to deny; prefer `Allow` or `Require`. If used, design expressions defensively against evaluation errors. If at least one `Allow` rule is configured, requests are denied unless at least one allow rule matches.
matchExpressions []string required
CEL expressions that must all evaluate to true for the rule to match.
minItems: 1
maxItems: 256
proxyProtocol object
Settings for downstream PROXY protocol handling. If configured, incoming connections may require a PROXY header before normal protocol handling. This can also be configured to allow both PROXY and non-PROXY traffic on the same listener.
mode string
Whether PROXY headers are required or optional. If unset, this defaults to `Strict`.
enum: Optional, Strict
version string
PROXY protocol version to accept. If unset, this defaults to `V2`.
enum: All, V1, V2
tcp object
Settings for managing incoming TCP connections.
keepalive object
Settings for enabling TCP keepalives on the connection.
interval string
Time between keepalive probes. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
retries integer
Maximum number of keepalive probes to send before dropping the connection. If unset, this defaults to 9.
format: int32
minimum: 1
maximum: 64
time string
Time a connection needs to be idle before keepalive probes start being sent. If unset, this defaults to 180s.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
maxConnections integer
Maximum number of active downstream connections on this gateway/port. Connections over the limit are closed immediately. Unset means unlimited.
format: int32
minimum: 1
tls object
Settings for managing incoming TLS connections.
alpnProtocols []string
Application-Layer Protocol Negotiation (`ALPN`) value to use in the TLS handshake. If not present, defaults to `["h2", "http/1.1"]`.
minItems: 1
maxItems: 16
cipherSuites []string
Cipher suites for a TLS listener. The value is a comma-separated list of cipher suites, for example `TLS13_AES_256_GCM_SHA384,TLS13_AES_128_GCM_SHA256`. Use this in the TLS options field of a TLS listener.
handshakeTimeout string
Deadline for a TLS handshake to complete. If unset, this defaults to `15s`.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
keyExchangeGroups []string
Ordered list of key exchange groups for a TLS listener. For example: `X25519_MLKEM768,X25519`.
maxProtocolVersion string
Maximum TLS version to support.
enum: 1.2, 1.3
minProtocolVersion string
Minimum TLS version to support.
enum: 1.2, 1.3
tracing object
OpenTelemetry tracing settings.
attributes object
Customizations to the key-value pairs that are included in the trace.
add []object
Additional key-value pairs to add to each entry. The value is a CEL expression. If the CEL expression fails to evaluate, the pair will be excluded.
minItems: 1
expression string required
A Common Expression Language (CEL) expression.
minLength: 1
maxLength: 16384
name string required
minLength: 1
maxLength: 256
remove []string
Default fields to remove. For example, `http.method`.
minItems: 1
maxItems: 32
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
clientSampling string
Expression that determines the amount of client sampling. Client sampling determines whether to initiate a new trace span if the incoming request does have a trace already. This should evaluate to a float between `0.0` and `1.0`, or a boolean (`true` or `false`). If unspecified, client sampling is `100%` enabled.
minLength: 1
maxLength: 16384
filter string
Expression that determines whether a sampled span is exported. This uses keep semantics: spans are exported only when the expression evaluates to `true`. If unspecified, all sampled spans are exported.
minLength: 1
maxLength: 16384
path string
OTLP path to use. This is only applicable when `protocol` is `HTTP`. If unset, this defaults to `/v1/traces`.
minLength: 1
maxLength: 1024
protocol string
OTLP protocol variant to use.
enum: GRPC, HTTP
randomSampling string
Expression that determines the amount of random sampling. Random sampling will initiate a new trace span if the incoming request does not have a trace initiated already. This should evaluate to a float between `0.0` and `1.0`, or a boolean (`true` or `false`). If unspecified, random sampling is disabled.
minLength: 1
maxLength: 16384
resources []object
Entity producing telemetry and resources resources to be included in the trace.
expression string required
A Common Expression Language (CEL) expression.
minLength: 1
maxLength: 16384
name string required
minLength: 1
maxLength: 256
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
strategy object
Policy merge and conflict resolution strategy. Strategy settings apply to the policy object as a whole. Individual strategy fields may only be valid for specific policy kinds; for example, inheritance is only valid when this policy contains traffic settings.
inheritance string
Controls whether less-specific traffic policies prevent more-specific traffic policies from contributing to the effective policy. This field is only valid on traffic policies. Frontend and backend policy merging does not use inheritance. When unset or set to `Default`, traffic policy fields are merged by specificity, with more-specific attachment points such as routes and route rules able to override fields from less-specific attachment points such as gateways and listeners. In other words, this policy provides `Default`s that can be overridden. For example, you may provide a `Default` timeout policy for the entire Gateway that is overridden by specific routes. When set to `Override`, this policy blocks traffic policies at more-specific attachment points from being included in the effective policy. This is useful when a gateway-level policy must remain authoritative for all routes below it.
enum: Default, Override
targetRefs []object
Target resources to attach the policy to.
minItems: 1
maxItems: 16
group string required
The API group of the target resource. For Kubernetes Gateway API resources, the group is `gateway.networking.k8s.io`.
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string required
The API kind of the target resource, such as `Gateway` or `HTTPRoute`.
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
The name of the target resource.
minLength: 1
maxLength: 253
port integer
The port of the target resource this policy applies to. At most one of `sectionName` or `port` may be set. Only valid on frontend policies targeting a `Gateway`.
format: int32
minimum: 1
maximum: 65535
sectionName string
The named section of the target resource.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
targetSelectors []object
Target selectors used to select resources to attach the policy to.
minItems: 1
maxItems: 16
group string required
The API group of the target resource. For Kubernetes Gateway API resources, the group is `gateway.networking.k8s.io`.
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string required
The API kind of the target resource, such as `Gateway` or `HTTPRoute`.
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
matchLabels object required
Labels that must be present on each selected target resource.
port integer
The port of each selected target resource this policy applies to. At most one of `sectionName` or `port` may be set. Only valid on frontend policies targeting a `Gateway`.
format: int32
minimum: 1
maximum: 65535
sectionName string
The named section of each selected target resource.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
traffic object
Settings for how to process traffic. A traffic policy can target a `Gateway` (optionally, with a `sectionName` indicating the listener), `ListenerSet`, or `Route` (optionally, with a `sectionName` indicating the route rule). When multiple policies are selected for a given request, they are merged on a field-level basis, but not a deep merge. Precedence is given to more precise policies: `Gateway` < `Listener` < `Route` < `Route Rule`. For example, policy A sets `timeouts` and `retries`, and policy B sets `retries`; the effective policy would be `timeouts` from policy A, and `retries` from policy B.
apiKeyAuthentication object
Authenticates users based on a configured API key.
configMapSelector object
Selects multiple Kubernetes `ConfigMap` resources containing API keys. It is ConfigMap-only; use `secretRef` or `secretSelector` for Secret-backed credentials. If the same key is defined in multiple ConfigMaps, the behavior is undefined. Because ConfigMaps are not confidential, every entry sourced from a ConfigMap must use `keyHash`; a raw `key` value is rejected. Each entry in the `ConfigMap` data represents one API key. The key is an arbitrary identifier. The value must be a JSON object with `keyHash`, plus optional `metadata`. `keyHash` contains a hashed API key in `sha256:<hex>` format. `metadata` contains arbitrary JSON metadata associated with the key, which may be used by other policies. For example, you may write an authorization policy allowing `apiKey.group == 'sales'`. Example: apiVersion: v1 kind: ConfigMap metadata: name: api-key data: client1: | { "keyHash": "sha256:efa299afb8c12a36e47a790cbbf929caa06d13285950410463fb759af17d0dad", "metadata": { "group": "sales" } }
matchLabels object required
Labels that must be present on each selected ConfigMap.
location object
Where API keys are read from. If omitted, credentials are read from the `Authorization` header with the `Bearer ` prefix.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
mode string
Validation mode for API key authentication.
enum: Optional, Permissive, Strict
secretRef object
Credential source, defaulting to a Kubernetes `Secret`, storing a set of API keys. If many keys are needed, `secretSelector` or `configMapSelector` can be used instead. Note that ConfigMap-backed API keys only support `keyHash`. Each entry in the credential data represents one API key. The key is an arbitrary identifier. The value can either be: * A string representing the API key. * A JSON object with `key` or `keyHash`, plus optional `metadata`. `key` contains the API key. `keyHash` contains a hashed API key in `sha256:<hex>` format. `metadata` contains arbitrary JSON metadata associated with the key, which may be used by other policies. For example, you may write an authorization policy allowing `apiKey.group == 'sales'`. Example: apiVersion: v1 kind: Secret metadata: name: api-key stringData: client1: | { "key": "k-123", "metadata": { "group": "sales", "created_at": "2024-10-01T12:00:00Z" } } client2: "k-456" client3: | { "keyHash": "sha256:efa299afb8c12a36e47a790cbbf929caa06d13285950410463fb759af17d0dad", "metadata": { "group": "engineering" } }
group string
API group of the referenced credential; empty selects the core API group
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
secretSelector object
Selects multiple Kubernetes `Secret` resources containing API keys. It is Secret-only; use `secretRef` for other credential kinds. If the same key is defined in multiple secrets, the behavior is undefined. Each entry in the `Secret` data represents one API key. The key is an arbitrary identifier. The value can either be: * A string representing the API key. * A JSON object with `key` or `keyHash`, plus optional `metadata`. `key` contains the API key. `keyHash` contains a hashed API key in `sha256:<hex>` format. `metadata` contains arbitrary JSON metadata associated with the key, which may be used by other policies. For example, you may write an authorization policy allowing `apiKey.group == 'sales'`. Example: apiVersion: v1 kind: Secret metadata: name: api-key stringData: client1: | { "key": "k-123", "metadata": { "group": "sales", "created_at": "2024-10-01T12:00:00Z" } } client2: "k-456"
matchLabels object required
Labels that must be present on each selected Secret.
authorization object
Access rules based on roles and permissions. If multiple authorization rules are applied across different policies, at the same or different attachment points, all rules are merged.
action string
The effect of this rule when it matches. If unspecified, defaults to `Allow`. `Require` rules are cumulative: all require rules must match.
enum: Allow, Deny, Require
policy object required
The authorization rule to evaluate. * `Allow`: any matching allow rule allows the request. * `Require`: every require rule must match for the request to be allowed. * `Deny`: any matching deny rule denies the request. `Deny` is not recommended because expression failures fail to deny; prefer `Allow` or `Require`. If used, design expressions defensively against evaluation errors. If at least one `Allow` rule is configured, requests are denied unless at least one allow rule matches.
matchExpressions []string required
CEL expressions that must all evaluate to true for the rule to match.
minItems: 1
maxItems: 256
basicAuthentication object
Authenticates users based on the `Basic` authentication scheme (RFC 7617), where a username and password are encoded in the request.
location object
Where Basic credentials are read from. If omitted, credentials are read from the `Authorization` header with the `Basic ` prefix.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
mode string
Validation mode for basic authentication.
enum: Optional, Strict
realm string
`realm` value to return in the `WWW-Authenticate` header for failed authentication requests. If unset, `Restricted` will be used.
secretRef object
Credential source, defaulting to a Kubernetes `Secret`, storing the `.htaccess` file. When using the default Secret resolver, the `Secret` must have a key named `.htaccess` by default; override via `secretRef.key`. The value should contain the complete `.htaccess` file. Note: passwords should be the hash of the password, not the raw password. Use the `htpasswd` or similar commands to generate a hash. MD5, bcrypt, crypt, and SHA-1 are supported. Example: apiVersion: v1 kind: Secret metadata: name: basic-auth stringData: .htaccess: | alice:$apr1$3zSE0Abt$IuETi4l5yO87MuOrbSE4V. bob:$apr1$Ukb5LgRD$EPY2lIfY.A54jzLELNIId/
group string
API group of the referenced credential; empty selects the core API group
key string
Key in the referenced Secret. If omitted, a location-specific default is used
minLength: 1
maxLength: 253
kind string
Kind of the referenced credential; empty defaults to `Secret`
name string required
Name of the referenced credential
minLength: 1
maxLength: 253
users []string
Inline list of username and password pairs that will be accepted. Each entry represents one line of the `htpasswd` format: https://httpd.apache.org/docs/2.4/programs/htpasswd.html. Note: passwords should be the hash of the password, not the raw password. Use the `htpasswd` or similar commands to generate a hash. MD5, bcrypt, crypt, and SHA-1 are supported. Example: users: - "user1:$apr1$ivPt0D4C$DmRhnewfHRSrb3DQC.WHC." - "user2:$2y$05$r3J4d3VepzFkedkd/q1vI.pBYIpSqjfN0qOARV3ScUHysatnS0cL2"
minItems: 1
maxItems: 256
buffer object
Buffers request and response bodies. Buffered bodies are accumulated in memory by the proxy until completion before being forwarded. This changes the proxies default behavior, which streams bodies. Warning: large bodies can lead to excessive memory usage in the proxy. Utilize with care, or with strict limits.
request object
Request body buffering settings.
failureMode string
Behavior when the request or response body exceeds the buffer limit. If unset, defaults to FailClosed, returning 413 for oversized requests and 502 for oversized responses.
enum: FailClosed, FailOpen
maxBytes string | integer
Maximum number of bytes to buffer from the request or response body. If unset, defaults to the global proxy setting, which defaults to 2Mi.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
response object
Response body buffering settings.
failureMode string
Behavior when the request or response body exceeds the buffer limit. If unset, defaults to FailClosed, returning 413 for oversized requests and 502 for oversized responses.
enum: FailClosed, FailOpen
maxBytes string | integer
Maximum number of bytes to buffer from the request or response body. If unset, defaults to the global proxy setting, which defaults to 2Mi.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
cors object
CORS configuration for the policy.
allowCredentials boolean
AllowCredentials indicates whether the actual cross-origin request allows to include credentials. When set to true, the gateway will include the `Access-Control-Allow-Credentials` response header with value true (case-sensitive). When set to false or omitted the gateway will omit the header `Access-Control-Allow-Credentials` entirely (this is the standard CORS behavior). Support: Extended
allowHeaders []string
Request headers allowed when accessing the resource, or `*` for all. Sets `Access-Control-Allow-Headers`. Support: Extended
maxItems: 64
allowMethods []string
HTTP methods allowed for the resource, or `*` for all. CORS-safelisted methods (`GET`, `HEAD`, `POST`) are always allowed. Sets `Access-Control-Allow-Methods`. Support: Extended
maxItems: 9
allowOrigins []string
Origins allowed to share the response, each as `<scheme>://<host>(:<port>)`; the host may use the `*` wildcard, and a bare `*` allows all origins. Sets `Access-Control-Allow-Origin`. When credentials are allowed, a specific origin is echoed instead of `*`. Support: Extended
maxItems: 64
exposeHeaders []string
Response headers exposed to client scripts, or `*` for all. Sets `Access-Control-Expose-Headers`. Support: Extended
maxItems: 64
maxAge integer
MaxAge indicates the duration (in seconds) for the client to cache the results of a "preflight" request. The information provided by the `Access-Control-Allow-Methods` and `Access-Control-Allow-Headers` response headers can be cached by the client until the time specified by `Access-Control-Max-Age` elapses. The default value of `Access-Control-Max-Age` response header is 5 (seconds). When the `MaxAge` field is unspecified, the gateway sets the response header "Access-Control-Max-Age: 5" by default.
format: int32
minimum: 1
csrf object
Cross-Site Request Forgery (CSRF) policy for this traffic policy. The CSRF policy has the following behavior: * Safe methods (`GET`, `HEAD`, `OPTIONS`) are automatically allowed. * Requests without `Sec-Fetch-Site` or `Origin` headers are assumed to be same-origin or non-browser requests and are allowed. * Otherwise, the `Sec-Fetch-Site` header is checked, with a fallback to comparing the `Origin` header to the `Host` header.
additionalOrigins []string
Additional source origins that will be allowed in addition to the destination origin. The `Origin` consists of a scheme and a host, with an optional port, and takes the form `<scheme>://<host>(:<port>)`.
minItems: 1
maxItems: 16
delay object
Injects artificial latency before forwarding requests, for fault-injection testing.
duration string required
Latency to inject before forwarding the request to the backend. Either a duration string such as `2s`, or a CEL expression evaluated against the request that returns a duration (e.g. `duration("500ms")`) or a number interpreted as milliseconds (e.g. `random() < 0.1 ? 500 : 0` for probabilistic delay, or `int(random() * 500)` for jitter). A non-positive result injects no delay. The injected delay counts against the request timeout.
minLength: 1
maxLength: 16384
directResponse object
Sends a direct response to the client.
body string
Content to return in the HTTP response body. The maximum length of the body is restricted to prevent excessively large responses. If this field is omitted, no body is included in the response.
minLength: 1
maxLength: 4096
bodyExpression string
CEL expression that produces the HTTP response body. Strings and bytes are written directly; other values are serialized as JSON. If this field is omitted, no expression body is included in the response.
minLength: 1
maxLength: 16384
conditional []object
Conditional policy execution. Set this or the top-level directResponse 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.
minItems: 1
maxItems: 16
condition string
CEL expression that must evaluate to true for this policy to execute.
minLength: 1
maxLength: 16384
policy object required
Policy to apply when the condition matches.
body string
Content to return in the HTTP response body. The maximum length of the body is restricted to prevent excessively large responses. If this field is omitted, no body is included in the response.
minLength: 1
maxLength: 4096
bodyExpression string
CEL expression that produces the HTTP response body. Strings and bytes are written directly; other values are serialized as JSON. If this field is omitted, no expression body is included in the response.
minLength: 1
maxLength: 16384
headers []object
Response headers to set on the direct response.
minItems: 1
maxItems: 16
name string required
The name of the header to set.
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
status integer
HTTP status code to return.
format: int32
minimum: 200
maximum: 599
headers []object
Response headers to set on the direct response.
minItems: 1
maxItems: 16
name string required
The name of the header to set.
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
status integer
HTTP status code to return.
format: int32
minimum: 200
maximum: 599
extAuth object
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.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cache object
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.
key []string required
Ordered list of CEL expressions evaluated against the request to construct the cache key.
minItems: 1
maxItems: 16
maxEntries integer
Maximum number of authorization results to keep in the cache. If unset, this defaults to 10000.
format: int32
minimum: 1
ttl string required
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.
minLength: 1
maxLength: 16384
conditional []object
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.
minItems: 1
maxItems: 16
condition string
CEL expression that must evaluate to true for this policy to execute.
minLength: 1
maxLength: 16384
policy object required
Policy to apply when the condition matches.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cache object
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.
key []string required
Ordered list of CEL expressions evaluated against the request to construct the cache key.
minItems: 1
maxItems: 16
maxEntries integer
Maximum number of authorization results to keep in the cache. If unset, this defaults to 10000.
format: int32
minimum: 1
ttl string required
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.
minLength: 1
maxLength: 16384
failureMode string
Behavior when the external authorization service is unavailable or returns an error. "FailOpen" allows the request to continue. "FailClosed" (default) denies the request.
enum: FailClosed, FailOpen
forwardBody object
Whether to include the HTTP body in the authorization request. If enabled, the request body will be buffered.
maxSize string | integer required
Largest body, in bytes, that will be buffered and sent to the authorization server. If the body size is larger than `maxSize`, then the request will be rejected with a response.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
grpc object
Uses the gRPC External Authorization [protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.
contextExtensions object
Additional arbitrary key-value pairs to send to the authorization server in the `context_extensions` field.
requestMetadata object
Metadata to send to the authorization server. This maps to the `metadata_context.filter_metadata` field of the request, and allows dynamic CEL expressions. If unset, by default the `envoy.filters.http.jwt_authn` key is set if the JWT policy is used as well, for compatibility.
http object
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.
addRequestHeaders object
Additional headers to add to the request to the authorization server. While `allowedRequestHeaders` just passes the original headers through, `addRequestHeaders` allows defining custom headers based on CEL expressions.
allowedRequestHeaders []string
Additional headers from the client request that will be sent to the authorization server. If unset, the following headers are sent by default: `Authorization`.
maxItems: 64
allowedResponseHeaders []string
Headers from the authorization response that will be copied into the request to the backend.
maxItems: 64
body string
Body is a CEL expression that produces the HTTP authorization request body. Strings and bytes are used directly; other values are JSON-encoded.
minLength: 1
maxLength: 16384
path string
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`.
minLength: 1
maxLength: 16384
redirect string
Optional expression that determines a path to redirect to on authorization failure. This is useful to redirect to a sign-in page.
minLength: 1
maxLength: 16384
responseMetadata object
Metadata fields to construct from the authorization response. These will be included under the `extauthz` variable in future CEL expressions. Setting this is useful for things like logging usernames, without needing to include them as headers to the backend, as `allowedResponseHeaders` would.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
failureMode string
Behavior when the external authorization service is unavailable or returns an error. "FailOpen" allows the request to continue. "FailClosed" (default) denies the request.
enum: FailClosed, FailOpen
forwardBody object
Whether to include the HTTP body in the authorization request. If enabled, the request body will be buffered.
maxSize string | integer required
Largest body, in bytes, that will be buffered and sent to the authorization server. If the body size is larger than `maxSize`, then the request will be rejected with a response.
string pattern: ^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)(([KMGTPE]i)|[numkMGTPE]|[eE](\+?0*([0-9]|1[0-8])|-0*[0-9]))?$
string minLength: 1
string maxLength: 32
grpc object
Uses the gRPC External Authorization [protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.
contextExtensions object
Additional arbitrary key-value pairs to send to the authorization server in the `context_extensions` field.
requestMetadata object
Metadata to send to the authorization server. This maps to the `metadata_context.filter_metadata` field of the request, and allows dynamic CEL expressions. If unset, by default the `envoy.filters.http.jwt_authn` key is set if the JWT policy is used as well, for compatibility.
http object
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.
addRequestHeaders object
Additional headers to add to the request to the authorization server. While `allowedRequestHeaders` just passes the original headers through, `addRequestHeaders` allows defining custom headers based on CEL expressions.
allowedRequestHeaders []string
Additional headers from the client request that will be sent to the authorization server. If unset, the following headers are sent by default: `Authorization`.
maxItems: 64
allowedResponseHeaders []string
Headers from the authorization response that will be copied into the request to the backend.
maxItems: 64
body string
Body is a CEL expression that produces the HTTP authorization request body. Strings and bytes are used directly; other values are JSON-encoded.
minLength: 1
maxLength: 16384
path string
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`.
minLength: 1
maxLength: 16384
redirect string
Optional expression that determines a path to redirect to on authorization failure. This is useful to redirect to a sign-in page.
minLength: 1
maxLength: 16384
responseMetadata object
Metadata fields to construct from the authorization response. These will be included under the `extauthz` variable in future CEL expressions. Setting this is useful for things like logging usernames, without needing to include them as headers to the backend, as `allowedResponseHeaders` would.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
extProc object
External processing configuration for the policy.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
conditional []object
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.
minItems: 1
maxItems: 16
condition string
CEL expression that must evaluate to true for this policy to execute.
minLength: 1
maxLength: 16384
policy object required
Policy to apply when the condition matches.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
failureMode string
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.
enum: FailClosed, FailOpen
metadataContext object
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.
processingOptions object
How request and response phases are sent to ext_proc.
allowModeOverride boolean
Allows ext_proc `mode_override` values from matching header responses to update subsequent request/response processing phases for this exchange. Defaults to `false`.
requestBodyMode string
How request bodies are sent to the external processor. Defaults to `FullDuplexStreamed`.
enum: Buffered, BufferedPartial, FullDuplexStreamed, None
requestHeaderMode string
Whether request headers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
requestTrailerMode string
Whether request trailers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
responseBodyMode string
How response bodies are sent to the external processor. Defaults to `FullDuplexStreamed`.
enum: Buffered, BufferedPartial, FullDuplexStreamed, None
responseHeaderMode string
Whether response headers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
responseTrailerMode string
Whether response trailers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
requestAttributes object
Request attributes to send to the external processor in the request `attributes` field of the ProcessingRequest. Values are CEL expressions evaluated per request.
responseAttributes object
Response attributes to send to the external processor in the response `attributes` field of the ProcessingRequest. Values are CEL expressions evaluated per response.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
failureMode string
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.
enum: FailClosed, FailOpen
metadataContext object
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.
processingOptions object
How request and response phases are sent to ext_proc.
allowModeOverride boolean
Allows ext_proc `mode_override` values from matching header responses to update subsequent request/response processing phases for this exchange. Defaults to `false`.
requestBodyMode string
How request bodies are sent to the external processor. Defaults to `FullDuplexStreamed`.
enum: Buffered, BufferedPartial, FullDuplexStreamed, None
requestHeaderMode string
Whether request headers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
requestTrailerMode string
Whether request trailers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
responseBodyMode string
How response bodies are sent to the external processor. Defaults to `FullDuplexStreamed`.
enum: Buffered, BufferedPartial, FullDuplexStreamed, None
responseHeaderMode string
Whether response headers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
responseTrailerMode string
Whether response trailers are sent to the external processor. Defaults to `Send`.
enum: Send, Skip
requestAttributes object
Request attributes to send to the external processor in the request `attributes` field of the ProcessingRequest. Values are CEL expressions evaluated per request.
responseAttributes object
Response attributes to send to the external processor in the response `attributes` field of the ProcessingRequest. Values are CEL expressions evaluated per response.
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
headerModifiers object
Request and response header modification policy.
request object
Header changes to apply before forwarding a request.
add []object
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: foo Config: add: - name: "my-header" value: "bar,baz" Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
maxItems: 16
name string required
Name of the HTTP header, case-insensitive
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
Value for the HTTP header
minLength: 1
maxLength: 4096
remove []string
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: baz Config: remove: ["my-header1", "my-header3"] Output: GET /foo HTTP/1.1 my-header2: bar
maxItems: 16
set []object
Set overwrites the request with the given header (name, value) before the action. Input: GET /foo HTTP/1.1 my-header: foo Config: set: - name: "my-header" value: "bar" Output: GET /foo HTTP/1.1 my-header: bar
maxItems: 16
name string required
Name of the HTTP header, case-insensitive
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
Value for the HTTP header
minLength: 1
maxLength: 4096
response object
Header changes to apply before returning a response.
add []object
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: foo Config: add: - name: "my-header" value: "bar,baz" Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
maxItems: 16
name string required
Name of the HTTP header, case-insensitive
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
Value for the HTTP header
minLength: 1
maxLength: 4096
remove []string
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: baz Config: remove: ["my-header1", "my-header3"] Output: GET /foo HTTP/1.1 my-header2: bar
maxItems: 16
set []object
Set overwrites the request with the given header (name, value) before the action. Input: GET /foo HTTP/1.1 my-header: foo Config: set: - name: "my-header" value: "bar" Output: GET /foo HTTP/1.1 my-header: bar
maxItems: 16
name string required
Name of the HTTP header, case-insensitive
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
Value for the HTTP header
minLength: 1
maxLength: 4096
hostRewrite object
How to rewrite the `Host` header for requests. If the `HTTPRoute` `urlRewrite` filter already specifies a host rewrite, this setting is ignored.
mode string required
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.
enum: Auto, None
jwtAuthentication object
Authenticates users based on JWT tokens.
location object
Where JWT credentials are read from. If omitted, credentials are read from the `Authorization` header with the `Bearer ` prefix.
cookie object
name string required
minLength: 1
maxLength: 256
expression string
CEL expression that extracts the credential from the request.
minLength: 1
maxLength: 16384
header object
name string required
Name of an HTTP header. HTTP/2 pseudo-headers (names beginning with `:`) are not supported
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
prefix string
minLength: 1
maxLength: 256
queryParameter object
name string required
minLength: 1
maxLength: 256
mcp object
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.
clientId string
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.
provider string
Identity provider to use for MCP authentication flows.
enum: Auth0, Authentik, Descope, Entra, Keycloak, Okta
resourceMetadata object
Metadata to use for MCP resources, served at the MCP OAuth metadata endpoints.
mode string
Validation mode for JWT authentication.
enum: Optional, Permissive, Strict
preserveToken boolean
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.
providers []object required
minItems: 1
maxItems: 64
audiences []string
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.
minItems: 1
maxItems: 64
issuer string required
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)).
minLength: 1
maxLength: 256
jwks object required
JSON Web Key Set used to validate the signature of the JWT.
inline string
Inline JSON Web Key Set used to validate the signature of the JWT.
minLength: 2
maxLength: 65536
remote object
How to reach the JSON Web Key Set from a remote address.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
cacheDuration string
How long a fetched `jwks` document is used before it is re-fetched from the IdP.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
jwksPath string
Path to the IdP `jwks` endpoint, relative to the root, commonly `".well-known/jwks.json"`.
minLength: 1
maxLength: 1024
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
phase string
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`.
enum: PostRouting, PreRouting
rateLimit object
Rate limiting configuration for the policy. This limits the rate at which requests are processed.
conditional []object
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.
minItems: 1
maxItems: 16
condition string
CEL expression that must evaluate to true for this policy to execute.
minLength: 1
maxLength: 16384
policy object required
Policy to apply when the condition matches.
global object
Global rate limiting policy using an external service.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
descriptors []object required
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.
minItems: 1
maxItems: 16
cost string
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.
minLength: 1
maxLength: 16384
entries []object required
Individual components that make up this descriptor.
minItems: 1
maxItems: 16
expression string required
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.
minLength: 1
maxLength: 16384
name string required
Name of the descriptor.
minLength: 1
maxLength: 64
limitOverride string
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.
minLength: 1
maxLength: 16384
unit string
Cost unit. If unspecified, `Requests` is used.
enum: Requests, Tokens
domain string required
Domain under which this limit should apply. This is an arbitrary string that enables a rate limit server to distinguish between different applications.
minLength: 1
maxLength: 256
failureMode string
Behavior when the remote rate limit service is unavailable or returns an error. `FailOpen` allows the request to continue. `FailClosed` (default) denies the request.
enum: FailClosed, FailOpen
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
local []object
Local rate limiting policy.
minItems: 1
maxItems: 16
burst integer
Allowance of requests above the request-per-unit that should be allowed within a short period of time.
format: int32
minimum: 0
requests integer
Number of HTTP requests per unit of time that are allowed. Requests exceeding this limit will fail with a `429` error.
format: int32
minimum: 1
tokens integer
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.
format: int32
minimum: 1
unit string required
Unit of time for the limit.
enum: Hours, Minutes, Seconds
global object
Global rate limiting policy using an external service.
backendRef object
`backendRef` selects a backend for this policy. Mutually exclusive with `url`.
group string
Group of the referent, for example `gateway.networking.k8s.io`. Empty selects the core API group
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
Kubernetes resource kind of the referent, for example `Service`. Defaults to `Service`
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent.
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the local namespace. A cross-namespace reference requires a ReferenceGrant in the referent namespace
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Destination port number. Required when the referent is a Kubernetes `Service`
format: int32
minimum: 1
maximum: 65535
descriptors []object required
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.
minItems: 1
maxItems: 16
cost string
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.
minLength: 1
maxLength: 16384
entries []object required
Individual components that make up this descriptor.
minItems: 1
maxItems: 16
expression string required
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.
minLength: 1
maxLength: 16384
name string required
Name of the descriptor.
minLength: 1
maxLength: 64
limitOverride string
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.
minLength: 1
maxLength: 16384
unit string
Cost unit. If unspecified, `Requests` is used.
enum: Requests, Tokens
domain string required
Domain under which this limit should apply. This is an arbitrary string that enables a rate limit server to distinguish between different applications.
minLength: 1
maxLength: 256
failureMode string
Behavior when the remote rate limit service is unavailable or returns an error. `FailOpen` allows the request to continue. `FailClosed` (default) denies the request.
enum: FailClosed, FailOpen
url string
`url` directly specifies the HTTP(S) endpoint for this policy. When the scheme is `https`, backend TLS is enabled automatically. Mutually exclusive with `backendRef`. URLs are opaque; referencing a Kubernetes service hostname like `hello.ns.svc.cluster.local` will not apply Service policies or load balancing.
pattern: ^https?://[^/?#@]+(/[^?#]*)?$
minLength: 1
maxLength: 1024
local []object
Local rate limiting policy.
minItems: 1
maxItems: 16
burst integer
Allowance of requests above the request-per-unit that should be allowed within a short period of time.
format: int32
minimum: 0
requests integer
Number of HTTP requests per unit of time that are allowed. Requests exceeding this limit will fail with a `429` error.
format: int32
minimum: 1
tokens integer
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.
format: int32
minimum: 1
unit string required
Unit of time for the limit.
enum: Hours, Minutes, Seconds
retry object
Retry policy.
attempts integer
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: Extended
minimum: 1
backoff string
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: Extended
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
codes []integer
Codes defines the HTTP response status codes for which a backend request should be retried. Support: Extended
condition string
`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`.
minLength: 1
maxLength: 16384
precondition string
`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).
minLength: 1
maxLength: 16384
timeouts object
Request timeouts. It is applicable to `HTTPRoute` resources and ignored for other targeted kinds.
request string
Timeout for an individual request from the gateway to a backend. This covers the time from when the request first starts being sent from the gateway to when the full response has been received from the backend.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
maxLength: 32
transformation object
Mutates and transforms requests and responses before forwarding them to the destination.
conditional []object
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.
minItems: 1
maxItems: 16
condition string
CEL expression that must evaluate to true for this policy to execute.
minLength: 1
maxLength: 16384
policy object required
Policy to apply when the condition matches.
request object
Request transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
response object
Response transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
request object
Request transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
response object
Response transformation settings.
add []object
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.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
body string
HTTP body transformation.
minLength: 1
maxLength: 16384
metadata object
Stores CEL-evaluated values under the `metadata` CEL variable for subsequent policy evaluations. `metadata` is evaluated before header or body transformations.
remove []string
Header names to remove from the request or response.
minItems: 1
maxItems: 16
set []object
Headers to set and the values to use.
minItems: 1
maxItems: 16
name string required
The name of the header to add.
pattern: ^:?[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
minLength: 1
maxLength: 256
value string required
CEL expression that generates the output value for the header.
minLength: 1
maxLength: 16384
status object
Current policy status.
ancestors []object required
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 ancestor
maxItems: 16
ancestorRef object required
AncestorRef corresponds with a ParentRef in the spec that this PolicyAncestorStatus struct describes the status of.
group string
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: Core
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
maxLength: 253
kind string
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.
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
minLength: 1
maxLength: 63
name string required
Name is the name of the referent. Support: Core
minLength: 1
maxLength: 253
namespace string
Namespace of the referent. Defaults to the Route's local namespace. Cross-namespace references must be explicitly allowed, for example via ReferenceGrant. Support: Core
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
minLength: 1
maxLength: 63
port integer
Port this Route targets on the parent, interpreted per parent kind (for example a Gateway listener port or Service port). Support: Extended
format: int32
minimum: 1
maximum: 65535
sectionName string
Name of a section within the target resource, for example a Gateway Listener name or Service port name. Empty references the entire resource. Support: Core
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
minLength: 1
maxLength: 253
conditions []object required
Conditions describing the status of the policy for this ancestor
minItems: 1
maxItems: 8
lastTransitionTime string required
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.
format: date-time
message string required
message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
observedGeneration integer
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.
format: int64
minimum: 0
reason string required
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.
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
minLength: 1
maxLength: 1024
status string required
status of the condition, one of True, False, Unknown.
enum: True, False, Unknown
type string required
type of condition in CamelCase or in foo.example.com/CamelCase.
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])$
maxLength: 316
controllerName string required
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.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$
minLength: 1
maxLength: 253

No matches. Try .spec.backend for an exact path