Skip to content

feat(security): source-specific sanitization boundaries (Phase 2, #1195)#1234

Merged
bug-ops merged 1 commit intomainfrom
feat/m32/content-isolation-boundaries
Mar 5, 2026
Merged

feat(security): source-specific sanitization boundaries (Phase 2, #1195)#1234
bug-ops merged 1 commit intomainfrom
feat/m32/content-isolation-boundaries

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 5, 2026

Summary

Phase 2 of Untrusted Content Isolation epic (#1195). Refines ContentSanitizer integration to differentiate trust levels at each untrusted data boundary.

Files changed (6 files, +299/-5):

  • crates/zeph-a2a/src/types.rsall_text_content() + 4 tests
  • crates/zeph-core/src/agent/context.rs — code RAG sanitization with metrics
  • crates/zeph-core/src/agent/tool_execution.rs — source kind differentiation + error sanitization + 7 tests
  • crates/zeph-core/src/sanitizer.rs#[derive(Clone)]
  • src/daemon.rs — A2A inbound sanitization in AgentTaskProcessor
  • src/tests.rs — fix sanitizer field in daemon test struct

Tests: 3795 passed (+13 from Phase 1 baseline of 3782)

Closes #1200, closes #1201, closes #1202, closes #1203

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --workspace -- -D warnings
  • cargo nextest run --workspace --lib --bins (3795 pass)
  • cargo check --features "daemon,a2a"
  • CI gate job (full matrix)

Refine ContentSanitizer integration to differentiate trust levels at
each untrusted data boundary:

- Tool results: MCP tools (`:` in name) -> McpResponse (ExternalUntrusted),
  web-scrape/fetch -> WebScrape (ExternalUntrusted), others -> ToolResult
  (LocalUntrusted)
- A2A inbound: sanitize external agent messages in AgentTaskProcessor
  before agent loop; add Message::all_text_content() for multi-part
  message support
- Code RAG: sanitize indexed code text before context injection with
  metrics tracking and injection flag logging
- Error paths: sanitize tool error messages before self_reflection
  context as ExternalUntrusted

Closes #1200, closes #1201, closes #1202, closes #1203
@github-actions github-actions bot added enhancement New feature or request size/L Large PR (201-500 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate and removed size/L Large PR (201-500 lines) labels Mar 5, 2026
@bug-ops bug-ops merged commit 61036b2 into main Mar 5, 2026
25 checks passed
@bug-ops bug-ops deleted the feat/m32/content-isolation-boundaries branch March 5, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes

Projects

None yet

1 participant