pub struct TrustPolicy {
pub open: String,
pub close: String,
pub screen: Option<Box<dyn InjectionScreen>>,
}Expand description
How untrusted content is fenced when assembling a prompt.
Fields§
§open: StringOpening/closing delimiters for the untrusted region.
close: String§screen: Option<Box<dyn InjectionScreen>>Optional screen applied to each untrusted span.
Implementations§
Source§impl TrustPolicy
impl TrustPolicy
pub fn with_screen(self, screen: Box<dyn InjectionScreen>) -> Self
Sourcepub fn assemble(&self, parts: &[TrustedContent]) -> AssembledPrompt
pub fn assemble(&self, parts: &[TrustedContent]) -> AssembledPrompt
Assemble content: trusted spans pass through verbatim; untrusted spans are fenced in a delimited, clearly-labelled region (so the model treats them as data, not instructions). Untrusted spans are run through the screen if configured.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TrustPolicy
impl !UnwindSafe for TrustPolicy
impl Freeze for TrustPolicy
impl Send for TrustPolicy
impl Sync for TrustPolicy
impl Unpin for TrustPolicy
impl UnsafeUnpin for TrustPolicy
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