Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Firewalled Dev Container

A VS Code devcontainer setup that sandboxes AI agents (Copilot, etc.) by restricting both file system access and network access.

Architecture

[Internet] <--> [external network] <--> [Squid Proxy] <--> [internal network] <--> [Dev Container]
                                         (whitelist)        (internal: true)
  • The dev container runs on a Docker network with internal: true — it has no direct route to the internet.
  • A Squid proxy bridges the internal and external networks, forwarding only requests to whitelisted domains.
  • Only the workspace directory is mounted — no access to host files like ~/.ssh or ~/.aws.

Usage

  1. Open this folder in VS Code.
  2. Run Dev Containers: Reopen in Container from the command palette.
  3. All terminal sessions and extensions inside the container are sandboxed.

Managing the Domain Whitelist

Edit .devcontainer/squid.conf to add or remove allowed domains:

acl allowed_domains dstdomain .example.com

Then restart the proxy from a host terminal:

docker compose -f .devcontainer/docker-compose.yml restart proxy

Files

File Purpose
.devcontainer/devcontainer.json VS Code devcontainer config, sets proxy env vars
.devcontainer/docker-compose.yml Two-network topology (external + internal)
.devcontainer/Dockerfile Dev container image
.devcontainer/squid.conf Squid proxy domain whitelist

About

A VS Code devcontainer setup that sandboxes AI agents (Copilot, etc.) by restricting both file system access and network access.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages