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

# Is Policy String • AI Agent SDK

> is_policy_string: Check if a string is a policy specification. O(1) operation.

# is\_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.

Check if a string is a policy specification. O(1) operation.

Policy strings have format: type:action (e.g., "policy:strict", "pii:redact")

## Signature

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

## Parameters

<ParamField query="value" type="str" required={true}>
  String to check
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if string is a policy specification
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
>>> is_policy_string("policy:strict")
    True
    >>> is_policy_string("pii:redact")
    True
    >>> is_policy_string("strict")
    False
```

## Used By

* [`resolve_guardrail_policies`](../functions/resolve_guardrail_policies)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/config/parse_utils.py#L259">
  `praisonaiagents/config/parse_utils.py` at line 259
</Card>
