Skip to content

[Router] Scope signal evaluation to authz-eligible decisions - #2648

Open
duchangyong wants to merge 7 commits into
vllm-project:mainfrom
duchangyong:feature/issue-2647-authz-signal-scope
Open

[Router] Scope signal evaluation to authz-eligible decisions#2648
duchangyong wants to merge 7 commits into
vllm-project:mainfrom
duchangyong:feature/issue-2647-authz-signal-scope

Conversation

@duchangyong

Copy link
Copy Markdown
Contributor

Closes #2647

Purpose

  • Evaluate the authz signal before the remaining routing signals.
  • Conservatively partially evaluate candidate decision rule trees with known authz facts and remove only decisions that are definitely false.
  • Derive non-authz signal usage from the retained candidates, then pass the same candidate set to the final decision engine so computation and result scopes stay aligned.
  • Preserve existing all-signal behavior when forceEvaluateAll is enabled and preserve the default-model fallback when authz removes every auto-routing candidate.
  • Affects: Router.

Test Plan

  • Run focused classifier and extproc package tests:
    • go test ./pkg/classification ./pkg/extproc -count=1
  • Run the complete Semantic Router Go suite:
    • make test-semantic-router
  • Run repository structural lint, config-contract checks, and the fast test gate:
    • make agent-ci-gate ENV=cpu AGENT_BASE_REF=origin/main AGENT_SKIP_PRECOMMIT_BASELINE=1 ...
  • Review formatting and patch integrity:
    • git diff --check
  • Build a branch image, load it into the existing Podman-backed Kind cluster, and run a streaming-shaped ExtProc request against the existing model PVC:
    • verify the running image ID and /app/router-candle SHA
    • verify fixed-general route selection for authz group maas-route-9120
    • verify signal metrics contain only the authz-eligible decision's authz, jailbreak, and pii classifiers

The unit tests cover conservative AND/OR/NOT partial evaluation, malformed-rule retention, case-sensitive authz role matching, decision-scoped signal discovery, skipped irrelevant classifier work, force-all compatibility, extproc candidate propagation, and empty-candidate auto-model fallback.

Test Result

  • go test ./pkg/classification ./pkg/extproc -count=1: passed.
  • make test-semantic-router: passed.
  • Agent CI gate: passed Go structural lint, reference-config contract checks, structure checks, and the full fast test command.
  • git diff --check: passed.
  • Existing-cluster runtime smoke: passed with branch image localhost/semantic-router-extproc:issue-2647-10826745 (image ID sha256:1875b27085bc4e4565f5924aef48f707daceeb49b9a36a87d82a66fade9fc954) and verified /app/router-candle SHA 7c5c8e1e8e375bd055d34963c2252e2d89c476ceb7b65098f3d75313e5d6f0fc.
  • A streaming-shaped request (stream: true) for authz group maas-route-9120 selected route maas-route-9120, scene general, and model maas-model-rel-91201.
  • Runtime metrics reported only authz, jailbreak, and pii signal extraction; unrelated configured signals such as keyword, embedding, domain, context, complexity, modality, and fact-check were not evaluated.
  • The smoke test reused the existing kind-cluster, Deployment, and mounted model PVC without downloading models. Its cleanup restored the original localhost/semantic-router-extproc:route-scope-20260723 image and Ready replica.

Semantic Router PR Checklist
  • PR title uses module-aligned prefixes such as [Router], [CLI], [Dashboard], [Operator], [Fleet-Sim], [Bindings], [Training], [E2E], [Docs], or [CI/Build]
  • If the PR spans multiple modules, the title includes all relevant prefixes
  • Commits in this PR are signed off with git commit -s
  • The Purpose, Test Plan, and Test Result sections reflect the actual scope, commands, and blockers for this change

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 3ad3673
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/6a6e0d74b3815200088b4385
😎 Deploy Preview https://deploy-preview-2648--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned when their GitHub accounts are assignable in this repository:

📁 e2e

