pub struct PromptGuard { /* private fields */ }Expand description
Prompt injection guard with configurable sensitivity
Implementations§
Source§impl PromptGuard
impl PromptGuard
Sourcepub fn with_config(action: GuardAction, sensitivity: f64) -> Self
pub fn with_config(action: GuardAction, sensitivity: f64) -> Self
Create a guard with custom action and sensitivity
Sourcepub fn scan(&self, content: &str) -> GuardResult
pub fn scan(&self, content: &str) -> GuardResult
Scan a message for prompt injection patterns
Trait Implementations§
Source§impl Clone for PromptGuard
impl Clone for PromptGuard
Source§fn clone(&self) -> PromptGuard
fn clone(&self) -> PromptGuard
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 moreSource§impl Debug for PromptGuard
impl Debug for PromptGuard
Auto Trait Implementations§
impl Freeze for PromptGuard
impl RefUnwindSafe for PromptGuard
impl Send for PromptGuard
impl Sync for PromptGuard
impl Unpin for PromptGuard
impl UnsafeUnpin for PromptGuard
impl UnwindSafe for PromptGuard
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