Is Policy String • AI Agent SDK

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

is_policy_string

Function

</div>

This function is defined in the 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
def is_policy_string(value: str) -> bool

Parameters

ParamField str

String to check

Returns

ResponseField bool

True if string is a policy specification

Usage

python
>>> is_policy_string("policy:strict")
    True
    >>> is_policy_string("pii:redact")
    True
    >>> is_policy_string("strict")
    False

Used By

Source

View on GitHub

praisonaiagents/config/parse_utils.py at line 248