# classify_env_bool

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_env_vars/classify_env_bool)

Classify a raw env-var string as a truthy, falsy, or unrecognized token.

The single source of truth for which strings count as boolean on/off
values; `is_env_truthy` and the config resolver both build on it so they
agree on what "recognizably boolean" means.

## Signature

```python
classify_env_bool(
    raw: str,
) -> bool | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `raw` | `str` | Yes | The raw (unstripped) environment-variable value. |

## Returns

`bool | None`

`True` for `1`/`true`/`yes`/`on`, `False` for `0`/`false`/`no`/`off`/
empty string (case-insensitive), or `None` when the value
is neither.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2f56309d821db4a0d06ee03959cf842c91b7f228/libs/code/deepagents_code/_env_vars.py#L311)