pyrit.executor.attack.TAPAttackResult#
- class TAPAttackResult(conversation_id: str, objective: str, attack_identifier: dict[str, str], last_response: Optional[PromptRequestPiece] = None, last_score: Optional[Score] = None, executed_turns: int = 0, execution_time_ms: int = 0, outcome: AttackOutcome = AttackOutcome.UNDETERMINED, outcome_reason: Optional[str] = None, related_conversations: set[ConversationReference] = <factory>, metadata: Dict[str, Any] = <factory>)[source]#
Bases:
AttackResult
Result of the Tree of Attacks with Pruning (TAP) attack strategy execution.
This result includes the standard attack result information with attack-specific data stored in the metadata dictionary.
- __init__(conversation_id: str, objective: str, attack_identifier: dict[str, str], last_response: Optional[PromptRequestPiece] = None, last_score: Optional[Score] = None, executed_turns: int = 0, execution_time_ms: int = 0, outcome: AttackOutcome = AttackOutcome.UNDETERMINED, outcome_reason: Optional[str] = None, related_conversations: set[ConversationReference] = <factory>, metadata: Dict[str, Any] = <factory>) None #
Methods
__init__
(conversation_id, objective, ...[, ...])duplicate
()Create a deep copy of the result.
get_conversations_by_type
(conversation_type)Return all related conversations of the requested type.
Attributes
Get a summary of auxiliary scores from the best node.
executed_turns
execution_time_ms
last_response
last_score
Get the maximum depth reached in the attack tree.
Get the total number of nodes explored during the attack.
Get the number of nodes pruned during the attack.
outcome
outcome_reason
Get the tree visualization from metadata.
- property auxiliary_scores_summary: Dict[str, float]#
Get a summary of auxiliary scores from the best node.