Skip to content

Commit 5134a7d

Browse files
Add secrets manager documentation to GUI mode docs (OpenHands#9084)
Co-authored-by: openhands <[email protected]>
1 parent a162791 commit 5134a7d

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/usage/how-to/gui-mode.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can use the Settings page at any time to:
2727
- [Configure MCP servers](/usage/mcp).
2828
- [Connect to GitHub](/usage/how-to/gui-mode#github-setup) and [connect to GitLab](/usage/how-to/gui-mode#gitlab-setup)
2929
- Set application settings like your preferred language, notifications and other preferences.
30-
- Generate custom secrets.
30+
- [Manage custom secrets](/usage/how-to/gui-mode#secrets-management).
3131

3232
#### GitHub Setup
3333

@@ -122,6 +122,36 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
122122
</Accordion>
123123
</AccordionGroup>
124124

125+
#### Secrets Management
126+
127+
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.
128+
129+
1. **Accessing the Secrets Manager**:
130+
- In the Settings page, navigate to the `Secrets` tab.
131+
- You'll see a list of all your existing custom secrets (if any).
132+
133+
2. **Adding a New Secret**:
134+
- Click the `Add New Secret` button.
135+
- Fill in the following fields:
136+
- **Name**: A unique identifier for your secret (e.g., `AWS_ACCESS_KEY`). This will be the environment variable name.
137+
- **Value**: The sensitive information you want to store.
138+
- **Description** (optional): A brief description of what the secret is used for, which is also provided to the agent.
139+
- Click `Add Secret` to save.
140+
141+
3. **Editing a Secret**:
142+
- Click the `Edit` button next to the secret you want to modify.
143+
- You can update the name and description of the secret.
144+
- Note: 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.
145+
146+
4. **Deleting a Secret**:
147+
- Click the `Delete` button next to the secret you want to remove.
148+
- Confirm the deletion when prompted.
149+
150+
5. **Using Secrets in the Agent**:
151+
- All custom secrets are automatically exported as environment variables in the agent's runtime environment.
152+
- You can access them in your code using standard environment variable access methods (e.g., `os.environ['SECRET_NAME']` in Python).
153+
- Example: If you create a secret named `OPENAI_API_KEY`, you can access it in your code as `process.env.OPENAI_API_KEY` in JavaScript or `os.environ['OPENAI_API_KEY']` in Python.
154+
125155
#### Advanced Settings
126156

127157
The `Advanced` settings allows configuration of additional LLM settings. Inside the Settings page, under the `LLM` tab,

0 commit comments

Comments
 (0)