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
def is_weak_secret(value: Optional[str]) -> boolParameters
ParamField
Optional[str]No description available.
Returns
ResponseField
boolThe result of the operation.
Usage
>>> is_weak_secret("change-me")
True
>>> is_weak_secret("$(openssl rand -hex 16)")
True
>>> is_weak_secret("strong-non-placeholder-token")
FalseUsed By
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 2949