pub struct RedactionFilter { /* private fields */ }Expand description
Filters secrets from events, transcripts, logs, and model context. §5: “Secrets never enter transcripts, logs, or model context unless explicitly a tool argument.”
Implementations§
Source§impl RedactionFilter
impl RedactionFilter
pub fn new() -> Self
Sourcepub fn load_secrets(&mut self, secrets: Vec<String>)
pub fn load_secrets(&mut self, secrets: Vec<String>)
Load secrets from the auth store
Sourcepub fn redact_str(&self, text: &str) -> String
pub fn redact_str(&self, text: &str) -> String
Redact a string, replacing all known secrets with the replacement
Sourcepub fn redact_event(&self, event: &Event) -> Event
pub fn redact_event(&self, event: &Event) -> Event
Redact an Event, returning a new Event with secrets removed
Sourcepub fn contains_secret(&self, text: &str) -> bool
pub fn contains_secret(&self, text: &str) -> bool
Check if a string contains any secrets
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedactionFilter
impl RefUnwindSafe for RedactionFilter
impl Send for RedactionFilter
impl Sync for RedactionFilter
impl Unpin for RedactionFilter
impl UnsafeUnpin for RedactionFilter
impl UnwindSafe for RedactionFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more