Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure Claude Code sandbox network isolation with trusted domains, custom access policies, and environment variables
.claude/skills/microck-network-security-setup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 76% | 0% |
Configure Claude Code sandbox network isolation policies including trusted domain whitelisting, custom access rules, and secure environment variable management.
I am a network security specialist with expertise in:
Mode 1: Trusted Network Access (Recommended Default)
yamlmode: trusted description: Claude can only access pre-approved, known-safe domains use_case: General development, open-source projects trusted_domains: - "*.npmjs.org" - "registry.npmjs.org" - "*.yarnpkg.com" - "*.github.com" - "api.github.com" - "raw.githubusercontent.com" - "*.cloudfront.net" - "*.docker.io" - "registry.hub.docker.com" - "*.pypi.org" - "pypi.python.org"
Mode 2: No Network Access
yamlmode: none description: Complete network isolation, no external access use_case: Maximum security, offline development, sensitive projects trusted_domains: []
Mode 3: Custom Access
yamlmode: custom description: User-defined whitelist of allowed domains use_case: Enterprise with internal registries, corporate networks trusted_domains: - "registry.company.internal" - "docs.company.com" - "api.company.com" - "*.company-cdn.net" - [Include standard registries as needed]
Package Registries:
*.npmjs.org - npm packagesregistry.npmjs.org - npm registry*.yarnpkg.com - Yarn registry*.pypi.org - Python packagespypi.python.org - Python registryrubygems.org - Ruby gems*.maven.org - Maven packagesContainer Registries:
*.docker.io - Docker Hubregistry.hub.docker.com - Docker registryghcr.io - GitHub Container Registrygcr.io - Google Container Registry*.azurecr.io - Azure Container RegistrySource Control & CDNs:
*.github.com - GitHubapi.github.com - GitHub APIraw.githubusercontent.com - Raw GitHub content*.cloudfront.net - AWS CloudFrontcdn.jsdelivr.net - jsDelivr CDNunpkg.com - unpkg CDNDevelopment Tools:
*.vercel.com - Vercel deployment*.netlify.com - Netlify deployment*.supabase.co - Supabase APIInternal Registry Setup:
json{ "sandbox": { "enabled": true, "network": { "mode": "custom", "trustedDomains": [ "registry.company.internal:5000", "npm.company.com", "docs.company.com", "api-docs.company.internal", "*.company-cdn.net", "*.company.cloud", // Include standard public registries if needed "registry.npmjs.org", "*.github.com" ], "customProxy": { "enabled": true, "http": "http://proxy.company.com:8080", "https": "http://proxy.company.com:8080", "noProxy": [ "localhost", "127.0.0.1", "*.company.internal" ] } } } }
Corporate Proxy Configuration:
json{ "sandbox": { "network": { "customProxy": { "enabled": true, "http": "http://corporate-proxy.company.com:3128", "https": "http://corporate-proxy.company.com:3128", "noProxy": [ "localhost", "*.internal", "*.company.com" ], "authentication": { "enabled": false // Use system credentials } } } } }
Safe Environment Variables (OK to configure):
yamlsafe_env_vars: - NODE_ENV: "development" - API_BASE_URL: "https://api.company.com" - LOG_LEVEL: "debug" - FEATURE_FLAGS: "new_ui,beta_features" - BUILD_TARGET: "production"
Dangerous (NEVER in sandbox config):
yamldangerous_env_vars: # Store in .env.local, never in settings - API_KEY: "sk-..." ❌ SECRET - DATABASE_PASSWORD: "..." ❌ SECRET - PRIVATE_KEY: "..." ❌ SECRET - AWS_SECRET_ACCESS_KEY: "..." ❌ SECRET
Best Practice for Secrets:
.env.local (gitignored)Example Secure Configuration:
json{ "sandbox": { "environmentVariables": { // ✅ Non-sensitive configuration "NODE_ENV": "development", "API_BASE_URL": "https://api.staging.company.com", // ✅ Reference to local .env file (document required vars) "__REQUIRED_SECRETS__": "API_KEY, DATABASE_URL (store in .env.local)" } } }
Threat 1: Prompt Injection → Data Exfiltration
Attack: Malicious prompt in downloaded code tries to send sensitive data to attacker.com
Mitigation: Network isolation blocks all non-whitelisted domains
Result: Attack fails, data stays secureThreat 2: Malicious Package Download
Attack: Prompt injection tries to install malware from evil-registry.com
Mitigation: Only trusted registries allowed
Result: Download blocked, system protectedThreat 3: Internal Network Scanning
Attack: Code tries to scan internal network for vulnerable services
Mitigation: Network isolation prevents arbitrary connections
Result: Internal network remains hiddenThreat 4: Credential Theft
Attack: Downloaded code reads environment variables and sends to attacker
Mitigation: Secrets not in sandbox config, network blocked anyway
Result: No credentials accessible or exfiltratableWildcard Patterns:
*.example.com - Matches all subdomains: api.example.com, cdn.example.comexample.com - Exact match only*.*.example.com - Multi-level wildcards: a.b.example.comPort Specifications:
registry.company.com:5000 - Specific port*.company.com:* - Any port on subdomainslocalhost:3000 - Local development serverProtocol Handling:
Test Network Policy:
bash# Should succeed (trusted domain) npm install express # Should succeed (trusted domain) git clone https://github.com/user/repo # Should fail (untrusted domain) curl https://random-website.com # Should succeed if allowLocalBinding enabled npm run dev
Verification Checklist:
yamlenvironment_type: enterprise | opensource | local | custom required_access: public_registries: array[string] internal_domains: array[string] cdn_services: array[string] needs_proxy: boolean proxy_config: object (if needs_proxy) required_env_vars: array[{name, value, is_secret}]
yamlnetwork_configuration: mode: trusted | none | custom trusted_domains: array[string] proxy_config: object (if applicable) environment_variables: object (non-secrets only) security_analysis: threats_mitigated: array[string] access_granted: array[string] access_denied: array[string] recommendations: array[string] setup_instructions: config_file_location: string config_content: json validation_commands: array[string] documentation_links: array[string]
/network-security, /trusted-domainsStandard Development Setup:
Configure network security for open-source development with standard npm and GitHub accessEnterprise Internal:
Set up network isolation for enterprise:
- Internal npm registry: npm.company.internal
- Internal docs: docs.company.com
- Corporate proxy: proxy.company.com:8080
- Keep access to public GitHubMaximum Security:
Configure maximum security with no network access for sensitive projectAdd Custom Domain:
Add api.specialservice.com to trusted domains for API integrationyamltraining: pattern: systems-thinking feedback_collection: true success_metrics: - zero_security_incidents - development_velocity_maintained - false_positive_rate_low
Quick Reference:
.claude/settings.local.json*.domain.comSecurity Principle: Deny by default, allow explicitly, verify continuously
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 15,984 | 10,432 | -35% | 1 | 1 | 0% | 2,561 | 4,643 | +81% | 0 | 0 | — |
case-04 | fail→pass | 15,529 | 9,487 | -39% | 1 | 1 | 0% | 2,898 | 4,517 | +56% | 0 | 0 | — |
case-01 | fail→pass | 19,672 | 14,461 | -26% | 1 | 1 | 0% | 3,884 | 5,661 | +46% | 0 | 0 | — |
case-02 | fail→pass | 17,862 | 10,681 | -40% | 1 | 1 | 0% | 3,489 | 4,718 | +35% | 0 | 0 | — |
case-03 | fail→pass | 28,477 | 10,366 | -64% | 1 | 1 | 0% | 1,891 | 4,470 | +136% | 0 | 0 | — |
case-06 | fail→pass | 16,187 | 13,990 | -14% | 1 | 1 | 0% | 3,207 | 5,655 | +76% | 0 | 0 | — |
case-07 | pass→pass | 19,333 | 9,519 | -51% | 1 | 1 | 0% | 3,371 | 4,684 | +39% | 0 | 0 | — |
case-08 | fail→pass | 14,450 | 8,240 | -43% | 1 | 1 | 0% | 2,322 | 4,089 | +76% | 0 | 0 | — |
case-09 | pass→fail | 17,476 | 10,920 | -38% | 1 | 1 | 0% | 2,960 | 4,708 | +59% | 0 | 0 | — |
case-10 | fail→pass | 27,067 | 9,942 | -63% | 1 | 1 | 0% | 4,693 | 4,573 | -3% | 0 | 0 | — |
case-11 | pass→pass | 13,106 | 9,280 | -29% | 1 | 1 | 0% | 2,456 | 4,571 | +86% | 0 | 0 | — |
case-12 | pass→pass | 15,593 | 14,301 | -8% | 1 | 1 | 0% | 2,592 | 5,312 | +105% | 0 | 0 | — |
case-13 | pass→pass | 16,313 | 10,608 | -35% | 1 | 1 | 0% | 3,030 | 4,705 | +55% | 0 | 0 | — |
case-14 | pass→pass | 17,148 | 7,925 | -54% | 1 | 1 | 0% | 3,081 | 4,357 | +41% | 0 | 0 | — |
case-15 | pass→pass | 15,890 | 9,172 | -42% | 1 | 1 | 0% | 2,791 | 4,556 | +63% | 0 | 0 | — |
case-16 | fail→pass | 19,123 | 9,830 | -49% | 1 | 1 | 0% | 3,515 | 4,623 | +32% | 0 | 0 | — |
case-17 | fail→pass | 22,353 | 11,521 | -48% | 1 | 1 | 0% | 3,727 | 4,812 | +29% | 0 | 0 | — |
case-18 | pass→pass | 17,725 | 12,488 | -30% | 1 | 1 | 0% | 2,937 | 5,061 | +72% | 0 | 0 | — |
case-19 | fail→pass | 20,565 | 8,692 | -58% | 1 | 1 | 0% | 3,499 | 4,343 | +24% | 0 | 0 | — |
case-20 | pass→pass | 19,558 | 7,837 | -60% | 1 | 1 | 0% | 3,680 | 4,274 | +16% | 0 | 0 | — |
case-21 | pass→pass | 12,852 | 11,872 | -8% | 1 | 1 | 0% | 2,449 | 4,975 | +103% | 0 | 0 | — |
case-22 | pass→pass | 6,703 | 8,614 | +29% | 1 | 1 | 0% | 1,328 | 4,338 | +227% | 0 | 0 | — |
case-23 | pass→pass | 12,892 | 10,198 | -21% | 1 | 1 | 0% | 2,837 | 4,832 | +70% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +39 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.