pub enum ContentSourceKind {
ToolResult,
WebScrape,
McpResponse,
A2aMessage,
MemoryRetrieval,
InstructionFile,
}Expand description
All known content source categories.
Used for spotlighting annotation and future per-source config overrides.
Each variant maps to a fixed ContentTrustLevel via default_trust_level.
§Examples
use zeph_sanitizer::{ContentSourceKind, ContentTrustLevel};
assert_eq!(
ContentSourceKind::ToolResult.default_trust_level(),
ContentTrustLevel::LocalUntrusted
);
assert_eq!(
ContentSourceKind::WebScrape.default_trust_level(),
ContentTrustLevel::ExternalUntrusted
);Variants§
ToolResult
Output from a locally-executed tool (shell, file I/O).
WebScrape
Content fetched from a remote URL by the web-scrape tool.
McpResponse
Response from an MCP (Model Context Protocol) server.
A2aMessage
Message received from another agent via the A2A protocol.
MemoryRetrieval
Content retrieved from Qdrant/SQLite semantic memory.
Memory poisoning is a documented attack vector: an adversary can plant injection payloads in web content that gets stored, then recalled in future sessions.
InstructionFile
Project-level instruction files (.zeph/zeph.md, CLAUDE.md, etc.).
Treated as LocalUntrusted by default. Path-based trust inference (e.g. treating
user-authored files as Trusted) is a Phase 2 concern.
Implementations§
Source§impl ContentSourceKind
impl ContentSourceKind
Sourcepub fn default_trust_level(self) -> ContentTrustLevel
pub fn default_trust_level(self) -> ContentTrustLevel
Returns the default ContentTrustLevel for this source kind.
Tool results and instruction files are LocalUntrusted; all network-sourced
content (web scrape, MCP, A2A, memory retrieval) is ExternalUntrusted.
§Examples
use zeph_sanitizer::{ContentSourceKind, ContentTrustLevel};
assert_eq!(ContentSourceKind::McpResponse.default_trust_level(), ContentTrustLevel::ExternalUntrusted);
assert_eq!(ContentSourceKind::InstructionFile.default_trust_level(), ContentTrustLevel::LocalUntrusted);Sourcepub fn from_str_opt(s: &str) -> Option<ContentSourceKind>
pub fn from_str_opt(s: &str) -> Option<ContentSourceKind>
Parse a &str into a ContentSourceKind.
Returns None for unrecognized strings so callers can log a warning and
skip unknown values without breaking deserialization.
The comparison is case-sensitive and uses the canonical snake_case form
(e.g. "web_scrape", not "WebScrape").
§Examples
use zeph_sanitizer::ContentSourceKind;
assert_eq!(ContentSourceKind::from_str_opt("web_scrape"), Some(ContentSourceKind::WebScrape));
assert_eq!(ContentSourceKind::from_str_opt("WebScrape"), None); // case-sensitive
assert_eq!(ContentSourceKind::from_str_opt("unknown"), None);Trait Implementations§
Source§impl Clone for ContentSourceKind
impl Clone for ContentSourceKind
Source§fn clone(&self) -> ContentSourceKind
fn clone(&self) -> ContentSourceKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentSourceKind
impl Debug for ContentSourceKind
Source§impl<'de> Deserialize<'de> for ContentSourceKind
impl<'de> Deserialize<'de> for ContentSourceKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentSourceKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentSourceKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Hash for ContentSourceKind
impl Hash for ContentSourceKind
Source§impl PartialEq for ContentSourceKind
impl PartialEq for ContentSourceKind
Source§impl Serialize for ContentSourceKind
impl Serialize for ContentSourceKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ContentSourceKind
impl Eq for ContentSourceKind
impl StructuralPartialEq for ContentSourceKind
Auto Trait Implementations§
impl Freeze for ContentSourceKind
impl RefUnwindSafe for ContentSourceKind
impl Send for ContentSourceKind
impl Sync for ContentSourceKind
impl Unpin for ContentSourceKind
impl UnsafeUnpin for ContentSourceKind
impl UnwindSafe for ContentSourceKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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>
T in a tonic::Request