Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › AI agents

How to Configure Network and Filesystem Access for Sandboxed AI Agents

By Freedom251 Team · · 13 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Give a sandboxed AI agent the smallest filesystem and network authority that can complete its task. Start read-only with networking disabled, then grant write access only to the active workspace and any explicitly required build directories. If internet access is necessary, turn it on through an enforced proxy or domain filter and allow only named hosts; a network-enabled permission without an active proxy can permit unrestricted direct outbound traffic. Keep credentials outside the agent’s readable paths, retain approval prompts for boundary crossings, and inspect the effective policy before opening an unfamiliar repository.

What does a safe sandbox policy for an AI agent include?

A useful policy has two independent boundaries: filesystem isolation and network isolation. Filesystem rules determine what the agent can read, create, modify, or delete. Network rules determine whether it can contact the public internet, local-network services, package registries, source-control hosts, or an internal API. Configure both; a locked-down filesystem does not prevent data exfiltration if the process can reach arbitrary hosts, and a network filter does not stop an agent from reading secrets already mounted in its workspace.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a deny-by-default posture and add exceptions for the current task. Classify every path and destination before granting access:

  • Workspace: the project directory the agent must edit.
  • Build output: generated files, compiler caches, test artifacts, and package-manager stores that must be written for a build to succeed.
  • Shared source or caches: dependency caches or monorepo directories that may be needed read-only.
  • Sensitive paths: SSH keys, cloud credentials, password stores, browser profiles, unrelated home-directory data, and production configuration.
  • External services: exact API, package, documentation, or source-control hosts required by the task.

Grant the workspace read/write access only when edits are required. Keep shared material read-only and explicitly deny sensitive paths even when a broader home-directory rule would otherwise expose them. Leave network access off for tasks that can run from local files and cached dependencies.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Why must filesystem and network controls be configured together?

Prompt injection is the central threat: instructions hidden in an issue, document, test fixture, or dependency can persuade an otherwise helpful agent to search for credentials, alter unrelated files, or upload data. Filesystem isolation limits what that instruction can read or change. Network isolation limits exfiltration and unapproved downloads. Anthropic’s guidance describes both as required boundaries, not interchangeable defenses.

Neither boundary is absolute endpoint security. A sandbox is not automatically a virtual machine or a separate user account. Host credentials, mounted sockets, inherited environment variables, device files, and powerful tools can weaken isolation. Treat any elevated mode, host integration, or container with stored secrets as a trusted operation and reduce the exposure before running untrusted code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should be denied explicitly?

  • Private key directories, credential files, token caches, password-manager databases, and cloud-provider configuration.
  • Entire home-directory areas unrelated to the project, including personal documents and browser data.
  • Container or orchestration control sockets unless the task specifically requires them and the operator accepts host-level risk.
  • Production deployment credentials and service-account keys; use a temporary, least-privilege substitute instead.

An explicit deny is safer than relying on the agent to avoid a path. In systems with precedence rules, place the deny so it wins over a broad read-only or read/write grant.

How do I design a least-privilege policy step by step?

Build the policy from the task’s actual file and service dependencies, not from the agent’s requested permissions. The following sequence works across desktop sandboxes, editor integrations, and container wrappers.

  1. Map the task. Record the workspace path, expected build directories, test commands, package caches, generated output, and external services. Separate items that must be written from those that only need to be read.
  2. Begin read-only. Run discovery, static analysis, or a dry-run with filesystem writes disabled and outbound network disabled. This reveals missing inputs without exposing a large authority surface.
  3. Grant workspace writes. If implementation is required, allow read/write only for the project directory. Add a separate build or temporary directory when the tool cannot keep generated files inside the workspace.
  4. Add narrow read-only mounts. Expose a dependency cache or shared source tree read-only when necessary. Never broaden this to an entire home directory to solve a single missing file.
  5. Add explicit denies. Deny credentials and unrelated personal data even if they are outside the normal workspace. Confirm the sandbox’s precedence semantics so the deny overrides broader grants.
  6. Keep public networking off by default. A local build that uses existing dependencies does not need internet access.
  7. Allow exact hosts only when required. Enable the platform’s proxy or domain filter, then allowlist the specific API endpoint, package registry, documentation host, or source-control service. Do not assume that merely setting a network flag activates filtering.
  8. Handle local-network access separately. Keep access to private IP ranges, localhost services, and internal DNS disabled unless a named internal service is part of the task.
  9. Retain approvals. Require an operator decision for operations outside the configured boundary, such as writing a new path, opening a shell escape, or changing the policy.
  10. Inspect before execution. Use the platform’s effective-policy view or equivalent diagnostic command. Verify the current working directory exception, deny rules, proxy status, and destination list.
  11. Use dedicated credentials. Pass only a task-scoped token or environment credential. Remove or rotate it when the run ends, especially after executing untrusted code.
  12. Revoke temporary access. Return to read-only and disable networking when the network-dependent step is complete.

How does Codex combine filesystem and network permissions?

Codex permission profiles combine filesystem rules with a network setting. Workspace-write mode permits edits in the workspace while approval controls govern attempts to cross that boundary. Linux implementations use host mechanisms such as bubblewrap and seccomp, so the profile is an operating-system restriction rather than a full virtual machine.

Recommended Codex sequence

  1. Select the narrowest permission profile that matches the task.
  2. Run reconnaissance with read-only access and networking disabled.
  3. Switch to workspace-write only for an implementation or formatting step that must change files.
  4. When internet access is required, enable the network proxy feature before adding domain rules.
  5. Allowlist only the required hosts, such as one API endpoint or package registry, and leave all other destinations blocked.
  6. Keep approval prompts enabled for attempts to leave the workspace or alter protected paths.

The important distinction is between a permission that allows command networking and a proxy that enforces destination rules. With network.enabled = true but no active proxy, commands may have direct outbound access that bypasses the domain list. Treat proxy activation as a separate required step and verify it in the effective policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Codex credential pattern

For self-hosted Agents API environments, restrict outbound connections to the documented control-plane hosts api.openai.com and codex-cloud-environments.chatgpt.com. Use a dedicated environment key with only environment or session permissions, inject it as the environment credential, and keep the application’s broader API key outside the sandbox. Do not copy a general-purpose key into the workspace or an environment file that the agent can read.

How do I configure sandboxing in VS Code?

VS Code agent sandboxing exposes three path classes: readwritePaths, readonlyPaths, and deniedPaths. The precedence is explicit: denied paths override read-only paths, and read-only paths override read/write paths. The current working directory receives read/write access automatically, so inspect that exception rather than assuming every grant is visible in your configuration.

Path policy

  1. Set the project as the working directory only when it is the repository you intend to trust.
  2. Add generated output or a dedicated build cache to readwritePaths if the build cannot place it under the project.
  3. Add shared dependency caches and reference repositories to readonlyPaths.
  4. Put credential directories and unrelated home-directory data in deniedPaths, even if a parent path is read-only.
  5. Review the resulting policy with /sandbox policy where that command is supported.

Network policy

Network is separate from filesystem access. allowNetwork controls outbound access, while allowLocalNetwork controls local-network hosts. Allowed and denied domain lists narrow destinations when networking is enabled. Keep both switches off for offline work; if a package install needs public access, enable public networking with a short allowlist and leave local-network access disabled.

VS Code’s sandbox is an OS-level restriction, not a VM or separate user account. Continue to protect the host with normal endpoint controls, avoid exposing host credentials, and treat a repository’s install and test scripts as untrusted code until reviewed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How should Claude Code be isolated?

Claude Code’s threat model separates filesystem isolation from network isolation. Configure both boundaries before giving the agent an unfamiliar repository. Filesystem limits should cover reading and modifying files; network limits should block exfiltration and unapproved downloads. Credentials should remain outside paths the agent can read, and any required secret should be narrowly scoped and short-lived.

Practical operating pattern

  • Open the repository with no network and read-only access for inspection.
  • Grant write access only to the project and a disposable output directory.
  • Enable network through an enforced proxy or equivalent domain control only for a documented dependency or service.
  • Run tests that execute third-party scripts only after checking their inputs, outputs, and network needs.
  • Disable the temporary exception and rotate credentials after the task.

