litellm/enterprise/litellm_enterprise/enterprise_callbacks/secrets_plugins
yucheng-berri a0058ed157
fix(hide-secrets): stop redacting benign identifiers (#39879)
* fix(hide-secrets): stop redacting benign identifiers and make redaction deterministic

The OpenAI key detector matched `sk-` anywhere inside a word, so `<task-notification>`
became `<ta[REDACTED]>`, and the Base64 entropy limit of 3.0 flagged ordinary quoted
identifiers such as `"application/json"` and model ids. Redaction also iterated a
hash-seeded set, so the same request produced different bytes on different workers and
broke prompt caching.

- require a standalone `sk-`/`sk_` token with a digit (still catches sk-proj-/sk-ant-)
- raise Base64HighEntropyString limit from 3.0 to the detect-secrets default 4.5
- redact overlapping matches longest-first in a stable order

Resolves LIT-7049

* fix(hide-secrets): treat separators as key boundaries and defer sk_live_ to the stripe detector

The standalone-token boundary also rejected keys glued to a preceding `_`, `-`
or percent-encoded delimiter (`openai_sk-…`, `key-sk-…`, `Bearer%20sk-…`), which
the old pattern redacted, and `sk_live_…` was counted by both the OpenAI and the
Stripe detector.

* fix(hide-secrets): keep the openai key scan linear on repeated sk separators

The digit requirement was a lookahead, so every `sk` inside a long
`[a-zA-Z0-9_-]` run re-scanned the rest of that run looking for a digit.
100 KB of `-sk-` took over 5s in the worker's event loop and the proxy
closed the connection without a response. The check now runs once per
match in `analyze_string` instead.

* chore(hide-secrets): remove redundant performance test comment

* fix(hide-secrets): consume complete openai key tokens

* chore(hide-secrets): remove redundant fixture comment

* chore(hide-secrets): remove redundant test docstrings

* fix(hide-secrets): redact whole stripe live keys

* style(hide-secrets): wrap secret sorting key
2026-09-05 11:47:36 -07:00
..
__init__.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
adafruit.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
adobe.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
age_secret_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
airtable_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
algolia_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
alibaba.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
asana.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
atlassian_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
authress_access_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
beamer_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
bitbucket.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
bittrex.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
clojars_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
codecov_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
coinbase_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
confluent.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
contentful_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
databricks_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
datadog_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
defined_networking_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
digitalocean.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
discord.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
doppler_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
droneci_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
dropbox.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
duffel_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
dynatrace_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
easypost.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
etsy_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
facebook_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
fastly_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
finicity.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
finnhub_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
flickr_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
flutterwave.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
frameio_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
freshbooks_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
gcp_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
github_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
gitlab.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
gitter_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
gocardless_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
grafana.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
hashicorp_tf_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
heroku_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
hubspot_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
huggingface.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
intercom_api_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
jfrog.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
jwt.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
kraken_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
kucoin.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
launchdarkly_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
linear.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
linkedin.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
lob.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
mailgun.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
mapbox_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
mattermost_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
messagebird.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
microsoft_teams_webhook.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
netlify_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
new_relic.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
nytimes_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
okta_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
openai_api_key.py fix(hide-secrets): stop redacting benign identifiers (#39879) 2026-09-05 11:47:36 -07:00
planetscale.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
postman_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
prefect_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
pulumi_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
pypi_upload_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
rapidapi_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
readme_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
rubygems_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
scalingo_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
sendbird.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
sendgrid_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
sendinblue_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
sentry_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
shippo_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
shopify.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
slack.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
snyk_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
squarespace_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
sumologic.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
telegram_bot_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
travisci_access_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
twitch_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
twitter.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
typeform_api_token.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
vault.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
yandex.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00
zendesk_secret_key.py [Refactor] Move LLM Guard, Secret Detection to Enterprise Pip packagea (#10782) 2025-05-13 09:42:22 -07:00