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 completed results, raising if any incomplete.
Raise the first exception if any objectives are incomplete.
Attributes
Check if all objectives completed execution.
Get all exceptions from incomplete objectives.
Check if any objectives didn't complete execution.
- 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.
- 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.