Security Config • Rust AI Agent SDK
SecurityConfig: Security configuration for MCP.
SecurityConfig
Defined in the MCP module.
Rust AI Agent SDK
Security configuration for MCP.
Fields
| Name | Type | Description |
|---|---|---|
allow_fs | bool | Allow file system access |
allow_network | bool | Allow network access |
allow_env | bool | Allow environment variable access |
allowed_hosts | Vec<String> | Allowed hosts for network access |
allowed_paths | Vec<String> | Allowed paths for file system access |
Methods
permissive
fn permissive() -> SelfCreate a permissive security config
restrictive
fn restrictive() -> SelfCreate a restrictive security config
allow_fs
fn allow_fs(mut self, allow: bool) -> SelfAllow file system access
Parameters:
| Name | Type |
|---|---|
allow | bool |
allow_network
fn allow_network(mut self, allow: bool) -> SelfAllow network access
Parameters:
| Name | Type |
|---|---|
allow | bool |
allowed_host
fn allowed_host(mut self, host: impl Into<String>) -> SelfAdd allowed host
Parameters:
| Name | Type |
|---|---|
host | impl Into<String> |
allowed_path
fn allowed_path(mut self, path: impl Into<String>) -> SelfAdd allowed path
Parameters:
| Name | Type |
|---|---|
path | impl Into<String> |
Source
View on GitHubpraisonai/src/mcp/mod.rs at line 132