> ## 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.

# Parse Policy String • Rust AI Agent SDK

> parse_policy_string: Parse a policy string into type and action. O(1) operation.

# parse\_policy\_string

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**parse\_utils**](../modules/parse_utils) module.

Parse a policy string into type and action. O(1) operation.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def parse_policy_string(value: &str) -> (&str, &str)
```

## Parameters

<ParamField query="value" type="&str" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="(&str, &str)">
  The result of the operation.
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::parity::parse_utils::parse_policy_string;

assert_eq!(parse_policy_string("policy:strict"), ("policy", "strict"));
assert_eq!(parse_policy_string("pii:redact"), ("pii", "redact"));
```

## Uses

* `split_once`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/parity/parse_utils.rs#L142">
  `praisonai/src/parity/parse_utils.rs` at line 142
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Policy" icon="file-shield" href="/docs/rust/policy" />

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