strands.vended_interventions.hitl.classifier
Built-in LLM risk classifier for the HumanInTheLoop handler.
Uses an inner agent with structured output to evaluate whether a tool call requires human approval based on risk criteria.
ClassifierResult
Section titled “ClassifierResult”@dataclassclass ClassifierResult()Defined in: src/strands/vended_interventions/hitl/classifier.py:21
Result from a classifier evaluation.
HumanInTheLoopClassifier
Section titled “HumanInTheLoopClassifier”@runtime_checkableclass HumanInTheLoopClassifier(Protocol)Defined in: src/strands/vended_interventions/hitl/classifier.py:29
Callable (sync or async) that decides whether a tool call requires human approval.
__call__
Section titled “__call__”def __call__(event: BeforeToolCallEvent, **kwargs: Any) -> ClassifierResult | Awaitable[ClassifierResult]Defined in: src/strands/vended_interventions/hitl/classifier.py:32
Evaluate whether a tool call requires human approval.
Arguments:
event- The tool call event under evaluation.**kwargs- Additional keyword arguments for future extensibility.
Returns:
ClassifierResult indicating whether approval is required.
LLMClassifierConfig
Section titled “LLMClassifierConfig”@dataclassclass LLMClassifierConfig()Defined in: src/strands/vended_interventions/hitl/classifier.py:46
Configuration for the built-in LLM risk classifier.
Arguments:
system_prompt- Risk criteria prompt. Defaults to a general-purpose risk prompt.model- Model for risk evaluation. Defaults to the parent agent’s model.