fix(serve): wire ContentSanitizer and ML classifier pipeline into zeph serve sessions#6586
Merged
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 20, 2026 14:45
…h serve sessions `src/serve/agent_factory.rs` built every /sessions* Agent (the zeph serve HTTP/SSE path, the entry point most exposed to untrusted external input) without quarantine, guardrail, ML injection/PII classification, causal-IPI, NLI, Vigil, or secret masking, and without the ML injection classifier or enforcement mode from [classifiers]. src/runner.rs, src/daemon.rs, and src/acp.rs already applied this pipeline; serve silently ran with none of it regardless of operator config. Mirror src/acp.rs's spawn_acp_agent: snapshot the same sanitizer/classifier config and resolved providers into ServeAgentDeps during assemble_serve_deps, then wire them onto each session's Agent in build_agent_factory using the same _with_cfg helpers and ordering (enforcement-mode after the injection classifier, secret-masking last). Widen 9 SharedAgentDeps fields in acp.rs to pub(crate) and add a parity regression test driving build_combined_deps against a non-default security config, asserting both serve and ACP deps reflect the configured values. Closes #6580 Closes #6582
bug-ops
force-pushed
the
fix/6580-serve-sanitizer-wiring
branch
from
July 20, 2026 14:48
3e0fb48 to
c300891
Compare
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
src/serve/agent_factory.rsbuilt every/sessions*Agent(thezeph serveHTTP/SSE path — the entry point most exposed to untrusted external input, spec-068 §9) without any of the ContentSanitizer pipeline (quarantine, guardrail, PII classifier/NER, three-class classifier, causal-IPI analyzer, NLI sanitizer, Vigil, secret masking) and without the ML injection classifier or[classifiers].enforcement_mode, even thoughsrc/runner.rs,src/daemon.rs, andsrc/acp.rsall applied this pipeline already. An operator who enabled hardening config ([security.vigil],[classifiers], secret masking, NLI, etc.) believing it covered every channel silently got none of it on Telegram/Discord/Slack sessions.src/acp.rs'sspawn_acp_agent: snapshots the same sanitizer/classifier config and resolved providers intoServeAgentDepsduringassemble_serve_deps, then wires them onto each session'sAgentinbuild_agent_factoryusing the same_with_cfghelpers and ordering (enforcement-mode after the injection classifier; secret-masking last, since it retroactively wraps every already-set provider field).SharedAgentDepsfields insrc/acp.rstopub(crate)(visibility-only) and adds a parity regression test (acp::tests::build_combined_deps_wires_equivalent_security_pipeline_from_config) drivingbuild_combined_depsagainst a non-default security config, asserting bothServeAgentDepsandSharedAgentDepsreflect the configured values.Closes #6580
Closes #6582
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 14879 passed, 36 skipped, 0 failuresRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --stagedCHANGELOG.mdupdated under[Unreleased].local/testing/playbooks/wire-x-acp-daemon-serve-6580-6582.mdadded with concrete scenarios.local/testing/coverage-status.mdrow added (status: Untested — pending a livezeph serve-sessionsverification pass in a future CI session)zeph serve-sessions(playbook scenarios) — tracked separately per project convention, not required to land this fix