Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#3,285 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@Kaap10 đang làm issue này rồi.

Từ ngày 18/10/2026.

  • #3286 của @Kaap10 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
4.6k
Fork
962
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
390

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.