Skip to content

Commit 7a59b52

Browse files
mdelapenyadvdksn
andauthored
docs: clarify persisted env vars reach the agent process (#25816)
## Summary - Clarifies that variables set in `/etc/sandbox-persistent.sh` are visible to the agent process itself (not just an interactive shell), including API keys. - Notes that a variable only takes effect for sessions/agents started after it's added — a running agent needs a restart to pick it up. ## Why Prompted by confusion in docker/sbx-releases#252, where users assumed variables set this way wouldn't reach `sbx run` agent sessions, or weren't sure how a new value propagates to an already-running agent. ## Test plan - [ ] Docs site build/preview renders the FAQ section correctly --------- Signed-off-by: Manuel de la Peña <manuel.delapena@docker.com> Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent c8c1ada commit 7a59b52

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

  • content/manuals/ai/sandboxes

content/manuals/ai/sandboxes/faq.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,16 @@ sandbox instead of on your host.
112112
> the sandbox. The agent process can read it directly. Only use this for
113113
> credentials where proxy-based injection isn't available.
114114
115-
Variables in `/etc/sandbox-persistent.sh` are sourced automatically when
116-
bash runs inside the sandbox, including interactive sessions and agents
117-
started with `sbx run`. If you run a command directly with
118-
`sbx exec <name> <command>`, the command runs without a shell, so the
119-
persistent environment file is not sourced. Wrap the command in `bash -c`
120-
to load the environment:
115+
Variables in `/etc/sandbox-persistent.sh` are sourced automatically for
116+
interactive sessions and for agents started with `sbx run`.
117+
118+
A variable only takes effect for sessions and agents started *after* it's
119+
added. If an agent is already running when you append to the file, restart
120+
it (or stop and start the sandbox) to pick up the new value.
121+
122+
Running commands directly with `sbx exec <name> <command>` does not invoke
123+
a shell, so the persistent environment file is not sourced. Wrap the
124+
command in `bash -c` to load the environment:
121125

122126
```console
123127
$ sbx exec <sandbox-name> bash -c "your-command"

0 commit comments

Comments
 (0)