#[repr(u8)]pub enum ContentSource {
SystemPrompt = 0,
UserInput = 1,
AgentReasoning = 2,
ExternalContent = 3,
}Expand description
Trust level / origin of content injected into an agent’s context.
Variants are ordered from most-trusted (0) to least-trusted (3) using
#[repr(u8)], enabling ordering comparisons:
use brainwires_core::ContentSource;
assert!(ContentSource::SystemPrompt < ContentSource::ExternalContent);
assert!(ContentSource::SystemPrompt.can_override(ContentSource::UserInput));Variants§
SystemPrompt = 0
Highest trust — operator-defined instructions. Cannot be overridden.
UserInput = 1
High trust — content originating directly from the human turn.
AgentReasoning = 2
Medium trust — content produced by the agent itself during reasoning.
ExternalContent = 3
Lowest trust — content fetched from the web, external APIs, or any tool that retrieves data from outside the trusted principal hierarchy. Always sanitized before injection.
Implementations§
Source§impl ContentSource
impl ContentSource
Sourcepub fn requires_sanitization(self) -> bool
pub fn requires_sanitization(self) -> bool
Returns true for sources that must be sanitised before injection.
Sourcepub fn can_override(self, other: ContentSource) -> bool
pub fn can_override(self, other: ContentSource) -> bool
Returns true if this source is allowed to override other.
A higher-priority (lower numeric value) source can override a lower-priority one.
Trait Implementations§
Source§impl Clone for ContentSource
impl Clone for ContentSource
Source§fn clone(&self) -> ContentSource
fn clone(&self) -> ContentSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentSource
impl Debug for ContentSource
Source§impl<'de> Deserialize<'de> for ContentSource
impl<'de> Deserialize<'de> for ContentSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ContentSource
impl Display for ContentSource
Source§impl Ord for ContentSource
impl Ord for ContentSource
Source§fn cmp(&self, other: &ContentSource) -> Ordering
fn cmp(&self, other: &ContentSource) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ContentSource
impl PartialEq for ContentSource
Source§fn eq(&self, other: &ContentSource) -> bool
fn eq(&self, other: &ContentSource) -> bool
self and other values to be equal, and is used by ==.