{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "anthropics-sandbox-runtime--block-agent-commands-from-ssh-keys-and-internet",
 "repo": "anthropics/sandbox-runtime",
 "repo_url": "https://github.com/anthropics/sandbox-runtime",
 "repo_slug": "anthropics-sandbox-runtime",
 "title": "Keep agent shell commands away from your SSH keys",
 "page_title": "How to keep agent shell commands away from your SSH keys with Sandbox Runtime",
 "summary": "Run bash commands through srt so they get no network by default and cannot read the files you deny.",
 "who": "Someone letting an agent run shell commands who wants a hard stop on reading ~/.ssh or sending data out.",
 "problem": "Without file and network isolation, one bad command can read SSH keys and send them anywhere.",
 "outcome": "Commands that work in the project folder but fail on denied files and on any domain you did not allow.",
 "steps": [
  "Install with `npm install -g @anthropic-ai/sandbox-runtime`",
  "Try it: `srt \"curl example.com\"` is blocked by the network allowlist, while reads in the current directory work",
  "Add the hosts a task really needs to network.allowedDomains in ~/.srt-settings.json, since network access is denied by default",
  "Deny sensitive files with denyRead, for example a pattern for .env files, and allow writes only where needed",
  "Run a real task with a specific config: `srt --settings /path/to/srt-settings.json npm install`"
 ],
 "agent_prompt": "Using anthropics/sandbox-runtime, write an srt settings file for <project> that allows network only to <domains>, denies reads of ~/.ssh and **/.env, and allows writes only to the project folder. Run <command> under it with `srt --settings` and report anything that was blocked.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Beginner",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "Reads are allowed everywhere by default and writes are denied, so you must add denyRead rules yourself; the Windows filters also have known limitations listed in the README.",
 "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.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/anthropics-sandbox-runtime/block-agent-commands-from-ssh-keys-and-internet/",
 "md": "https://dedupedai.com/use-cases/anthropics-sandbox-runtime/block-agent-commands-from-ssh-keys-and-internet/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--block-agent-commands-from-ssh-keys-and-internet.json",
 "api_version": "v1"
}
