> ## 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 Weak Secret • AI Agent SDK

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

# is\_weak\_secret

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**protocols**](../modules/protocols) module.

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

Comparison is whitespace-stripped and case-insensitive.

## Signature

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

## Parameters

<ParamField query="value" type="Optional[str]" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  The result of the operation.
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
>>> is_weak_secret("change-me")
    True
    >>> is_weak_secret("$(openssl rand -hex 16)")
    True
    >>> is_weak_secret("strong-non-placeholder-token")
    False
```

## Used By

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2044">
  `praisonaiagents/gateway/protocols.py` at line 2044
</Card>
