Add structured request-content parsing to Egress Gate - #35
Merged
Conversation
Documentation previewThe preview has been removed. |
johnnygreco
marked this pull request as ready for review
August 8, 2026 03:16
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.
Summary
(node, kind)classificationsWhy
Egress Gate previously treated a request body as one complete UTF-8 string. Agent harness requests need bounded, configurable extraction of model-visible JSON fields and message blocks without scanning unrelated metadata or losing exact source formatting during replacement.
QA also found two boundary issues in the first implementation: the reusable parser API relied on downstream request models for some body-size enforcement, and a broad text selector could shadow an explicit tool classification before block-kind filters ran. The final implementation owns its advertised bounds and filters distinct classifications before exposing each backing string once.
Impact
Policies can opt into
json-fieldsormessage-blocksscans. Existingbody, path, query, and header behavior remains available. Structured replacement rewrites only selected JSON string tokens and preserves all unrelated request bytes. Explicit tool-input and tool-output filters cannot be bypassed by an overlapping generic text selector.QA and validation
make check— 324 tests plus formatting, linting, typing, installed-package import, and dependency auditpython3 tests/test_render_dev_notes.py— 11 testsscripts/build-docs.sh— strict build, 14 agent-readable pages, all documentation tests pass