Skip to content

strands.interventions.registry

Bridges InterventionHandler instances to the Strands hook system.

Registers one hook callback per lifecycle event type, dispatches to all handlers that override that method in registration order, with short-circuiting on Deny (and denied Confirms) and accumulation for Guide.

class InterventionRegistry()

Defined in: src/strands/interventions/registry.py:27

Bridges InterventionHandler instances and the Strands hook system.

Registers one hook callback per lifecycle event type, dispatches to all handlers that override that method in registration order.

def __init__(handlers: list[InterventionHandler],
hook_registry: HookRegistry) -> None

Defined in: src/strands/interventions/registry.py:34

Initialize the registry and wire handlers into the hook system.

Arguments:

  • handlers - Intervention handlers in evaluation order.
  • hook_registry - The agent’s hook registry to attach callbacks to.

Raises:

  • ValueError - If two handlers share the same name.
@property
def handlers() -> list[InterventionHandler]

Defined in: src/strands/interventions/registry.py:54

Registered handlers in registration order.