Skip to content

fix(serve): wire ContentSanitizer and ML classifier pipeline into zeph serve sessions#6586

Merged
bug-ops merged 1 commit into
mainfrom
fix/6580-serve-sanitizer-wiring
Jul 20, 2026
Merged

fix(serve): wire ContentSanitizer and ML classifier pipeline into zeph serve sessions#6586
bug-ops merged 1 commit into
mainfrom
fix/6580-serve-sanitizer-wiring

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • src/serve/agent_factory.rs built every /sessions* Agent (the zeph serve HTTP/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 though src/runner.rs, src/daemon.rs, and src/acp.rs all 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.
  • Mirrors src/acp.rs's spawn_acp_agent: snapshots the same sanitizer/classifier config and resolved providers into ServeAgentDeps during assemble_serve_deps, then wires 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, since it retroactively wraps every already-set provider field).
  • Widens 9 SharedAgentDeps fields in src/acp.rs to pub(crate) (visibility-only) and adds a parity regression test (acp::tests::build_combined_deps_wires_equivalent_security_pipeline_from_config) driving build_combined_deps against a non-default security config, asserting both ServeAgentDeps and SharedAgentDeps reflect the configured values.

Closes #6580
Closes #6582

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 14879 passed, 36 skipped, 0 failures
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • gitleaks protect --staged
  • CHANGELOG.md updated under [Unreleased]
  • .local/testing/playbooks/wire-x-acp-daemon-serve-6580-6582.md added with concrete scenarios
  • .local/testing/coverage-status.md row added (status: Untested — pending a live zeph serve-sessions verification pass in a future CI session)
  • Live-session verification against a running zeph serve-sessions (playbook scenarios) — tracked separately per project convention, not required to land this fix

@bug-ops
bug-ops enabled auto-merge (squash) July 20, 2026 14:45
@github-actions github-actions Bot added documentation Improvements or additions to documentation bug Something isn't working size/L Large PR (201-500 lines) labels Jul 20, 2026
…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
bug-ops force-pushed the fix/6580-serve-sanitizer-wiring branch from 3e0fb48 to c300891 Compare July 20, 2026 14:48
@bug-ops
bug-ops merged commit 27d192b into main Jul 20, 2026
79 of 81 checks passed
@bug-ops
bug-ops deleted the fix/6580-serve-sanitizer-wiring branch July 20, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/L Large PR (201-500 lines)

Projects

None yet

1 participant