sandbox-domains

sandbox-domains is a cursor rule for coding agents from cdbattags/ai. It costs 444 tokens per session, scanned A, original, MIT.

A file that lists internet domains allowed for commands run in a Cursor workspace. Cursor is a coding editor with an AI assistant, and the list controls which sites sandboxed commands may contact.

In plain words
What is it for?
Allow access to common development services, GitHub, package registries, language package hosts, and project-specific APIs from sandboxed shell commands.
Why use it?
It prevents network-dependent commands such as package installs, Git operations, and API calls from failing because their domains are blocked.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/cdbattags/ai/sandbox-domains
Clone the repo
git clone --depth 1 https://github.com/cdbattags/ai

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sandbox-domains

README.md
[![agentmods](https://agentmods.dev/badge/rules/cdbattags/ai/sandbox-domains.svg)](https://agentmods.dev/rules/cdbattags/ai/sandbox-domains)
Your own site
<a href="https://agentmods.dev/rules/cdbattags/ai/sandbox-domains"><img src="https://agentmods.dev/badge/rules/cdbattags/ai/sandbox-domains.svg" alt="Measured on agentmods" height="20"></a>
Per session 444 This file is loaded in full into every session.
When invoked 444 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00444 $0.00444
Opus 5 $0.00222 $0.00222
Sonnet 5 $0.00089 $0.00089
Haiku 4.5 $0.00044 $0.00044

Measured 4d ago against content hash 18cb93370e47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sandbox-domains scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/rules/sandbox-domains.mdc · 68 lines

What it actually says

Cursor Sandbox Network Allowlist

CRITICAL: Every Cursor workspace should have a sandbox-domains.txt file at the workspace root with an allowlist of network domains for sandbox commands.

What It Does

When you run shell commands in Cursor, they run in a sandbox with restricted network access. The sandbox-domains.txt file tells Cursor which domains to allow through the sandbox firewall.

Without this file, commands that need network access (like pnpm install, git clone, API calls, etc.) will fail with network errors.

Required File Location

<workspace-root>/sandbox-domains.txt

Standard Allowlist for Development Projects

Create the file with this baseline (adjust based on your project's needs):

api.github.com, github.com, uploads.github.com, objects.githubusercontent.com, raw.githubusercontent.com, gist.githubusercontent.com, api.digitalocean.com, api.pulumi.com, luarocks.org, api.spotify.com, ws.audioscrobbler.com, pypi.org, files.pythonhosted.org, crates.io

Common Additions by Project Type

Node.js / JavaScript:

registry.npmjs.org, registry.yarnpkg.com

Python:

pypi.org, files.pythonhosted.org

Rust:

crates.io, static.crates.io, index.crates.io

Cloud providers:

api.digitalocean.com, storage.googleapis.com, s3.amazonaws.com

Package CDNs:

cdn.jsdelivr.net, unpkg.com, esm.sh

Verification

If you're getting network errors in shell commands, check:

  1. Does sandbox-domains.txt exist at workspace root?
  2. Are the required domains listed (comma-separated, single line)?
  3. Did you reload the workspace after adding it?

Gitignore

This file should be in .gitignore — it's workspace-specific configuration, not project code. Each developer may need different domains based on their toolchain.

Add to .gitignore:

sandbox-domains.txt
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 68 lines · 444 tokens per session scan A 18cb93370e47

Subscribe to this mod's changes

sandbox-domains is a cursor rule published in the GitHub repository cdbattags/ai (4 stars, last pushed 6mo ago), licensed MIT. It adds 444 tokens to every session, about $0.0022 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.