Skip to content

[SEC-1.4] ContextBuilder sanitizer integration #1199

@bug-ops

Description

@bug-ops

Part of #1195 — Phase 1

Integrate ContentSanitizer into ContextBuilder so all untrusted data is automatically sanitized before entering agent context.

Crates: zeph-core
Depends on: SEC-1.2, SEC-1.3

Tasks:

  • Add ContentSanitizer to ContextBuilder (initialized from config)
  • All tool results pass through sanitizer with appropriate ContentSource
  • Spotlighting delimiters injected around untrusted blocks in system prompt
  • tracing::debug! when injection patterns are flagged (structured: source, pattern, location)
  • Integration tests: mock tool returning injection payload, verify wrapping in context

Files: crates/zeph-core/src/context.rs, crates/zeph-core/src/agent.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    corezeph-core cratepriority/highHigh prioritysecuritySecurity-related issuesize/MMedium PR (51-200 lines)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions