pub struct DefaultGuardConfig {Show 15 fields
pub reasoning_only_max_strikes: usize,
pub reasoning_only_nudge: String,
pub reasoning_only_action: ReasoningOnlyAction,
pub disable_thinking_nudge: String,
pub empty_response_max_strikes: usize,
pub empty_response_nudge: String,
pub use_llm_judge: bool,
pub judge_timeout_secs: u64,
pub judge_skip_threshold: usize,
pub judge_fail_open: bool,
pub detect_short_response: bool,
pub short_response_min_input: usize,
pub short_response_max_output: usize,
pub short_response_nudge: String,
pub recent_user_count: usize,
}Expand description
Guard policies from agent-works (tool gating, reasoning-only enforcement). Default guard configuration
Fields§
§reasoning_only_max_strikes: usizeMaximum retries for reasoning-only responses
reasoning_only_nudge: StringNudge message for reasoning-only responses
reasoning_only_action: ReasoningOnlyActionReasoning-only handling strategy
disable_thinking_nudge: StringNudge message when disabling thinking
empty_response_max_strikes: usizeMaximum retries for empty responses
empty_response_nudge: StringNudge message for empty responses
use_llm_judge: boolWhether to use LLM judge for text-only after tools
judge_timeout_secs: u64Timeout in seconds for the LLM judge call
judge_skip_threshold: usizeSkip judge if response is longer than this (likely complete)
judge_fail_open: boolWhether to trust LLM when judge fails or times out.
- true: fail-open (trust the model, end loop)
- false: fail-closed (don’t trust, force continue)
detect_short_response: boolEnable short-response detection (merged from CompletionGateMiddleware). When the user input is long but the model response is very short, treat it as potentially incomplete and nudge/judge accordingly.
short_response_min_input: usizeMinimum user input character count to trigger short-response detection.
short_response_max_output: usizeMaximum LLM output character count to be considered a short response.
short_response_nudge: StringNudge message for short responses
recent_user_count: usizeNumber of recent user messages to include in the judge prompt. Helps the judge understand context like “继续” after a multi-turn discussion.