Skip to content

v0.2.0

Latest

Choose a tag to compare

@cr-sbarbouche cr-sbarbouche released this 29 Nov 19:10
· 2 commits to main since this release
15cb3de
  • Network rules change while a sandbox runs: sb.allow(*entries), sb.deny(*entries), sb.egress_rules() and sb.egress_denied(). A !entry in egress= shuts a host out and wins over every allow; its port defaults to every port. allow() un-denies an entry, deny() replaces it with !entry. The proxy reloads on a signal: new connections follow the new rules at once, and tunnels already open to a host that is no longer allowed are closed. egress_denied() lists what the proxy refused as host:port, leaving out what is allowed by now (it reads the proxy's log). From a shell: agvisor allow NAME host..., agvisor deny NAME host..., agvisor egress NAME [--denied]. The MCP server gets a read-only egress_blocked tool (with AGVISOR_EGRESS or AGVISOR_INJECT); the agent has no way to change the rules. create_sandbox(egress=...) now waits until the proxy listens before it starts the sandbox
  • sb.pause() and sb.resume() (agvisor pause / resume, AsyncSandbox too) freeze every process; memory stays held, it is a freeze and not a checkpoint. exec() on a paused sandbox raises SandboxPaused. idle_ttl does not run out during a pause (the watchdog notices the freeze); lifetime keeps counting, so a sandbox paused past it is gone when resumed. stop() removes a paused sandbox, and agvisor ls shows paused
  • renewable=True with lifetime=: sb.renew(seconds) (agvisor renew NAME SECONDS) moves the deadline later or earlier. It is opt-in, because the deadline is a file inside the sandbox: code running there can extend its own life. A plain lifetime is unchanged
  • create_sandbox(mounts={"/host/path": "/inside"}) shows a host directory or file read-only, without copying it (--mount, so a missing source is an error). Refused: /, anything under /proc, /sys or /dev, sources under /run or /var/run, and *.sock. agvisor run --mount HOSTPATH:REMOTE, and AGVISOR_MOUNTS for the MCP server
  • create_sandbox(env=), exec(env=, cwd=) and spawn(env=, cwd=). Values reach docker through stdin or a file only you can read, never a command line. agvisor exec --env NAME[=VALUE] --cwd, agvisor run --env, and AGVISOR_ENV for the MCP server
  • sb.python(code, context="name"): a separate interpreter per name, with its own variables. The MCP python tool takes context too
  • MCP AGVISOR_LOG=/path/audit.jsonl: one JSON line for every tool call (arguments, sandbox, seconds, exit code, and the result or the exception), one server_start with the configuration (no secret values: the names of the AGVISOR_ENV variables and the hosts of AGVISOR_INJECT) and one sandbox_created per sandbox. Readable by its owner only, append-only, never rotated. It records the agent's tool calls, not what the code does inside
  • examples/10_agent_cli.py: Claude Code's CLI inside a sandbox behind egress= and inject=. examples/11_eval_harness.py: one sandbox per trial from a Pool, with snapshot() and restore() to retry from a clean workspace
  • The docs site has a What's new page with diagrams
  • Tested on real gVisor (runsc 20261026.0, GitHub's Ubuntu runner): tests/test_gvisor_env.py, test_gvisor_pause.py (the freeze, idle_ttl and lifetime across a pause), test_gvisor_renew.py, test_gvisor_pycontexts.py, test_gvisor_mounts.py (writes refused, host edits visible inside), test_gvisor_egress_live.py (pip refused, then allowed on the running sandbox; an open tunnel closed 0.5 s after deny()), test_mcp_stdio.py (the audit log written by a real server), and both new examples. Not tested: any of this over host="ssh://...", and example 10 with a real API key (with its placeholder key the API refuses the request, as it should)