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

PromptShieldTarget drops prompt text after each </document> tag

オープン 初心者向け
#2,837 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

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

調査の方向性

まず PromptShieldTarget._input_parser を見つけ、クラスの docstring の例とそのループを比較します。提供された入力で問題を再現し、その後、各 タグの後のテキストとドキュメント間のテキストが userPrompt に残り、ドキュメントの内容が引き続き収集されることを確認します。利用可能であれば、関連する PromptShieldTarget のテストを再実行してください。

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

説明

what happens

PromptShieldTarget._input_parser drops every piece of text that comes after a closing </document> tag. the loop keeps only the segment before each closing tag as the document and never appends contents[1], so trailing prompt text and text between documents is silently excluded from the userPrompt sent to Azure Prompt Shield.

for prefix question <document> doc1 </document> trailing question <document> doc2 </document> end text, the parsed userPrompt is just prefix question and the jailbreak scan never sees trailing question or end text.

repro

input_str = 'q1 <document> d1 </document> q2 <document> d2 </document> q3'
user_prompt = ""
documents = []
for element in input_str.split("<document>"):
    contents = element.split("</document>")
    if len(contents) == 1:
        user_prompt += contents[0]
    else:
        documents.append(contents[0])
print(repr(user_prompt))  # 'q1 ' — q2 and q3 are gone

expected

text after each closing tag flows into the userPrompt, matching how the example in the class docstring reads.

env: main 5503ecb

主要言語
Python
スター
4.5k
フォーク
896
平均マージ
3日 1時間
マージ済み PR(30日)
208

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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