#[non_exhaustive]pub enum ResponseDecision {
Accept,
Block(String),
RetryWithFeedback(String),
}Expand description
Decision returned by AgentHooks::on_llm_response — an output guardrail
that runs after the provider responds but before the response is persisted
and surfaced.
This is the place for output moderation or secret-leakage detection.
Forward-compat is fail-open: the agent loop matches this enum with a
wildcard arm that treats unknown variants as Accept, so a restrictive
variant added here in a future release is silently ignored by loops built
against older SDKs. Never add a variant whose ignored meaning weakens a
security decision — extend Block/RetryWithFeedback semantics instead,
or plan a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Accept
Accept the response as-is.
Block(String)
Reject the response; the string explains why.
RetryWithFeedback(String)
Reject the response and feed the string back to the model so it can retry on the next turn.
Trait Implementations§
Source§impl Clone for ResponseDecision
impl Clone for ResponseDecision
Source§fn clone(&self) -> ResponseDecision
fn clone(&self) -> ResponseDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more