Owners: @FAUST-BENCHOU, @shraderdm, @drivebyer, @ramkrishs, @WUKUNTAI-0211, @AayushSaini101, @siloteemu
Files changed:

  • e2e/config/config.authz-rbac.yaml
  • e2e/profiles/authz-rbac/README.md
  • e2e/profiles/authz-rbac/profile.go
  • e2e/profiles/authz-rbac/values.yaml
  • e2e/testcases/authz_signal_scope.go
  • e2e/testcases/authz_signal_scope_test.go

📁 src/semantic-router

Owners: @FAUST-BENCHOU, @shraderdm, @drivebyer, @ramkrishs, @WUKUNTAI-0211, @AayushSaini101, @siloteemu
Files changed:

  • src/semantic-router/pkg/classification/classifier_authz_scope.go
  • src/semantic-router/pkg/classification/classifier_authz_scope_test.go
  • src/semantic-router/pkg/classification/classifier_signal_authz.go
  • src/semantic-router/pkg/classification/classifier_signal_context.go
  • src/semantic-router/pkg/classification/classifier_signal_context_test.go
  • src/semantic-router/pkg/classification/classifier_signal_usage.go
  • src/semantic-router/pkg/extproc/req_filter_classification.go
  • src/semantic-router/pkg/extproc/req_filter_classification_runtime.go
  • src/semantic-router/pkg/extproc/req_filter_classification_signal_test.go

vLLM Semantic Router

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

✅ Supply Chain Security Report — All Clear

Scanner Status Findings
AST Codebase Scan (Py, Go, JS/TS, Rust) 31 finding(s) — MEDIUM: 24 · LOW: 7
AST PR Diff Scan No issues detected
Regex Fallback Scan No issues detected

Scanned at 2026-08-01T15:16:17.604Z · View full workflow logs

@FAUST-BENCHOU FAUST-BENCHOU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests cover the scoped evaluation paths, but this is a behavior-visible routing change and the repository requires E2E coverage for it. The manual cluster smoke demonstrates the behavior once, but it won’t protect against future regressions. Could we extend the existing authz-rbac profile to verify that routing stays unchanged and a signal used only by an ineligible decision is not evaluated?

@duchangyong

Copy link
Copy Markdown
Contributor Author

Hi @rootfs @Xunzhuo @FAUST-BENCHOU, the requested authz-rbac E2E coverage has been added: it verifies that an authz-ineligible decision does not evaluate its signal while fallback routing remains unchanged. All PR checks are now green (29 successful). Could you please take another look when you have a moment? Thank you!

@duchangyong
duchangyong force-pushed the feature/issue-2647-authz-signal-scope branch from 8d6bdcb to be1971e Compare July 28, 2026 16:32
0027020836 added 4 commits July 29, 2026 10:09
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
@duchangyong
duchangyong force-pushed the feature/issue-2647-authz-signal-scope branch from be1971e to fcad011 Compare July 29, 2026 02:16
skipCompressionSignals,
convFacts,
imageURL,
c.Config.Decisions,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve all recipe decisions for the compatibility wrapper. EvaluateAllSignalsWithContext has no request scope, and before this change getUsedSignals used Config.AllRoutingDecisions(). Passing only Config.Decisions here drops signals referenced exclusively by non-default recipes for callers such as ClassificationService.ClassifyIntent. Please keep AllRoutingDecisions() in unscoped wrappers and reserve the narrower list for the explicit request-scoped APIs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in e9ebd9b: EvaluateAllSignalsWithContext now uses Config.AllRoutingDecisions() again, while the explicit request-scoped APIs keep the narrower decision list. I also added regression coverage for a signal referenced only by a non-default recipe.

Validation:

  • go test ./pkg/classification
  • go test ./e2e/testcases
  • full local Podman/Kind authz-rbac profile: 4/4 passed, including authz-signal-scope (admin_only_marker metric delta 0 and fallback model Qwen/Qwen2.5-7B-Instruct)
  • all GitHub CI checks on 3ad3673 completed successfully, including both required checks and the Kubernetes integration test; conditional jobs were skipped as expected

0027020836 added 3 commits August 1, 2026 14:52
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
Signed-off-by: 0027020836 <du.changyong2@iwhalecloud.com>
@duchangyong
duchangyong requested a review from Xunzhuo August 1, 2026 21:06
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.

feature: scope signal evaluation to authz-eligible decisions

8 participants