Subject: Agent Gateway ingress — REQUEST_AUTHZ DENY on HTTP header not enforced for Reasoning Engine (:query / :streamQuery)
Hi,
I need help configuring Agent Gateway in Client-to-Agent (ingress) mode. I want to enforce auth by checking a custom HTTP header (AGENT GATEWAY) , and I don’t understand how to make that work on ingress.
What I tried on ingress
I imported this policy successfully (authz-policies describe shows it):
name: ingress-header-authz-policy
policyProfile: REQUEST_AUTHZ
action: DENY
target:
resources:
- projects/.../locations/europe-west4/agentGateways/agw-ingress
httpRules:
- to:
operations:
- paths:
- prefix: /
when: '!("idp-custom-key" in request.headers && request.headers["idp-custom-key"] == "1234")'
Expected: missing idp-custom-key: 1234 → HTTP 403
Actual: HTTP 200 with and without the header. No entries in networkservices.googleapis.com/gateway_requests for agw-ingress.
Context — same CEL pattern works on egress
On egress (agw-egress), this DENY policy works for A2A:
name: header-authz-policy
target:
resources:
- "projects/PROJECT/locations/REGION/agentGateways/GW_NAME"
policyProfile: REQUEST_AUTHZ
action: DENY
httpRules:
- to:
operations:
- hosts:
- exact: "REGION-aiplatform.googleapis.com"
paths:
- prefix: "/v1beta1/projects/PROJECT/locations/REGION/reasoningEngines/RE_ID_TARGET/a2a"
when: '!("idp-custom-key" in request.headers && request.headers["idp-custom-key"] == "1234")'
Also: Model Armor on ingress (CONTENT_AUTHZ) returns 403 on jailbreak prompts for streamQuery on the same API endpoint — so ingress AGW seems to affect that path, but header DENY does not.
Questions
- Is
REQUEST_AUTHZ+ DENY onrequest.headerssupported on ingress for ADK Reasoning Engine (:query,:streamQuery) whenclientToAgentConfigis set? - Why is the policy deployed but not blocking requests and not generating
gateway_requests? - Can
iap-ingress-authzon ingress (docs: “IAP isn’t supported during ingress”) prevent DENY evaluation? - What is the recommended way to enforce a custom header / API key for clients calling a RE through ingress AGW?
Thank you.