pyrit.executor.attack.TAPAttackResult#
- class TAPAttackResult(conversation_id: str, objective: str, attack_identifier: dict[str, str], last_response: ~pyrit.models.message_piece.MessagePiece | None = None, last_score: ~pyrit.models.score.Score | None = None, executed_turns: int = 0, execution_time_ms: int = 0, outcome: ~pyrit.models.attack_result.AttackOutcome = AttackOutcome.UNDETERMINED, outcome_reason: str | None = None, related_conversations: set[~pyrit.models.conversation_reference.ConversationReference] = <factory>, metadata: ~typing.Dict[str, ~typing.Any] = <factory>)[source]#
Bases:
AttackResultResult 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: ~pyrit.models.message_piece.MessagePiece | None = None, last_score: ~pyrit.models.score.Score | None = None, executed_turns: int = 0, execution_time_ms: int = 0, outcome: ~pyrit.models.attack_result.AttackOutcome = AttackOutcome.UNDETERMINED, outcome_reason: str | None = None, related_conversations: set[~pyrit.models.conversation_reference.ConversationReference] = <factory>, metadata: ~typing.Dict[str, ~typing.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.
Get the adversarial conversation ID for the best-scoring branch.
executed_turnsexecution_time_mslast_responselast_scoreGet 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.
outcomeoutcome_reasonGet the tree visualization from metadata.
- property auxiliary_scores_summary: Dict[str, float]#
Get a summary of auxiliary scores from the best node.
- property best_adversarial_conversation_id: str | None#
Get the adversarial conversation ID for the best-scoring branch.