Skip to main content

Overview

Secrets Detection is a Bifrost Enterprise guardrail provider that scans LLM request and response text for leaked credentials, API keys, access tokens, private keys, and other secret-shaped values. It runs entirely inside Bifrost. You do not need to configure an external moderation service, credentials, or provider account.
Secrets Detection is for credential leakage. For personal data such as email addresses, phone numbers, SSNs, credit-card-like numbers, and IP addresses, use the Custom Regex PII Detection template.

How It Works

Bifrost uses the embedded default rules from Gitleaks v8.30.1 for the secrets guardrail provider. At runtime:
  1. You create a guardrail provider with provider_name: "secrets".
  2. You attach that provider to one or more guardrail rules.
  3. The rule decides when to run the provider and whether to scan input, output, or both.
  4. Secrets Detection scans text blocks in the selected request/response phase.
  5. If a secret is found, Bifrost applies the configured action: detect only, block, or redact.
Secrets Detection currently evaluates text content. It does not inspect image pixels or binary file contents. By default, Secrets Detection uses action: "block" for backward compatibility. Set action: "redact" when you want Bifrost to rewrite detected secrets instead of returning a guardrail intervention.

Redaction

Secrets Detection supports all Bifrost-managed redaction modes:
  • runtime redacts the live request or response and stores the redacted value in logs.
  • logs_only leaves runtime content raw but redacts Bifrost logs and trace-export connector content.
  • runtime_reversible redacts runtime content and logs with reversible placeholders.
Use logs_only when you want the model call to proceed with the original text but do not want raw secrets stored in Bifrost logs or exported traces. Use runtime_reversible when runtime content should also be placeholderized. For the full behavior matrix, including reveal permissions and connector export behavior, see Guardrail Redaction.

Configuration Fields

Streaming output: When this profile is used in an output or both rule, Bifrost accumulates the stream until the model response is complete, then checks the full response. It does not check individual stream chunks. See Streaming Output Guardrails for details.

Supported Secret Types

The built-in rule set contains 222 Gitleaks default rules in this build. The coverage is broad, but the useful way to think about it is by credential family:

Configuration

  1. Go to Guardrails > Providers.
  2. Select Secrets Detection.
  3. Click Add Configuration.
  4. Set a descriptive Name, for example block-leaked-credentials.
  5. Optionally add a False-positive allowlist.
  6. Enable the configuration and save it.
  7. Attach the configuration to a guardrail rule under Guardrails > Configuration.
Secrets Detection guardrail configuration with a false-positive allowlist

False-Positive Allowlist

The ignored_secret_keywords setting is a list of substrings that should suppress known false positives. Bifrost normalizes these values by trimming whitespace, lowercasing them, deduplicating them, and sorting them before loading the Gitleaks detector. A finding is skipped when the detected secret value contains one of those substrings. Use this for stable test fixtures or placeholder values such as example, dummy, or a known internal sample-token prefix. Keep it narrow. A broad allowlist entry can hide real leaked credentials.

Operational Notes

  • Secrets Detection has no external network dependency.
  • It uses the default Gitleaks rule set embedded in the Enterprise build.
  • Its default action is block; set action: "detect_only" or action: "redact" to change enforcement behavior.
  • Use guardrail rule apply_to to control whether prompts, responses, or both are scanned.
  • Use rule-level sampling_rate if you want to evaluate only a percentage of traffic.
  • Use Custom Regex for organization-specific patterns or PII templates that are not credential-focused.