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

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

rust
fn permissive() -> Self

Create a permissive security config

restrictive

rust
fn restrictive() -> Self

Create a restrictive security config

allow_fs

rust
fn allow_fs(mut self, allow: bool) -> Self

Allow file system access

Parameters:

NameType
allowbool

allow_network

rust
fn allow_network(mut self, allow: bool) -> Self

Allow network access

Parameters:

NameType
allowbool

allowed_host

rust
fn allowed_host(mut self, host: impl Into<String>) -> Self

Add allowed host

Parameters:

NameType
hostimpl Into&lt;String&gt;

allowed_path

rust
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


Related Documentation