1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Content filtering and safety guardrails.
//!
//! Guards inspect user input, LLM output, and tool calls, blocking or modifying
//! unsafe content. Two guard types are supported:
//!
//! - **Rule-based** (`RuleGuard`, `RuleGuardBuilder`) — Pattern matching, length limits, regex
//! - **LLM-based** (`LlmGuard`) — AI-powered content classification
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use echo_agent::prelude::*;
//!
//! # fn main() -> echo_agent::error::Result<()> {
//! let guard = RuleGuardBuilder::new("safety")
//! .max_input_length(10000)
//! .build();
//! let agent = ReactAgentBuilder::new()
//! .model("qwen3-max")
//! .with_guard(Box::new(guard))
//! .build()?;
//! # Ok(())
//! # }
//! ```
//!
//! # Key Types
//!
//! | Type | Description |
//! |------|-------------|
//! | [`Guard`] | Trait — implement to create custom guards |
//! | [`GuardManager`] | Runs multiple guards in sequence, short-circuits on block |
//! | [`GuardResult`] | `Pass` / `Block { reason }` / `Warn { message }` |
//! | [`GuardDirection`] | `Input` / `Output` / `ToolInput` / `ToolOutput` |
/// Direct re-exports from `echo_core::guard`.
pub use *;