Skip to content

TAPAttack attack execution error #1312

@3leg0ocat

Description

@3leg0ocat
from pyrit.executor.attack import AttackExecutor

AttackExecutor().execute_multi_turn_attacks_async(TAPAttack())

The code above will throw an error when run:
Attack strategy TreeOfAttacksWithPruningAttack must use MultiTurnAttackContext or a subclass of it.

# Validate that the attack uses MultiTurnAttackContext
if hasattr(attack, "_context_type") and not issubclass(attack._context_type, MultiTurnAttackContext):
    raise TypeError(
        f"Attack strategy {attack.__class__.__name__} must use MultiTurnAttackContext or a subclass of it."
    )

I'd like to know if this design intentionally excludes TAP? Could the type checking be relaxed to allow TAPAttackContext as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions