Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

BUG: CredentialLeakScorer misses OpenAI, Anthropic, and Hugging Face API keys

Geschlossen
#3,285 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@Kaap10 arbeitet bereits daran.

Seit 18.10.2026.

  • #3286 von @Kaap10 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
security

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 keys sk-svcacct-..., admin keys sk-admin-..., and legacy sk-...)
  • Anthropic API keys (standard sk-ant-api03-..., admin sk-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

In Codespaces öffnen

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

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/PyRIT

Alle Issues in microsoft/PyRIT

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.