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

auxiliary_scores_summary

Get a summary of auxiliary scores from the best node.

executed_turns

execution_time_ms

last_response

last_score

max_depth_reached

Get the maximum depth reached in the attack tree.

nodes_explored

Get the total number of nodes explored during the attack.

nodes_pruned

Get the number of nodes pruned during the attack.

outcome

outcome_reason

tree_visualization

Get the tree visualization from metadata.

conversation_id

objective

attack_identifier

related_conversations

metadata

attack_identifier: dict[str, str]#
property auxiliary_scores_summary: Dict[str, float]#

Get a summary of auxiliary scores from the best node.

conversation_id: str#
property max_depth_reached: int#

Get the maximum depth reached in the attack tree.

metadata: Dict[str, Any]#
property nodes_explored: int#

Get the total number of nodes explored during the attack.

property nodes_pruned: int#

Get the number of nodes pruned during the attack.

objective: str#
related_conversations: set[ConversationReference]#
property tree_visualization: Tree | None#

Get the tree visualization from metadata.