microsoft / microsoft/PyRIT

Add a `code_attack` technique variant that applies the code-completion system prompt

Open
#2,088 5 comments 0 reactions 1 assignee View on GitHub

@u7k4rs6 is already working on this.

Since Sep 17, 2026.

Dominant language
Python
Stars
4.5k
Forks
893
Avg merge
3d 50m
Merged PRs (30d)
165

Description

Follow-up from #1960, which added `CodeAttackConverter` and registered `code_attack` as a converter-only technique in `scenario_techniques.py`. The converter wraps the objective in a code-completion template, the core mechanism from Ren et al. (CodeAttack, Findings of ACL 2024, arXiv:2403.07865).

Gap: the paper also frames the session with a code-completion system prompt. The converter-only technique drops that framing. Per discussion on #1960 this was non-blocking and deferred (rlundeen2: "we can add techniques that also do the system prompt/framing").

Proposal: a variant technique that also applies the framing system prompt, ideally via a generic way to attach an objective-target system prompt to a technique rather than a bespoke attack class. On targets without system-prompt support it would lean on `GenericSystemSquashNormalizer` and the capability-handling ADAPT path to fold the framing into the user turn.

The framing seed (`pyrit/datasets/executors/code_attack.yaml`, removed in #1960) can be restored from git history.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.