# active_environment

> **Function** in `deepagents_code`

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

Return the construction-scoped environment or the live process environment.

## Signature

```python
active_environment() -> Mapping[str, str]
```

## Returns

`Mapping[str, str]`

Active immutable snapshot or `os.environ` outside construction.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/config.py#L497)