Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,285 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@Kaap10 ci sta già lavorando.

Dal 17/10/2026.

  • #3286 di @Kaap10 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
4.6k
Fork
962
Merge medio
2g 16h
PR unite (30g)
367

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.