pyrit.executor.attack.AttackExecutorResult#

class AttackExecutorResult(completed_results: List[AttackResultT], incomplete_objectives: List[tuple[str, BaseException]])[source]#

Bases: Generic[AttackResultT]

Result container for attack execution, supporting both full and partial completion.

This class holds results from parallel attack execution. It is iterable and behaves like a list in the common case where all objectives complete successfully.

When some objectives don’t complete (throw exceptions), access incomplete_objectives to retrieve the failures, or use raise_if_incomplete() to raise the first exception.

Note: “completed” means the execution finished, not that the attack objective was achieved.

__init__(completed_results: List[AttackResultT], incomplete_objectives: List[tuple[str, BaseException]]) None#

Methods

__init__(completed_results, ...)

get_results()

Get completed results, raising if any incomplete.

raise_if_incomplete()

Raise the first exception if any objectives are incomplete.

Attributes

all_completed

Check if all objectives completed execution.

exceptions

Get all exceptions from incomplete objectives.

has_incomplete

Check if any objectives didn't complete execution.

completed_results

incomplete_objectives

property all_completed: bool#

Check if all objectives completed execution.

completed_results: List[AttackResultT]#
property exceptions: List[BaseException]#

Get all exceptions from incomplete objectives.

Returns:

List of exceptions that caused objectives to fail.

Return type:

List[BaseException]

get_results() List[AttackResultT][source]#

Get completed results, raising if any incomplete.

Returns:

All completed results.

Return type:

List[AttackResultT]

Raises:

BaseException – The first exception from incomplete objectives.

property has_incomplete: bool#

Check if any objectives didn’t complete execution.

incomplete_objectives: List[tuple[str, BaseException]]#
raise_if_incomplete() None[source]#

Raise the first exception if any objectives are incomplete.

Raises:

BaseException – The first exception from incomplete objectives.