MCPcopy Index your code
hub / github.com/AI45Lab/Code / sanitize_text

Method sanitize_text

core/src/security/default.rs:216–227  ·  view source on GitHub ↗

Sanitize text by redacting sensitive data

(&self, text: &str)

Source from the content-addressed store, hash-verified

214
215 /// Sanitize text by redacting sensitive data
216 fn sanitize_text(&self, text: &str) -> String {
217 let mut result = text.to_string();
218
219 for pattern in &self.patterns {
220 result = pattern
221 .regex
222 .replace_all(&result, format!("[{}]", pattern.redaction_label))
223 .to_string();
224 }
225
226 result
227 }
228}
229
230impl Default for DefaultSecurityProvider {

Callers 1

sanitize_outputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected