FEAT: Add supports_prefill capability and PrefillAttack strategy
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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?
- Langage dominant
- Python
- Étoiles
- 4.6k
- Forks
- 944
- Merge moyen
- 2 j 18 h
- PR mergées (30 j)
- 369
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackPeut-être pris @u7k4rs6 l’a pris il y a 3 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
microsoft/PyRIT#3095 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
BUG Configuration keeps runtime-status errors after polling recoversPeut-être à nouveau libre @joeyvictorino l’a pris il y a 7 jours, et aucune pull request n’est ouverte. OuverteBug: triage GUI help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
microsoft/PyRIT#2868 · 6 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targetsPeut-être pris @PranavD2905 l’a pris aujourd’hui. Ouvertefeature-request help wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
microsoft/PyRIT#3274 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
feature-request
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 18/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 34/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de microsoft/PyRIT
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Graphify-Labs/graphify#4524 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
topoteretes/cognee#5982 ·
Les mainteneurs répondent en général sous 1 jour
-
Patches of derivations with `__structuredAttrs` are ignoredPeut-être pris @KiaraGrouwstra l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 81/100
nix-community/vulnix#184 ·
-
New InternshipOuvertenew_internship
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
aws-samples/sample-per-model-bedrock#295 ·
Les mainteneurs répondent en général sous 1 jour