Parse Policy String • AI Agent SDK

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

parse_policy_string

Function

</div>

This function is defined in the parse_utils module.

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

Signature

python
def parse_policy_string(value: str) -> tuple

Parameters

ParamField str

Policy string (e.g., “policy:strict”, “pii:redact”)

Returns

ResponseField tuple

Tuple of (policy_type, action)

Usage

python
>>> parse_policy_string("policy:strict")
    ('policy', 'strict')
    >>> parse_policy_string("pii:redact")
    ('pii', 'redact')

Source

View on GitHub

praisonaiagents/config/parse_utils.py at line 290