Repository navigation
Conversation
…ests The AI filter chain started only on declared endpoints, so a catch-all route with no per-route config, such as a dynamic forward proxy's, never reached schema validation to detect the API. Run the chain on any request whose payload parsed; a best-effort payload that fails to parse is still forwarded unchanged. Signed-off-by: Boteng Yao <botengyao@gmail.com>
Signed-off-by: Boteng Yao <botengyao@gmail.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Parsing unconfigured routes can incorrectly enable response filtering without an AI chain, rewriting responses that should pass through and potentially triggering response errors.
1 open issue
What changed in this PR
This PR extends Envoy’s AI protocol manager to run AI filters on successfully parsed requests from unconfigured routes, enabling schema validation to detect APIs on catch-all routes.
Changes:
- Trigger AI filters after successful parsing, while preserving passthrough for unparseable best-effort payloads.
- Add unit and integration coverage for unconfigured-route filtering, API detection, and rejection.
- Update API comments, user documentation, and release notes.
| File | Description |
|---|---|
test/extensions/http/ai_filters/schema_validation/schema_validation_integration_test.cc |
Tests API detection and rejection on unconfigured routes. |
test/extensions/filters/http/ai_protocol_manager/filter_test.cc |
Tests filter execution and unparseable-payload passthrough. |
source/extensions/filters/http/ai_protocol_manager/filter.h |
Tracks successful request parsing and updates behavior comments. |
source/extensions/filters/http/ai_protocol_manager/filter.cc |
Starts AI filtering based on successful parsing. |
docs/root/configuration/http/http_filters/ai_protocol_manager_filter.rst |
Documents filtering on unconfigured routes. |
changelogs/current/minor_behavior_changes/ai_protocol_manager__ai-filters-on-unconfigured-routes.rst |
Announces the opt-in behavior change. |
api/envoy/extensions/filters/http/ai_protocol_manager/v3/ai_protocol_manager.proto |
Clarifies filter execution and possible rejection in API comments. |
Review effort: Balanced
| @@ -514,7 +515,7 @@ void AiProtocolManagerFilter::finalizeDecode(bool has_trailers) { | |||
| } | |||
| }; | |||
|
|
|||
| if (isAiEndpoint() && !decode_manager_->empty() && !payload_rejected_) { | |||
| if (request_parsed_ && !payload_rejected_) { | |||
Signed-off-by: Boteng Yao <botengyao@gmail.com>
Signed-off-by: Boteng Yao <botengyao@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Commit Message: ai_protocol_manager: run AI filters on parse_unconfigured_routes requests
Additional Description: AI filters ran only on declared endpoints, so a route with no per-route config (e.g. a DFP catch-all) never reached schema validation's API detection. They now run on any parsed payload. Declared endpoints are unchanged; a best-effort body that fails to parse is still forwarded without running AI filters. With parse_unconfigured_routes on, AI filters may now reject requests on unconfigured routes, and bodies are re-serialized by default.
Risk Level: Medium (opt-in via parse_unconfigured_routes; alpha extension)
Testing: Unit and schema validation integration tests for unconfigured routes.
Docs Changes: AiProtocolManager.filters, RequestHandling.parse_unconfigured_routes, AI protocol manager filter docs.
Release Notes: Added to minor_behavior_changes.
AI usage: Written with Claude Code assistance; I reviewed and understand all of it.