Commit 2f5fe02
Add bbox run-image ephemeral one-shot command (#207)
* Add bbox run-image ephemeral one-shot command
Implements #205: `bbox run-image IMAGE [flags] -- CMD` boots an
arbitrary OCI image once, without editing config or registering an
agent. Builds an in-memory agent.Agent from flags via the existing
config.AgentFromOverride path (#200) and runs it through the normal
SandboxRunner — no config-file mutation, no registry persistence.
Ephemeral defaults (safer-than-custom): credential persistence off,
settings import off, env forwarding empty, MCP off, git token / SSH
agent forwarding off. Egress defaults to permissive with a stderr
disclosure so the bare example boots; tighten with
--egress-profile/--allow-host. --mcp forces mcp.mode=env and
inherits the safe-tools custom-agent authz default.
Reuses run() by extracting a shared runSandbox(...) tail. The
in-memory agent is registered data-only (nil Plugin) so
isCustomAgent/applyCustomAgentAuthzDefault apply the safe-tools
default. Name derives from the image repo basename when --name is
unset.
docs/run-image.md documents the minimum image contract (shell at
/bin/sh, command on PATH, CA bundle, sandbox user UID 1000) and
the ephemeral defaults.
* Fix run-image egress allow-host and MCP flag UX
Fold --allow-host into the run-image agent override so the
ValidateCustomAgent gate sees hosts for a non-permissive egress
profile. Previously --allow-host flowed only into RunOpts.AllowHosts
(applied at VM start), so the load-time validation rejected
--egress-profile standard/locked unless --mcp was also set, breaking
the documented example. Hosts are parsed via egress.ParseHostFlag and
filed under override.EgressHosts[profile]; runFlags.allowHosts is
cleared to avoid filing them twice.
Warn when MCP sub-flags (--mcp-authz-profile, --mcp-group, --mcp-port,
--mcp-config, --mcp-session-ttl) are set without --mcp, which is off by
default for run-image. They were silently dropped, misleading the
operator into thinking they tightened tool access.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Jakub Hrozek <jakub@stacklok.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 9b35a13 commit 2f5fe02
5 files changed
Lines changed: 1850 additions & 110 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
157 | 167 | | |
158 | 168 | | |
159 | 169 | | |
| |||
300 | 310 | | |
301 | 311 | | |
302 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
303 | 326 | | |
304 | 327 | | |
305 | 328 | | |
| |||
0 commit comments