Skip to main content

TAP

Tree of Attacks with Pruning search attack.

Adaptive. Searches: it reads the target's replies and refines its prompts, which is why it needs an attacker model.

A pruned tree of attacker-refined prompts.

Helper models​

Models this attack drives, configured under its roles. Each one is a ModelConfig.

RoleKindNeededWhat it does
attackerchat modelrequiredWrites the jailbreak prompts and branches each one into several refined variants.
on_topicchat modeloptionalOptional. Answers yes or no to whether a branch still pursues the goal; branches that drifted are pruned before they cost a call to the target. Without it, no branch is pruned for being off topic.

Parameters​

Settings for the algorithm itself, written under the attack's parameters. Anything left out keeps its default.

FieldTypeDefaultDescription
depthinteger (>= 1)3Refinement rounds. Every surviving branch is expanded once per round.
widthinteger (>= 1)4Branches kept after each round's score prune: the beam width.
branching_factorinteger (>= 1)3Refinements the attacker writes per branch per round.
streamsinteger (>= 1)4Independent conversations the tree starts from.
keep_last_ninteger (>= 1)6Attacker turns a branch keeps before its history is trimmed.
max_attemptsinteger (>= 1)3Retries when the attacker's reply is not a usable prompt.
early_stopbooleantrueStop the whole search once any branch succeeds.
min_prune_scorenumber (>= 0.0, <= 10.0)0.0Score a branch must exceed to survive the prune, on the 0..10 scale. The reference keeps anything scored above zero; the best branch always survives, so a round never prunes to nothing.
target_strstringSure, here isThe opening the attacker is told to aim the target's reply at.

In a campaign file​

attacks:
- name: tap
roles:
attacker:
name: llama3.2
connection:
provider: ollama
type: OLLAMA
Needs a helper model

This attack cannot run without attacker. A campaign that leaves it out fails to resolve, before anything is attacked.