vtcode_core/config/core/
security.rs

1use serde::{Deserialize, Serialize};
2
3/// Security configuration
4#[derive(Debug, Clone, Deserialize, Serialize)]
5pub struct SecurityConfig {
6    /// Require human confirmation for critical actions
7    #[serde(default = "default_true")]
8    pub human_in_the_loop: bool,
9
10    /// Require a successful write tool before accepting claims like
11    /// "I've updated the file" as applied. When true, such claims are
12    /// treated as proposals unless a write tool executed successfully.
13    #[serde(default = "default_true")]
14    pub require_write_tool_for_claims: bool,
15
16    /// Automatically apply detected patch blocks in assistant replies
17    /// when no write tool was executed. Defaults to false for safety.
18    #[serde(default)]
19    pub auto_apply_detected_patches: bool,
20}
21
22impl Default for SecurityConfig {
23    fn default() -> Self {
24        Self {
25            human_in_the_loop: default_true(),
26            require_write_tool_for_claims: default_true(),
27            auto_apply_detected_patches: false,
28        }
29    }
30}
31
32fn default_true() -> bool {
33    true
34}