Is Weak Secret • AI Agent SDK

is_weak_secret: Return True if “value“ is empty or a known-weak/placeholder secret.

is_weak_secret

Function

</div>

This function is defined in the protocols module.

Return True if `value` is empty or a known-weak/placeholder secret.

Comparison is whitespace-stripped and case-insensitive.

Signature

python
def is_weak_secret(value: Optional[str]) -> bool

Parameters

ParamField Optional[str]

No description available.

Returns

ResponseField bool

The result of the operation.

Usage

python
>>> is_weak_secret("change-me")
    True
    >>> is_weak_secret("$(openssl rand -hex 16)")
    True
    >>> is_weak_secret("strong-non-placeholder-token")
    False

Used By

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 2949