Skip to content

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 to REDACT_ALL. Choices are REDACT_PARTIAL, REDACT_ALL, and REDACT_HASH