Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#3,285 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@Kaap10 がすでに取り組んでいます。

2026年10月17日 から。

  • #3286 @Kaap10 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
security

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
4.6k
フォーク
962
平均マージ
2日 16時間
マージ済み PR(30日)
367

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。