From 1d8597fe2a3f52a525242a54ab5d25292ea80f13 Mon Sep 17 00:00:00 2001 From: Art Berger Date: Mon, 16 Nov 2026 20:29:22 -0500 Subject: [PATCH 1/3] Replace stale AgentgatewayModel status warning on latest AgentgatewayModel has reported status.parents since v1.7.0. Replace the warning with the status check that main already has. Co-Authored-By: Claude Sonnet 5.5 Signed-off-by: Art Berger --- .../latest/documentation/llm/models/serve.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/content/docs/kubernetes/latest/documentation/llm/models/serve.md b/content/docs/kubernetes/latest/documentation/llm/models/serve.md index 29cac7fda..5d6719a43 100644 --- a/content/docs/kubernetes/latest/documentation/llm/models/serve.md +++ b/content/docs/kubernetes/latest/documentation/llm/models/serve.md @@ -363,22 +363,25 @@ The model did not attach to the listener, or it is not reachable by clients. Com -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="AGW_ENABLE_AGENTGATEWAY_MODELS")].value}' ``` -2. Check how many routes attached to the listener. This count includes every `{{< reuse "agw-docs/snippets/agentgatewaymodel.md" >}}` that attached, whether public or internal. +2. Check whether the parent accepted the model. An unaccepted model reports `Accepted: False` in `status.parents`. + + ```sh + kubectl get agentgatewaymodel gpt-4 -n {{< reuse "agw-docs/snippets/namespace.md" >}} -o yaml + ``` + +3. Check how many routes attached to the listener. This count includes every `{{< reuse "agw-docs/snippets/agentgatewaymodel.md" >}}` that attached, whether public or internal. ```sh kubectl get gateway agentgateway-proxy -n {{< reuse "agw-docs/snippets/namespace.md" >}} \ -o jsonpath='{.status.listeners[0].attachedRoutes}' ``` -3. List the models that clients can reach. If a model is missing here but the `attachedRoutes` count includes it, the model is `Internal`. +4. List the models that clients can reach. If a model is missing here but the `attachedRoutes` count includes it, the model is `Internal`. ```sh curl -s http://$INGRESS_GW_ADDRESS/v1/models ``` -> [!WARNING] -> The `{{< reuse "agw-docs/snippets/agentgatewaymodel.md" >}}` resource does not yet report status. The `status.parents` field stays empty even when a model serves traffic correctly, so you cannot use `kubectl describe agmodel` to debug attachment. Use the checks in this section instead. - ### Cleanup > [!NOTE] From 061da287f914ecd8828765955351b864a7a9adeb Mon Sep 17 00:00:00 2001 From: Art Berger Date: Mon, 16 Nov 2026 20:29:22 -0500 Subject: [PATCH 2/3] Gate CSRF client-safe error body for main On main, the client sees 'csrf validation failed' (lowercase). Older versions keep 'CSRF validation failed'. Gate the diagram and the example output as pairs. Co-Authored-By: Claude Sonnet 5.5 Signed-off-by: Art Berger --- assets/agw-docs/pages/security/csrf.md | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/assets/agw-docs/pages/security/csrf.md b/assets/agw-docs/pages/security/csrf.md index 4aff3f5c5..7c18e700f 100644 --- a/assets/agw-docs/pages/security/csrf.md +++ b/assets/agw-docs/pages/security/csrf.md @@ -13,6 +13,37 @@ For requests without a `Sec-Fetch-Site` header, the policy compares the host and {{< /version >}} Review the following diagram to see an example CSRF request flow: +{{< version exclude-if="1.0.x,1.1.x,1.2.x,1.3.x,1.4.x,1.5.x,1.6.x,1.7.x,2.2.x" >}} +```mermaid +sequenceDiagram + participant Attacker as Malicious Site
(attacker.com) + participant User as User's Browser + participant AGW as AgentGateway Proxy + participant Backend as Backend Service + + Note over Attacker,Backend: CSRF Attack Attempt + + Attacker->>User: Trick user into visiting
malicious page with hidden form + User->>AGW: POST /api/action
Origin: malicioussite.com
Cookie: session=abc123 + + AGW->>AGW: CSRF validation:
Origin (malicioussite.com)
vs Destination (api.example.com) + + alt Origin does NOT match destination
and NOT in additionalOrigins + AGW-->>User: 403 Forbidden
"csrf validation failed" + Note over User,AGW: Attack blocked + end + + Note over User,Backend: Legitimate Request + + User->>AGW: POST /api/action
Origin: allowThisOne.example.com
Cookie: session=abc123 + + AGW->>AGW: CSRF validation:
Origin in additionalOrigins list + AGW->>Backend: Forward request + Backend-->>AGW: 200 OK + AGW-->>User: 200 OK +``` +{{< /version >}} +{{< version include-if="1.0.x,1.1.x,1.2.x,1.3.x,1.4.x,1.5.x,1.6.x,1.7.x,2.2.x" >}} ```mermaid sequenceDiagram participant Attacker as Malicious Site
(attacker.com) @@ -41,6 +72,7 @@ sequenceDiagram Backend-->>AGW: 200 OK AGW-->>User: 200 OK ``` +{{< /version >}} > [!NOTE] > Note that because CSRF attacks specifically target state-changing requests, the filter only acts on HTTP requests that have a state-changing method such as `POST` or `PUT`. @@ -101,6 +133,17 @@ Configure an {{< reuse "agw-docs/snippets/policy.md" >}} to enable CSRF protecti Example output: + {{< version exclude-if="1.0.x,1.1.x,1.2.x,1.3.x,1.4.x,1.5.x,1.6.x,1.7.x,2.2.x" >}} + ```console + * Request completely sent off + < HTTP/1.1 403 Forbidden + HTTP/1.1 403 Forbidden + ... + < + csrf validation failed% + ``` + {{< /version >}} + {{< version include-if="1.0.x,1.1.x,1.2.x,1.3.x,1.4.x,1.5.x,1.6.x,1.7.x,2.2.x" >}} ```console * Request completely sent off < HTTP/1.1 403 Forbidden @@ -109,6 +152,7 @@ Configure an {{< reuse "agw-docs/snippets/policy.md" >}} to enable CSRF protecti < CSRF validation failed% ``` + {{< /version >}} 3. Send another request to the httpbin app. This time, you include the `allowThisOne.example.com` origin header that is allowed in your policy. Verify that you get back a 200 HTTP response code, because the origin matches the origin that you specified in the {{< reuse "agw-docs/snippets/policy.md" >}} resource. From 89ed40f865378f721a989d8951af2f877e12c9c9 Mon Sep 17 00:00:00 2001 From: Art Berger Date: Mon, 16 Nov 2026 20:29:23 -0500 Subject: [PATCH 3/3] Fix backend policy precedence and ListenerSet target on main Route and Route rule targets override Service and Backend targets for the backend section. ListenerSet targets have no effect on the backend phase. Co-Authored-By: Claude Sonnet 5.5 Signed-off-by: Art Berger --- .../main/documentation/about/policies/target-merge.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content/docs/kubernetes/main/documentation/about/policies/target-merge.md b/content/docs/kubernetes/main/documentation/about/policies/target-merge.md index 6bbd71ef4..566d20d69 100644 --- a/content/docs/kubernetes/main/documentation/about/policies/target-merge.md +++ b/content/docs/kubernetes/main/documentation/about/policies/target-merge.md @@ -21,7 +21,7 @@ The following table shows which resource types each policy section can target. | -- | -- | -- | -- | | `frontend` | Gateway | Depends on the field. See [Frontend section restrictions](#frontend-restrictions) for more information. | Applies to all listeners on the targeted Gateway. A `targetRef` or `targetSelector` can also set `port` to scope the policy to a single listener port on the Gateway. | | `traffic` | Gateway, HTTPRoute, GRPCRoute, ListenerSet | Optional | When targeting a Gateway, the `sectionName` selects a specific listener. When targeting a ListenerSet, the `sectionName` selects a specific listener in that ListenerSet. When targeting an HTTPRoute or GRPCRoute, the `sectionName` selects a specific route rule. | -| `backend` | Gateway, HTTPRoute, GRPCRoute, ListenerSet, Service, {{< reuse "agw-docs/snippets/backend.md" >}} | Optional | When targeting a Service, the `sectionName` selects a specific port. When targeting an {{< reuse "agw-docs/snippets/backend.md" >}}, the `sectionName` selects a specific sub-backend. | +| `backend` | Gateway, HTTPRoute, GRPCRoute, Service, {{< reuse "agw-docs/snippets/backend.md" >}} | Optional | When targeting a Service, the `sectionName` selects a specific port. When targeting an {{< reuse "agw-docs/snippets/backend.md" >}}, the `sectionName` selects a specific sub-backend. | ### Frontend section restrictions {#frontend-restrictions} @@ -79,7 +79,7 @@ Each policy section follows a different precedence order based on the specificit | `frontend` | Gateway < Port < Listener | | `traffic` (Gateway listeners) | Gateway < Listener < Route < Route rule | | `traffic` (ListenerSet listeners) | Gateway < ListenerSet < ListenerSet listener < Route < Route rule | -| `backend` | Gateway < Listener < Route (targetRef) < Route rule (targetRef) < Backend (targetRef) < Backend (inline on the backend object) < Route backend ref (inline on the route) | +| `backend` | Gateway < Listener < Service or Backend (targetRef) < Sub-backend (targetRef with `sectionName`) < Route (targetRef) < Route rule (targetRef) < Backend (inline on the backend object) < Route backend ref (inline on the route) | A listener is defined either on the Gateway or in a ListenerSet. So a `traffic` policy follows the Gateway listener order or the ListenerSet listener order, depending on where its listener is defined. @@ -87,6 +87,11 @@ For a `frontend` policy, you can only apply the policy at the Listener level whe For `backend`, precedence works the same way but with more levels. For example, if a Gateway-level policy sets `backend.tcp` and `backend.tls`, and a Backend-level policy sets `backend.tls`, the effective policy uses `tcp` from the Gateway policy and `tls` from the Backend policy. +A `backend` policy that targets a Route overrides a `backend` policy that targets the Service or Backend that the route sends traffic to. For example, if a Route-level policy and a Backend-level policy both set `backend.transformation`, the effective policy uses the value from the Route policy. + +> [!NOTE] +> A `backend` policy that targets a ListenerSet has no effect. The Kubernetes API server accepts the policy and the policy reports `Attached`, but agentgateway does not apply it to the backend. To apply a `backend` policy to every route on a ListenerSet listener, target the Gateway or each Route instead. Policies in the `traffic` section can target a ListenerSet. + ### Equal specificity {#ties} If multiple policies with the same specificity set the same field, the oldest policy wins, based on its Kubernetes `metadata.creationTimestamp`. If the timestamps are equal, agentgateway uses lexicographic order of the policy key to break the tie. The selection is stable across controller restarts.