> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Security Config • Rust AI Agent SDK

> SecurityConfig: Security configuration for MCP.

# SecurityConfig

> Defined in the [**MCP**](../modules/mcp) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

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&lt;String&gt;` | Allowed hosts for network access     |
| `allowed_paths` | `Vec&lt;String&gt;` | Allowed paths for file system access |

## Methods

### `permissive`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn permissive() -> Self
```

Create a permissive security config

### `restrictive`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn restrictive() -> Self
```

Create a restrictive security config

### `allow_fs`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn allow_fs(mut self, allow: bool) -> Self
```

Allow file system access

**Parameters:**

| Name    | Type   |
| ------- | ------ |
| `allow` | `bool` |

### `allow_network`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn allow_network(mut self, allow: bool) -> Self
```

Allow network access

**Parameters:**

| Name    | Type   |
| ------- | ------ |
| `allow` | `bool` |

### `allowed_host`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn allowed_host(mut self, host: impl Into<String>) -> Self
```

Add allowed host

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `host` | `impl Into&lt;String&gt;` |

### `allowed_path`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn allowed_path(mut self, path: impl Into<String>) -> Self
```

Add allowed path

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `path` | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/mcp/mod.rs#L132">
  `praisonai/src/mcp/mod.rs` at line 132
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Security" icon="lock" href="/docs/rust/security" />

  <Card title="Rust Sandbox" icon="box" href="/docs/rust/sandbox" />

  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />
</CardGroup>
