# is_env_truthy

> **Function** in `deepagents_code`

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

Return whether env var *name* is set to a recognizably truthy value.

Unlike `bool(os.environ.get(name))`, this does not treat `"0"` or
`"false"` as enabled. Use this for on/off flags where the user would
reasonably expect `VAR=0` to mean "disabled".

## Signature

```python
is_env_truthy(
    name: str,
    *,
    default: bool = False,
    environ: Mapping[str, str] | None = None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | `str` | Yes | Environment variable name (typically a `DEEPAGENTS_CODE_*` constant from this module). |
| `default` | `bool` | No | Value returned when the variable is unset OR set to a value that is neither recognizably truthy nor falsy. (default: `False`) |
| `environ` | `Mapping[str, str] \| None` | No | Environment to read, defaulting to the process environment. Pass a workspace snapshot to keep the read scoped. (default: `None`) |

## Returns

`bool`

`True` for `1`/`true`/`yes`/`on` (case-insensitive), `False` for

---

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