If the host cannot provide the required sandbox primitives, place the agent inside a container or development container and treat that container as the outer boundary. A container reduces host exposure, but it does not make broad credentials safe: a mounted key, Docker socket, or privileged agent mode can still grant consequential control.

Rank #3
Sale
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

When is Docker Sandbox a useful fallback?

Docker Sandboxes can run agents such as Claude Code with sbx run. The project directory is the workspace exception, and the sandbox has a selectable network policy. Docker’s Claude Code guidance also covers project-level configuration and stored secrets. Use this approach when the host operating system cannot supply the required isolation primitives or when a reproducible outer boundary is operationally easier.

Container setup decisions

  • Workspace mount: mount only the repository and required build directories; avoid mounting the whole home directory.
  • Network mode: choose the most restrictive policy that supports the task, then allow only named destinations.
  • Secrets: inject a dedicated secret through the container’s secret mechanism rather than writing it into the project or image.
  • Privileges: avoid privileged mode and host-control sockets unless the operator explicitly accepts trusted-container risk.
  • Persistence: make the container disposable when possible so temporary files and credentials disappear with the run.

Containerization is a fallback boundary, not a reason to expose broad credentials. Reassess what the agent can reach from inside the container and what the container can control on the host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should the network allowlist contain?

Allowlist destinations by function and exact host. A dependency install may need one package registry; an API integration may need one service endpoint; documentation retrieval may need a separate documentation host. Avoid broad wildcards when a specific hostname works.

Task Filesystem access Network access Notes
Code review or static analysis Workspace read-only Disabled Use cached dependencies and local documentation.
Implementation and tests Workspace read/write; build cache as needed Disabled initially Add network only after a failed offline step identifies a dependency.
Package installation Workspace read/write; package cache write One approved registry through the proxy Keep local-network access off unless the registry is internal.
API integration Workspace read/write; credentials denied Named API host only Inject a dedicated environment credential, not a general application key.
Untrusted repository execution Disposable workspace; unrelated paths denied Disabled or tightly allowlisted Prefer a container when host prerequisites are unavailable.

Record why each host is needed and remove it when the step ends. A domain allowlist is not a substitute for validating TLS, package integrity, or the code being executed; it simply narrows where the process may connect.

How should credentials be handled inside a sandbox?

Assume that any credential visible to the agent can be copied into logs, generated files, or an allowed network request. Keep broad application keys, personal SSH keys, browser tokens, and cloud configuration outside readable paths. Use environment or secret injection only for the one operation that needs it, restrict its permissions to that operation, and set an expiration or rotation procedure.

Safer credential checklist

  • Create a separate key for the sandboxed task with only environment or session permissions.
  • Do not place secrets in the repository, dotfiles, shell history, command arguments, or build artifacts.
  • Mask secret values in logs and disable verbose tracing while the credential is present.
  • Prevent the agent from reading the host’s credential directories with explicit deny rules.
  • Revoke or rotate the key after a run that accessed untrusted code or unexpected hosts.

If a tool requires a host credential that cannot be narrowed, move the operation to a manually supervised step outside the autonomous run instead of weakening every other control.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do approvals complement a sandbox?

Approvals provide a human decision point for actions outside the configured boundary; they do not replace the boundary. Keep approval prompts for path expansion, policy changes, shell escapes, privileged commands, and network destinations not already allowlisted. Review the exact command and files involved before approving, because an approval can intentionally override the safety assumptions used for the rest of the run.

Use separate phases when possible: inspect, implement, fetch dependencies, and publish. Each phase can have a narrower policy than one long session, reducing the time that a write permission, network exception, or credential remains active.

What are common configuration failures and how do I fix them?

The agent can edit files outside the project

Check whether the current working directory is broader than intended or whether a parent directory was granted read/write access. Narrow the working directory, add explicit denies for sensitive descendants, and inspect the effective policy rather than only the source configuration.

Domain rules appear to do nothing

