Environment variables are created and managed in the dashboard. 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.
import os

@agent(name="my-agent")
def entrypoint(event):
    OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

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.