Overview
OpenHands provides a secrets manager that allows you to securely store and manage sensitive information that can be accessed by the agent during runtime, such as API keys. These secrets are automatically exported as environment variables in the agentβs runtime environment.Accessing the Secrets Manager
Navigate to theSettings > Secrets page. Here, youβll see a list of all your existing custom secrets.
Adding a New Secret
- Click
Add a new secret. - Fill in the following fields:
- Name: A unique identifier for your secret (e.g.,
AWS_ACCESS_KEY). This will be the environment variable name. - Value: The sensitive information you want to store.
- Description (optional): A brief description of what the secret is used for, which is also provided to the agent.
- Name: A unique identifier for your secret (e.g.,
- Click
Add secretto save.
Editing a Secret
- Click the
Editbutton next to the secret you want to modify. - You can update the name and description of the secret.
For security reasons, you cannot view or edit the value of an existing secret. If you need to change the
value, delete the secret and create a new one.
Deleting a Secret
- Click the
Deletebutton next to the secret you want to remove. - Select
Confirmto delete the secret.
Using Secrets in the Agent
- All custom secrets are automatically exported as environment variables in the agentβs runtime environment.
- You can access them in your code using standard environment variable access methods. For example, if you create a
secret named
OPENAI_API_KEY, you can access it in your code asprocess.env.OPENAI_API_KEYin JavaScript oros.environ['OPENAI_API_KEY']in Python.

