FEAT: Add supports_prefill capability and PrefillAttack strategy
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Python
- Stelle
- 4.6k
- Fork
- 944
- Merge medio
- 2g 18h
- PR unite (30g)
- 358
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackForse già presa @u7k4rs6 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
microsoft/PyRIT#3095 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
BUG Configuration keeps runtime-status errors after polling recoversForse già presa @joeyvictorino l’ha presa 6 giorni fa. ApertaBug: triage GUI help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
microsoft/PyRIT#2868 · 6 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targetsForse già presa @PranavD2905 l’ha presa oggi. Apertafeature-request help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/PyRIT#3274 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
feature-request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 34/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/PyRIT
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cellrishi-code/claude-skills-atlas#165 ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-webui/open-webui#32635 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Filters: ?field:ne=null matches NULL rows instead of non-NULL onesForse già presa @rshdhere l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Netflix/metaflow-service#504 ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
gke-labs/kube-agents#3394 ·
I maintainer di solito rispondono entro 1 giorno
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)Forse già presa @O1sumitkumar l’ha presa oggi. Apertabug good first issue help wanted python
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno