Repository navigation
FEAT: Add prefill technique with native assistant continuation - #3283
Dev3 ^~^ (shashank03-dev) wants to merge 9 commits into
Conversation
|
This is a great implementation of the prefill attack. Requiring supports_prefill natively in TargetRequirements is the right design decision because attempting to adapt or fall back on targets that drop trailing assistant messages would disguise a target limitation as an attack refusal. Scoping request converters strictly to the prepended user objective preserves the exact prompt tokens intended for continuation, and tagging the prefill as a simulated assistant role keeps memory history truthful. The HuggingFaceChatTarget chat template continuation tests cover the mechanics nicely. |
|
Manohar Paturi (@ManoharPaturi) Thank you :) |
|
Dev3 ^~^ (@shashank03-dev) Sorry, I missed an architectural point in my earlier reviews, especially after asking you to make fixes around the new attack class. I should have caught this before approving. On a closer look, I think prefill should be an attack technique built on The capability and target changes are still useful. The part I'd like to change is how we package the behavior. Prefill does not introduce a new conversation algorithm: it prepares a user objective followed by an assistant prefix, then uses the same sending, scoring, retry, and result-handling flow we already have. That is a better fit for the technique/executor split in Here is the direction I suggest:
There is also still an audio-history regression to address in the shared validation change. With I realize this changes the direction after the earlier feedback, and I'm sorry for the extra work. The goal is to keep the useful prefill support while avoiding another attack subclass for behavior that can share our existing execution scaffolding. If there is a constraint in the technique path that I have missed, please point it out so we can address that shared gap explicitly. |
|
Roman Lutz (@romanlutz) Thanks for the detailed guidance. Agreed — I’ll move prefill into a |
|
Roman Lutz (@romanlutz) I’ve addressed your feedback and updated the PR. Could you pls review it when you get a chance? Thanks! |
Fixes #3270
Adds an opt-in
prefillattack technique built onPromptSendingAttack. The technique prepares the converted user objective followed by an exact assistant prefix and reuses shared sending, scoring, response conversion, retry isolation, and persistence. The unreleased dedicatedPrefillAttackAPI is removed.extrawith nativePREFILL,MULTI_TURN, andEDITABLE_HISTORYrequirements and objective-only dataset inputs.simulated_assistantin memory, preserves distinct evaluation hashes, and retains Hugging Face continuation support. Completion targets remain unsupported.main.Validation: 30,302 unit tests pass (12 skipped); 106 discovery/prefill boundary tests and 102 catalog tests pass; changed production-line coverage is 100%; Python typing, frontend TypeScript checking, documentation validation, and pre-commit checks pass. The updated prefill example executed against cached Qwen2.5-0.5B-Instruct using
model_pathin place ofmodel_idbecause this environment has no Hugging Face token.GitHub Actions currently reports
action_requiredfor the six PR workflows, with no jobs started. Remote CI results remain pending workflow approval.