#[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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more