Secrets
Secrets Detector dedacts and redacts secrets from prompt inputs.
Configuration
Initialize the Secrets Detector with the desired options:
from pegasi.shield.input_detectors import Secrets
pegasi = Shield()
input_detectors = [Secrets(redact_mode="REDACT_PARTIAL")]
sanitized_prompt, valid_results, risk_score = pegasi.scan_input(prompt, input_detectors)
Here's what the option is for:
redact_mode
(str): Mode for redaction. Defaults toREDACT_ALL
. Choices areREDACT_PARTIAL
,REDACT_ALL
, andREDACT_HASH