pub struct SanitizedContent {
pub body: String,
pub source: ContentSource,
pub injection_flags: Vec<InjectionFlag>,
pub was_truncated: bool,
}Expand description
Result of the sanitization pipeline for a single piece of content.
The body field is the processed text ready to insert into the agent’s message history.
Callers should inspect injection_flags for threat intelligence and was_truncated to
decide whether to emit a “content was truncated” notice to the user.
§Examples
use zeph_sanitizer::{ContentSanitizer, ContentSource, ContentSourceKind};
use zeph_config::ContentIsolationConfig;
let sanitizer = ContentSanitizer::new(&ContentIsolationConfig::default());
let result = sanitizer.sanitize(
"normal tool output",
ContentSource::new(ContentSourceKind::ToolResult),
);
assert!(!result.was_truncated);
assert!(result.injection_flags.is_empty());
assert!(result.body.contains("normal tool output"));Fields§
§body: StringThe processed, possibly spotlighted body ready to insert into message history.
source: ContentSourceProvenance metadata for this content.
injection_flags: Vec<InjectionFlag>Injection patterns matched during detection (advisory — content is never removed).
was_truncated: booltrue when content was truncated to max_content_size.
Trait Implementations§
Source§impl Clone for SanitizedContent
impl Clone for SanitizedContent
Source§fn clone(&self) -> SanitizedContent
fn clone(&self) -> SanitizedContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SanitizedContent
impl RefUnwindSafe for SanitizedContent
impl Send for SanitizedContent
impl Sync for SanitizedContent
impl Unpin for SanitizedContent
impl UnsafeUnpin for SanitizedContent
impl UnwindSafe for SanitizedContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request