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
//! Security module for agent-diva
//!
//! Provides comprehensive security features including:
//! - Path validation and sanitization
//! - Rate limiting for file operations
//! - Security policy configuration
//! - Security error types
//!
//! # Example
//!
//! ```rust
//! use agent_diva_core::security::{SecurityPolicy, SecurityLevel};
//! use std::path::PathBuf;
//!
//! // Create a security policy with standard settings
//! let policy = SecurityPolicy::from_level(
//! PathBuf::from("/workspace"),
//! SecurityLevel::Standard,
//! );
//!
//! // Validate a path
//! assert!(policy.is_path_allowed("src/main.rs").is_ok());
//! assert!(policy.is_path_allowed("../etc/passwd").is_err());
//! ```
// Re-export commonly used types
pub use ;
pub use SecurityError;
pub use PathValidator;
pub use ;
pub use ActionTracker;