pub struct PromptGuardConfig {
pub block_threshold: InjectionSeverity,
pub block_score_threshold: f64,
pub warn_score_threshold: f64,
pub max_input_length: usize,
pub detect_homoglyphs: bool,
pub detect_html_injection: bool,
pub detect_role_confusion: bool,
pub detect_base64: bool,
pub max_control_char_ratio: f64,
}Expand description
Configuration for the prompt guard.
Fields§
§block_threshold: InjectionSeverityMinimum severity level that triggers a block (inclusive).
block_score_threshold: f64Threat score threshold for blocking (0.0 - 1.0).
warn_score_threshold: f64Threat score threshold for warnings (0.0 - 1.0).
max_input_length: usizeMaximum input length before flagging as suspicious.
detect_homoglyphs: boolWhether to detect unicode homoglyphs.
detect_html_injection: boolWhether to detect HTML/script injection.
detect_role_confusion: boolWhether to detect role confusion.
detect_base64: boolWhether to detect base64 encoded content.
max_control_char_ratio: f64Maximum control character ratio before flagging.
Trait Implementations§
Source§impl Clone for PromptGuardConfig
impl Clone for PromptGuardConfig
Source§fn clone(&self) -> PromptGuardConfig
fn clone(&self) -> PromptGuardConfig
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 PromptGuardConfig
impl Debug for PromptGuardConfig
Auto Trait Implementations§
impl Freeze for PromptGuardConfig
impl RefUnwindSafe for PromptGuardConfig
impl Send for PromptGuardConfig
impl Sync for PromptGuardConfig
impl Unpin for PromptGuardConfig
impl UnsafeUnpin for PromptGuardConfig
impl UnwindSafe for PromptGuardConfig
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