{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "anthropics-sandbox-runtime--change-sandbox-rules-while-a-command-runs",
 "repo": "anthropics/sandbox-runtime",
 "repo_url": "https://github.com/anthropics/sandbox-runtime",
 "repo_slug": "anthropics-sandbox-runtime",
 "title": "Change network rules while a sandboxed command runs",
 "page_title": "How to change network rules while a sandboxed command runs with Sandbox Runtime",
 "summary": "Feed srt new configs through a control channel so an orchestrator can open or close domains mid-run.",
 "who": "An engineer building an agent harness that needs to grant or revoke network access during a long task.",
 "problem": "Restarting a sandboxed process every time an agent needs one more domain throws away its progress.",
 "outcome": "A running command whose network allowlist updates on the next connection, with no restart.",
 "steps": [
  "Start the command with a control descriptor: `srt --control-fd 3 -- npm test`, where fd 3 is the read end of a pipe your harness writes to",
  "Write one full JSON config per line in the same shape as the settings file; network and filesystem are both required",
  "Changes to allowedDomains, deniedDomains and related network lists apply on the next connection on every platform",
  "Keep filesystem rules in the settings file: they are fixed when the command starts and later lines do not change them",
  "Watch stderr: an invalid line is reported and dropped, and the previous config stays in force"
 ],
 "agent_prompt": "Wrap <long running command> with anthropics/sandbox-runtime using --control-fd from my harness. Start with no network access, then send a config line that allows <domain> when the task needs it and remove it afterwards. Log every config line srt accepted or rejected.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "Each line replaces the whole config rather than patching it, so a key you leave out goes back to its default.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node.js and npm to install the CLI",
  "macOS, Linux with bubblewrap, or Windows",
  "Optional: a settings file at ~/.srt-settings.json; without one srt uses built-in defaults"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/anthropics-sandbox-runtime/change-sandbox-rules-while-a-command-runs/",
 "md": "https://dedupedai.com/use-cases/anthropics-sandbox-runtime/change-sandbox-rules-while-a-command-runs/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/anthropics-sandbox-runtime--change-sandbox-rules-while-a-command-runs.json",
 "api_version": "v1"
}
