Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

BUG TAP/PAIR skip their first turn after a prepended conversation (no adversarial system prompt, next_message ignored)

Open
#2,821 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ai, security

Research direction

Start by tracing TAP and PAIR through _TreeOfAttacksNode._is_first_turn(), then inspect the mock-target scenario described in the issue. Done means a prepended conversation does not suppress the first turn: the adversarial system prompt is set, next_message is used, and the scorer can receive the initial prompt instead of both attacks reporting FAILURE.

Written by the indexing model from the issue text.

Description

If you pass a prepended_conversation to TAP or PAIR, the first turn never happens properly.

_TreeOfAttacksNode._is_first_turn() checks whether the objective conversation in memory is empty, but the prepended messages are written into that same conversation. So after any prepend it's never the first turn, which means:

  • set_adversarial_system_prompt never runs, so the adversarial chat has no system prompt at all, and the prepended context is never used
  • next_message is silently ignored
  • with a system-only prepend, the subsequent-turn path raises "Cannot proceed without an assistant response", every node gets pruned, and the attack reports FAILURE without sending anything

With mock targets, a scorer that would succeed right away, and just a system message prepended:

TreeOfAttacksWithPruningAttack: FAILURE | prompts sent to target: [] | adversarial system prompts set: 0
PAIRAttack:                     FAILURE | prompts sent to target: [] | adversarial system prompts set: 0

Fix: don't count the prepended messages when deciding whether it's the first turn.

Dominant language
Python
Stars
4.5k
Forks
896
Avg merge
3d 8h
Merged PRs (30d)
191

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.

More from microsoft/PyRIT

All issues in microsoft/PyRIT

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.