Skip to main content

SecurityConfig

Defined in the MCP module.
Rust AI Agent SDK Security configuration for MCP.

Fields

NameTypeDescription
allow_fsboolAllow file system access
allow_networkboolAllow network access
allow_envboolAllow environment variable access
allowed_hostsVec<String>Allowed hosts for network access
allowed_pathsVec<String>Allowed paths for file system access

Methods

permissive

fn permissive() -> Self
Create a permissive security config

restrictive

fn restrictive() -> Self
Create a restrictive security config

allow_fs

fn allow_fs(mut self, allow: bool) -> Self
Allow file system access Parameters:
NameType
allowbool

allow_network

fn allow_network(mut self, allow: bool) -> Self
Allow network access Parameters:
NameType
allowbool

allowed_host

fn allowed_host(mut self, host: impl Into<String>) -> Self
Add allowed host Parameters:
NameType
hostimpl Into&lt;String&gt;

allowed_path

fn allowed_path(mut self, path: impl Into<String>) -> Self
Add allowed path Parameters:
NameType
pathimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/mcp/mod.rs at line 132