BUG: CredentialLeakScorer misses OpenAI, Anthropic, and Hugging Face API keys
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Start with CredentialLeakScorer and the score_text_async reproduction in the issue. Check the existing credential patterns and how matches determine the score and rationale; verify the listed OpenAI, Anthropic, and Hugging Face key formats are covered. Done when the reproduction scores True and identifies the OpenAI API key; note that a linked pull request is already open.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
CredentialLeakScorer detects credential-shaped secrets in model responses (mapping to OWASP LLM06: Sensitive Information Disclosure). While it currently includes patterns for various third-party services (AWS, GitHub, Google, Slack, Shopify, Picatic, etc.), it lacks patterns for major AI platform credentials:
- OpenAI API keys (modern project keys
sk-proj-..., service account keyssk-svcacct-..., admin keyssk-admin-..., and legacysk-...) - Anthropic API keys (standard
sk-ant-api03-..., adminsk-ant-admin01-..., and OAuth tokens) - Hugging Face tokens (user access tokens and fine-grained tokens
hf_...)
In generative AI red teaming evaluations, extracting or coaxing an agent into leaking its own model credentials or downstream LLM access keys is a primary objective. Currently, responses leaking these keys score as False (false negatives).
Steps/Code to Reproduce
import asyncio
from pyrit.score import CredentialLeakScorer
async def main():
scorer = CredentialLeakScorer()
text = "Leaked key: sk-proj-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
score = (await scorer.score_text_async(text))[0]
print("Detected:", score.get_value())
asyncio.run(main())
Expected Results
score.get_value() should be True and score.score_rationale should identify OpenAI API Key.
Actual Results
score.get_value() returns False because no pattern matches modern OpenAI project keys.
- Vorherrschende Sprache
- Python
- Sterne
- 4.7k
- Forks
- 980
- Ø Merge
- 2 T. 9 Std.
- Gemergte PRs (30 T.)
- 433
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/PyRIT
-
BUG: Garak and ML-VLSU loaders still load one example when max_examples is 0 or negativeEvtl. vergeben @ShivamSharma43 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
BUG: ComicJailbreak max_examples counts goals that render nothing, so templates=["code"] with max_examples=10 failsEvtl. vergeben @ShivamSharma43 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 2 Tagen
-
BUG: SeedDatasetFilter matches harm_categories, modalities and size case-sensitively, unlike tagsEvtl. vergeben @ShivamSharma43 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Conversation drawer shows the previous attack's conversations after switching attacksEvtl. vergeben @ManoharPaturi hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/PyRIT#3575 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Conversation draft turns permanently dirty when applied conversions match no pieceEvtl. vergeben @ManoharPaturi hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
microsoft/PyRIT#3573 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in microsoft/PyRIT
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
suitenumerique/accounts#160 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Restoring an exhausted flatmap checkpoint can replay consumed recordsEvtl. vergeben @salma2vec hat das heute übernommen. Offentype:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
`ingest` fails with pynndescent 0.7Evtl. vergeben @eroell hat das heute übernommen. OffenTriage 🩺
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag