Package akka.javasdk.agent
Interface Guardrail
- All Known Subinterfaces:
AgentResponseGuardrail,ModelCallGuardrail,TextGuardrail,ToolCallGuardrail
- All Known Implementing Classes:
ModelCallSimilarityGuard,SimilarityGuard
public sealed interface Guardrail
permits TextGuardrail, ToolCallGuardrail, ModelCallGuardrail, AgentResponseGuardrail
Guardrails can protect against harmful inputs and outputs to/from model and tool calls.
A Guardrail needs to implement exactly one of ToolCallGuardrail, ModelCallGuardrail or AgentResponseGuardrail, which extend this interface, and have a
public constructor optionally taking a GuardrailContext parameter (the guardrail's
configured name and config section).
Guardrails are enabled for agents with configuration, see agent documentation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classThrown whenreport-onlyis false and a guardrail denies the call or fails.static interfaceA message in the conversation a guardrail inspects, carrying its origin: what the user said, what the model replied (and which tools it requested), and what a tool returned.static final recordDeprecated, for removal: This API element is subject to removal in a future version.
DecisionfromToolCallGuardrail,ModelCallGuardrailorAgentResponseGuardrail.