> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blocks.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

Environment variables are created and managed in the [dashboard](https://blocks.team/signup). They are injected into an agent's environment at runtime.

## Accessing Environment Variables

Environment variables are accessed in the same way as normal Python scripts. Typically, this is with the `os` module.

<CodeGroup>
  ```python agent.py theme={null}
  import os

  @agent(name="my-agent")
  def entrypoint(event):
      OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
  ```
</CodeGroup>

## Secrets

Secrets are encrypted in storage and during transport. You can create a secret by enabling the secret toggle when creating an environment variable in the dashboard.

## Required Environment Variables

Automation authors can specify `required_env_vars` keys in an agent's [agent decorator](/decorators/agent).
