Conversation
…n detection (#1862) Implements the third layer of Zeph's defense-in-depth pipeline per arXiv 2511.15759. ContentSanitizer and ExfiltrationGuard cover input; ResponseVerifier covers LLM output. - ResponseVerifier in zeph-sanitizer scans LLM responses before tool dispatch - 7 curated RAW_RESPONSE_PATTERNS (separate from input-side RAW_INJECTION_PATTERNS) to avoid false positives on normal LLM output - Config: [security.response_verification] enabled=true, block_on_detection=false - Integration: native and legacy tool-execution paths, post-LLM pre-dispatch - TUI SEC panel: [rver] badge via SecurityEventCategory::ResponseVerification - 10 unit tests covering all patterns and Clean/Flagged/Blocked result variants
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
Implements the missing third layer of Zeph's defense-in-depth pipeline per arXiv 2511.15759 (SecureAgent benchmark). Reduces attack success by adding post-LLM response verification before tool dispatch.
ContentSanitizer— scans untrusted input before context insertionExfiltrationGuard+PreExecutionVerifier— output filtering + pre-dispatch tool auditResponseVerifier— scans LLM responses for echoed injection patternsChanges
zeph-sanitizer: newResponseVerifierstruct withverify(ctx) -> ResponseVerificationResultzeph-tools/patterns.rs: 7 curatedRAW_RESPONSE_PATTERNS(separate from input-side patterns to avoid false positives)zeph-config:ResponseVerificationConfigwithenabled=true,block_on_detection=falsedefaultszeph-coreagent loop: called in native and legacy tool-execution paths after LLM response, before tool dispatch[rver]badge via newSecurityEventCategory::ResponseVerificationvariantTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --workspace --features full --lib --bins— 6407 passed (+10 vs baseline 6397)raw_response_patterns_all_compiletest guards against regex regressionsCloses #1862