FEAT: Add supports_prefill capability and PrefillAttack strategy
Maintainer thường phản hồi trong vòng 2 ngày
Đá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
- 35/100
Hướng nghiên cứu
Start with TargetCapabilities and CapabilityName to see how existing flags are declared, then read SkeletonKeyAttack in pyrit/executor/attack/single_turn/ to see how a trailing assistant message is already used to prime a target. The open questions (one PR or two, which targets set the flag) need a maintainer decision before the work starts. Done means the flag exists and round-trips through serialization, and PrefillAttack raises on targets without PREFILL in TARGET_REQUIREMENTS.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
Some targets let the caller write the first part of the model's reply: the request ends with an open assistant turn, and the model continues it. Prefill attacks rely on this, and recent work shows they're effective against current open-weight models (arXiv:2602.14689 tested more than 20 strategies). PyRIT can't test for this properly:
TargetCapabilitiesdoesn't record whether a target continues a trailing assistant message. Completion endpoints and local Hugging Face models do. Most hosted chat APIs ignore it or reject the request. Without a flag, an attack that depends on prefill can't require it.- You can end a
prepended_conversationon an assistant message, the same waySkeletonKeyAttackprimes a target, but no attack is built around it. On a target that drops the assistant turn, the model just answers the user message, and the result looks like the model resisted the attack.
Describe the solution you'd like
- Capability. Add
CapabilityName.PREFILL = "supports_prefill"andsupports_prefill: bool = FalseonTargetCapabilities. Set it for targets that continue a trailing assistant turn (completion-style and locally hosted ones) and leave it false for hosted chat APIs. - Attack. Add
PrefillAttack(PromptSendingAttack)inpyrit/executor/attack/single_turn/, next toSkeletonKeyAttack. It takes the objective and aprefill_text, ends the conversation with an assistant message carrying that text, sends it, and scores the continuation.TARGET_REQUIREMENTSrequiresPREFILL, so an unsupported target raises an error up front.
Unit tests would cover the prefill being the final assistant piece, the error on an unsupported target, scoring, and the new field round-tripping through serialization. The PR would also add a doc entry.
Describe alternatives you've considered, if relevant
- Only the capability flag. Users would build the
prepended_conversationby hand each time, and nothing would check the target. - A converter. Converters change prompt text and can't add an assistant turn.
Additional context
Hosted APIs are dropping support for caller-set assistant turns, so this mostly matters for open-weight and completion-style targets. PyRIT tests those too.
- Struppek, Gleave, Pelrine (FAR.AI), arXiv:2602.14689: https://arxiv.org/abs/2602.14689
- Dotsinski, Eustratiadis, "Sockpuppetting", arXiv:2601.13359: https://arxiv.org/abs/2601.13359
Questions:
- Do you want a
supports_prefillcapability? - One PR, or the capability first and the attack second?
- Which targets should have the flag set, beyond the obvious ones?
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 944
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 369
Chuẩn bị môi trường
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackCó thể đã có người làm @u7k4rs6 đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/PyRIT#3095 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG Configuration keeps runtime-status errors after polling recoversCó thể làm lại được @joeyvictorino đã nhận 7 ngày trước và không có pull request nào đang mở. Đang mởBug: triage GUI help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
microsoft/PyRIT#2868 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targetsCó thể đã có người làm @PranavD2905 đã nhận hôm nay. Đang mởfeature-request help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/PyRIT#3274 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
feature-request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 34/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
lidofinance/diffyscan#239 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsĐang mởarea: tools documentation good first issue ready for a contributor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
eyalgolan/statecraft-israel#873 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GET rooms API returns 500 due to nonexistent Room.is_active attributeCó thể đã có người làm @Mars-60 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add cover art to song rowsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
nasa/harmony-autotester#341 ·