Skip to main content

scrub_secret_patterns

Function scrub_secret_patterns 

pub fn scrub_secret_patterns(input: &str) -> String
Expand description

Scrub known secret-like token prefixes from model_provider error strings. Redacts tokens with prefixes like sk-, xoxb-, xoxp-, ghp_, gho_, ghu_, github_pat_, and Google/Gemini AIza keys. Complete query strings are removed from embedded HTTP(S) URLs because query parameters may carry credentials under provider-specific names.