Repository navigation
FEAT: Add prefill technique with native assistant continuation - #3283
Dev3 ^~^ (shashank03-dev) wants to merge 13 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! |
Roman Lutz (romanlutz)
left a comment
There was a problem hiding this comment.
The technique-based rewrite addresses the architectural feedback, but two regressions remain in the shared code.
|
Roman Lutz (@romanlutz) Fixed both: LiteLLM now allows the audio history its adapter omits, and |
|
Dev3 ^~^ (@shashank03-dev) One more correction to my earlier guidance, sorry. I tried assistant-ending requests against live OpenAI Chat Completions ( Please adjust the capability policy in this PR:
This supersedes the part of my earlier comment that treated hosted chat APIs as unsupported by default. The request-level policy should be consistent across these adapters rather than tied to whether a particular probe gets the answer we hoped for. |
|
Roman Lutz (@romanlutz) Updated the prefill request-support policy as requested, added provider-boundary coverage, and updated both docs. Also resolved the merge conflicts with current main. 31,921 tests pass locally. Could you pls review and approve the CI runs when you get a chance? Thanks! |
Fixes #3270
Adds an opt-in
prefilltechnique built onPromptSendingAttack. The adapter sends the converted user objective followed by an exact assistant prefix; scoring independently determines attack success.main.Tests: 31,921 passed, 23 skipped; 96.23% overall coverage; 100% changed-line coverage. Python typing, pre-commit, and documentation checks pass. Fake SDK/HTTP tests verify exact objective/prefix order on all four hosted chat adapters, independently of the returned answer.
CI: Fork workflows require maintainer approval before they can run.