BUG: CredentialLeakScorer misses OpenAI, Anthropic, and Hugging Face API keys
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 4.6k
- Forks
- 962
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 367
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackPosiblemente ocupada @u7k4rs6 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microsoft/PyRIT#3095 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
BUG: LeetspeakConverter ignores uppercase and multi-character custom_substitutions keys and fails on empty replacement listsPosiblemente ocupada @ShivamSharma43 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: InsertPunctuationConverter accepts multi-character and empty punctuation_list entriesPosiblemente ocupada @ShivamSharma43 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: ColloquialWordswapConverter identifier ignores custom substitution valuesPosiblemente ocupada @ShivamSharma43 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers ignore settings that change outputPosiblemente ocupada @ShivamSharma43 la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/PyRIT
Issues similares
-
bug Size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
oposs/repo-infra#93 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Graphify-Labs/graphify#4546 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
521xueweihan/HelloGitHub#4025 ·