You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Use case:**Create a secret, proxy it into a devbox through agent gateway, verify the devbox only gets gateway credentials, and clean up.
173
+
**Use case:**Use a normal secret for sensitive app data in the devbox and agent gateway for upstream API credentials that should never be exposed to the agent.
Copy file name to clipboardExpand all lines: examples/secrets_with_devbox.py
+57-20Lines changed: 57 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,22 @@
1
1
#!/usr/bin/env -S uv run python
2
2
"""
3
3
---
4
-
title: Secrets with Devbox via Agent Gateway
4
+
title: Secrets with Devbox and Agent Gateway
5
5
slug: secrets-with-devbox
6
-
use_case: Create a secret, proxy it into a devbox through agent gateway, verify the devbox only gets gateway credentials, and clean up.
6
+
use_case: Use a normal secret for sensitive app data in the devbox and agent gateway for upstream API credentials that should never be exposed to the agent.
7
7
workflow:
8
-
- Create a secret with a test credential
8
+
- Create a secret for application data that should be available inside the devbox
9
+
- Create a separate secret for an upstream API credential
9
10
- Create an agent gateway config for an upstream API
10
-
- Launch a devbox with the gateway wired to the secret
11
-
- Verify the devbox receives a gateway URL and token instead of the raw secret
12
-
- Shutdown the devbox and delete the gateway config and secret
11
+
- Launch a devbox with one secret injected directly and the credential wired through agent gateway
12
+
- Verify the devbox can read MAGIC_NUMBER while the upstream API credential is replaced with gateway values
13
+
- Shutdown the devbox and delete the gateway config and both secrets
13
14
tags:
14
15
- secrets
15
16
- devbox
16
17
- agent-gateway
17
18
- credentials
19
+
- environment-variables
18
20
- cleanup
19
21
prerequisites:
20
22
- RUNLOOP_API_KEY
@@ -33,34 +35,56 @@
33
35
# Note: do NOT hardcode secret values in your code!
34
36
# This is example code only; use environment variables instead!
- [Devbox snapshot and resume example](examples/devbox_snapshot_resume.py): Snapshot disk, resume from snapshot, verify state isolation
15
15
- [MCP GitHub example](examples/mcp_github_tools.py): MCP Hub integration with Claude Code
16
-
- [Secrets with Devbox example](examples/secrets_with_devbox.py): Create secret, protect it with agent gateway config, verify gateway credentials in devbox, cleanup
16
+
- [Secrets with Devbox example](examples/secrets_with_devbox.py): Inject a normal secret for app runtime use, protect upstream credentials with agent gateway, verify both behaviors, cleanup
0 commit comments