pub struct PrivacyConfig {
pub command_allowlist: Option<HashSet<String>>,
pub command_blocklist: HashSet<String>,
pub disabled_tools: HashSet<String>,
pub redactor: Redactor,
pub redaction_enabled: bool,
}Expand description
Privacy controls for the MCP server. Blocklist takes precedence over allowlist.
Fields§
§command_allowlist: Option<HashSet<String>>If set, only these commands can be invoked (positive allowlist).
command_blocklist: HashSet<String>Commands that are always blocked, even if on the allowlist.
disabled_tools: HashSet<String>MCP tool names that are disabled (e.g., "eval_js", "screenshot").
redactor: RedactorOutput redactor with regex and JSON-key matching.
redaction_enabled: boolWhether output redaction is active.
Implementations§
Source§impl PrivacyConfig
impl PrivacyConfig
Sourcepub fn is_command_allowed(&self, command: &str) -> bool
pub fn is_command_allowed(&self, command: &str) -> bool
Returns true if the command passes both the allowlist and blocklist checks.
Sourcepub fn is_tool_enabled(&self, tool_name: &str) -> bool
pub fn is_tool_enabled(&self, tool_name: &str) -> bool
Returns true unless the tool is in disabled_tools.
Sourcepub fn redact_output(&self, output: &str) -> String
pub fn redact_output(&self, output: &str) -> String
Apply redaction rules to the output string if redaction is enabled, otherwise pass through.
Trait Implementations§
Source§impl Default for PrivacyConfig
impl Default for PrivacyConfig
Source§fn default() -> PrivacyConfig
fn default() -> PrivacyConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrivacyConfig
impl RefUnwindSafe for PrivacyConfig
impl Send for PrivacyConfig
impl Sync for PrivacyConfig
impl Unpin for PrivacyConfig
impl UnsafeUnpin for PrivacyConfig
impl UnwindSafe for PrivacyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more