Skip to content

fix(standalone): classify dual-role policies for backend targets - #2543

Merged
howardjohn merged 2 commits into
agentgateway:mainfrom
piyushbag:fix/1440-backend-target-dual-policies
Jul 16, 2026
Merged

howardjohn merged 2 commits into
agentgateway:mainfrom
piyushbag:fix/1440-backend-target-dual-policies

Conversation

@piyushbag

Copy link
Copy Markdown
Contributor

Summary

Top-level policies with target.backend could not apply dual-role types such as transformations, because split_policies always classified them as TrafficPolicy. They never surfaced through as_backend().

Approach

  • Add split_policies_for_target so dual-role types become BackendTrafficPolicy when the policy target is a backend
  • Reject conditional transformations / extAuthz on backend targets (inline backend policies only accept the explicit form)
  • Cover normalize success and rejection paths in local_tests

Test plan

  • cargo test --lib top_level_backend_targeted

Fixes #1440

When top-level policies use target.backend, types such as transformations
were always stored as TrafficPolicy, so they never applied via as_backend().
Route dual-role types to BackendTrafficPolicy for backend targets, reject
conditional forms that inline backend policies do not support, and cover
with normalize tests.

Fixes agentgateway#1440

Signed-off-by: Piyush Jagadish Bag <[email protected]>
@piyushbag
piyushbag requested a review from a team as a code owner July 15, 2026 17:42
Signed-off-by: John Howard <[email protected]>
@howardjohn
howardjohn merged commit 9e1bd12 into agentgateway:main Jul 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

standalone: cannot apply certain configs as backend policies

2 participants