Confirm that the network proxy or domain-filter feature is active. A network-enabled permission without an enforced proxy can allow direct outbound connections that bypass the allowlist. Disable networking while diagnosing, then re-enable it with the proxy and exact hosts.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A build fails because a cache is missing

Do not grant the entire home directory. Add the specific cache path as read-only, or create a disposable cache inside the workspace with write access. If a package must be downloaded, allow only its registry for the duration of the install.

The agent cannot reach an internal service

Public-network permission and local-network permission are separate. Enable local-network access only for the named internal host or range, keep other private destinations blocked, and confirm that DNS and certificate validation still work inside the sandbox.

Host sandbox prerequisites fail

Use a container or development container as an outer boundary, mount only the project, select a restrictive network policy, and reassess every credential and host socket exposed to the container. Do not compensate by granting the agent unrestricted host access.

How do the major approaches compare?

The following comparison focuses on control semantics rather than product performance. Where a platform’s default is not established, treat it as a setting to verify before execution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Environment Network control Filesystem semantics Approvals Host prerequisites Container required?
Codex permission profiles network.enabled permits command networking; domain enforcement requires the network proxy Read-only or workspace-write profiles; approval governs boundary crossings Integrated approval flow Linux uses mechanisms including bubblewrap and seccomp; verify platform support No, unless host primitives are unavailable
VS Code agent sandboxing allowNetwork, allowLocalNetwork, and allowed/denied domains deniedPaths overrides readonlyPaths, which overrides readwritePaths; working directory is automatically read/write Use the editor’s approval controls and inspect with /sandbox policy where supported OS-level sandbox support No
Claude Code sandboxing Configure network isolation alongside filesystem isolation; exact default is not stated Limit readable and writable paths; keep credentials outside them Use interactive approval for exceptions Depends on host sandbox primitives Optional fallback
Docker Sandbox Selectable sandbox network policy Project directory is the workspace exception; other mounts are explicit Container and agent controls operate together Docker runtime Yes, by design

Across all four approaches, the durable rule is the same: narrow filesystem grants, disabled networking by default, enforced host filtering when networking is needed, and credentials that are both dedicated and short-lived.

What should I verify before running an untrusted repository?

  • The working directory contains only the intended project.
  • Write access is limited to the project and named build or temporary directories.
  • Credentials, browser data, SSH keys, and unrelated home-directory paths are denied.
  • Network is disabled, or the proxy is active with an exact allowlist.
  • Local-network access is disabled unless a named internal dependency requires it.
  • Approval prompts remain enabled for boundary crossings and policy changes.
  • The effective policy shows the expected precedence and automatic exceptions.
  • The agent is not running with privileged container mode or host-control sockets.
  • Any injected credential is task-scoped, masked, and scheduled for rotation.
  • A recovery plan exists: stop the run, revoke the credential, remove generated artifacts, and review logs.

These checks turn sandboxing from a one-time toggle into an operational control. Re-evaluate the policy whenever the repository, build system, network dependency, or credential set changes.

Frequently Asked Questions

Can a sandbox prevent a malicious package from harming the host?

It can reduce the package’s reach, but it cannot guarantee safety if the agent has privileged access, host sockets, broad mounts, or readable credentials. Run untrusted installation scripts with a disposable workspace and restrictive network policy, and use a container when the host sandbox primitives are unavailable.

Should I give an agent access to my entire home directory for convenience?

No. Broad home-directory access exposes unrelated documents, credential stores, and configuration that a prompt injection could search. Mount only the project and narrowly required caches, then explicitly deny sensitive subdirectories.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is disabling the public internet enough to block data exfiltration?

Not necessarily. An agent may still reach localhost or private-network services if local-network access is enabled, and a misconfigured proxy can leave direct outbound access open. Check both public and local network switches and verify the effective destination policy.

What should I do after an agent unexpectedly accessed a protected path?

Stop the run, preserve the relevant logs, revoke or rotate any credential that was visible, and inspect generated files and outbound connections. Correct the path precedence or working-directory exception, then rerun in a disposable environment with a read-only policy first.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

AI agentsClaude CodeCodexDockerfilesystem permissionsleast privilegeNetwork SecuritysandboxingVS Code

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.