Who it is forAn engineer building an agent harness that needs to grant or revoke network access during a long task.
The problemRestarting a sandboxed process every time an agent needs one more domain throws away its progress.
The outcomeA running command whose network allowlist updates on the next connection, with no restart.
What you need first
- 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
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
Prompt for your agent
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.
Caveat. Each line replaces the whole config rather than patching it, so a key you leave out goes back to its default.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for anthropics/sandbox-runtime and "Change network rules while a sandboxed command runs"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer