pub struct PrivacyConfig {
pub profile: PrivacyProfile,
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.
Combines a PrivacyProfile (tiered permission matrix) with fine-grained
overrides: command allowlists/blocklists, per-tool disabling, and output redaction.
Precedence: explicit disabled_tools overrides → profile matrix → allowlist/blocklist.
Fields§
§profile: PrivacyProfileThe active privacy profile tier.
command_allowlist: Option<HashSet<String>>If set, only these Tauri commands can be invoked (positive allowlist).
command_blocklist: HashSet<String>Tauri commands that are always blocked, even if on the allowlist.
disabled_tools: HashSet<String>MCP tool/action names explicitly disabled (override layer on top of profile).
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 Tauri command passes both the allowlist and blocklist.
Sourcepub fn is_tool_enabled(&self, tool_or_action: &str) -> bool
pub fn is_tool_enabled(&self, tool_or_action: &str) -> bool
Returns true if the given tool or qualified action (e.g. "window.manage")
is permitted by the current profile AND not in the explicit disabled set.
Sourcepub fn is_invoke_allowed(&self, command: &str) -> bool
pub fn is_invoke_allowed(&self, command: &str) -> bool
Check whether invoke_command is allowed for a specific command name.
In Test profile, invoke_command is only allowed if the command is on the
allowlist. In FullControl, it’s always allowed. In Observe, always blocked.
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.