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.
InterventionRegistry
Section titled “InterventionRegistry”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.
__init__
Section titled “__init__”def __init__(handlers: list[InterventionHandler], hook_registry: HookRegistry) -> NoneDefined 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.
handlers
Section titled “handlers”@propertydef handlers() -> list[InterventionHandler]Defined in: src/strands/interventions/registry.py:54
Registered handlers in registration order.