From b7f0c20a6de2aeaa2da0e2ba61f2427b391ec6af Mon Sep 17 00:00:00 2001 From: Ashish Jha Date: Sun, 1 Nov 2026 17:19:22 +0530 Subject: [PATCH] docs: describe the current network model silo-sandbox-net is created --internal on every platform; Docker Desktop reaches the proxy through the silo-gateway sidecar, and --add-host is only used on native Linux. Several docs still described the earlier model (a standard bridge on Docker Desktop), listed no_proxy without llm.gateway, and the troubleshooting guide checked /etc/hosts and ran ping, both of which fail on a working setup. Fixes #7 --- README.md | 2 +- docs/architecture.md | 10 +++++----- docs/configuration.md | 2 +- docs/getting-started.md | 2 +- docs/integrations.md | 2 +- docs/proxy-and-networking.md | 5 +++-- docs/sandbox-agents.md | 6 +++--- docs/security-model.md | 2 +- docs/troubleshooting.md | 17 ++++++++--------- sandbox/Dockerfile | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 8e174c1..7c4044a 100644 --- a/README.md +++ b/README.md @@ -554,7 +554,7 @@ SILO implements **defence in depth** across multiple layers: | Layer | What It Does | How | |---|---|---| | **Container hardening** | Prevents privilege escalation and system damage | Non-root user, read-only fs, no capabilities, PID limits | -| **Network isolation** | Restricts egress paths | Native Linux no-NAT bridge; Docker Desktop proxy-routed egress with source allowlist | +| **Network isolation** | Restricts egress paths | Internal (no-NAT) Docker bridge on every platform; `silo-gateway` sidecar relays the proxy on Docker Desktop | | **Policy engine** | Controls which hosts the agent can reach | YAML rules evaluated per-request; deny by default | | **Credential isolation** | Keeps API keys away from the agent | Keys stored host-side; proxy injects at request time | | **Audit trail** | Full visibility into agent behaviour | Unified JSONL log with LLM, tool, egress, trace events | diff --git a/docs/architecture.md b/docs/architecture.md index bf7b77e..c40ba7e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -59,7 +59,7 @@ silo start ├─ readConfig() Read config from disk (via conf) ├─ assertDockerAvailable() docker info (smoke test) ├─ isContainerRunning() docker inspect (guard against duplicates) - ├─ ensureSiloNetwork() docker network create (internal on native Linux) + ├─ ensureSiloNetwork() docker network create --internal (every platform) ├─ ensureProxyDaemon() Spawn proxy process (detached) └─ startContainer() docker run [hardened flags] ``` @@ -108,9 +108,9 @@ The agent process runs inside a hardened Docker container built from `sandbox/Do | `--security-opt no-new-privileges` | Blocks setuid/setgid escalation | | `--pids-limit 128` | Fork-bomb prevention | | `--cpus ` / `--memory ` | Resource throttles (from config) | -| `--network silo-sandbox-net` | SILO bridge network (internal on native Linux, standard bridge on Docker Desktop) | -| `--add-host llm.gateway:host-gateway` | Resolve `llm.gateway` to host IP | -| `--add-host .gateway:host-gateway` | Resolve integration gateways to host IP | +| `--network silo-sandbox-net` | SILO bridge network, created `--internal` on every platform (no direct internet route) | +| `--add-host llm.gateway:host-gateway` | Native Linux only: resolve `llm.gateway` to host IP (on Docker Desktop the `silo-gateway` sidecar carries this alias) | +| `--add-host .gateway:host-gateway` | Native Linux only: resolve integration gateways to host IP (sidecar aliases on Docker Desktop) | | `--label managed-by=silo` | Discovery label for `silo list` | **Environment variables injected:** @@ -119,7 +119,7 @@ The agent process runs inside a hardened Docker container built from `sandbox/Do |---|---|---| | `http_proxy` / `HTTP_PROXY` | `http://llm.gateway:` | Route HTTP through proxy | | `https_proxy` / `HTTPS_PROXY` | `http://llm.gateway:` | Route HTTPS through proxy | -| `no_proxy` / `NO_PROXY` | `localhost,127.0.0.1,::1` | Bypass proxy for loopback | +| `no_proxy` / `NO_PROXY` | `localhost,127.0.0.1,::1,llm.gateway` | Bypass proxy for loopback and for the proxy itself | | `SILO_SANDBOX` | `1` | Indicates SILO sandbox mode | **Volume mounts:** diff --git a/docs/configuration.md b/docs/configuration.md index 66e9616..90c2a35 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -224,7 +224,7 @@ ensureDecrypted("sk-abc123"); // → returns as-is (plaintext passthrough) | `https_proxy` | Same as `http_proxy` | Container HTTP clients | `http://llm.gateway:` | | `HTTP_PROXY` | Same (uppercase variant) | Container HTTP clients | Same | | `HTTPS_PROXY` | Same (uppercase variant) | Container HTTP clients | Same | -| `no_proxy` | Bypass proxy for these hosts | Container HTTP clients | `localhost,127.0.0.1,::1` | +| `no_proxy` | Bypass proxy for these hosts | Container HTTP clients | `localhost,127.0.0.1,::1,llm.gateway` | | `NO_PROXY` | Same (uppercase variant) | Container HTTP clients | Same | ### Debug Mode diff --git a/docs/getting-started.md b/docs/getting-started.md index 9488381..c52e168 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -115,7 +115,7 @@ silo start ``` This creates the full stack: -1. **Docker bridge network** (`silo-sandbox-net`) — internal/no-NAT on native Linux; proxy-routed on Docker Desktop +1. **Docker bridge network** (`silo-sandbox-net`) — internal/no-NAT on every platform; on Docker Desktop a `silo-gateway` sidecar relays the proxy port 2. **Inference proxy daemon** — listens on `:8199` on the host 3. **Sandbox container** — hardened, isolated, with all security flags applied diff --git a/docs/integrations.md b/docs/integrations.md index 0fa1a84..b7e26f4 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -46,7 +46,7 @@ silo integrations add my-api silo stop && silo start ``` -The new gateway alias is registered as a Docker `--add-host` entry, so the container needs to be recreated. +The new gateway alias is registered as a Docker `--add-host` entry on native Linux, or as a DNS alias on the `silo-gateway` sidecar on Docker Desktop, so the container needs to be recreated (`silo start` also replaces the sidecar when its aliases change). This works the same in default and `--browser` framework runs. Browser mode adds Chromium and browser tmpfs mounts, but integration gateway aliases such as `slack.gateway` and `github.gateway` still route through the host proxy and never expose tokens inside the sandbox. diff --git a/docs/proxy-and-networking.md b/docs/proxy-and-networking.md index fcb113b..f980055 100644 --- a/docs/proxy-and-networking.md +++ b/docs/proxy-and-networking.md @@ -31,7 +31,8 @@ The SILO inference proxy is a lightweight HTTP proxy server that runs on the hos └──────────────┬──────────────────────┘ │ │ http://llm.gateway:8199/v1/chat/completions - │ (llm.gateway resolves to host IP via --add-host) + │ (llm.gateway → host IP via --add-host on Linux, + │ or the silo-gateway sidecar on Docker Desktop) ▼ ┌──────────────────────────────────────────────────────────────┐ │ PROXY SERVER (port 8199, host machine) │ @@ -344,7 +345,7 @@ Container HTTP request ↓ http_proxy env var (set by SILO) ↓ -DNS: llm.gateway → host-gateway (Docker resolves to host IP) +DNS: llm.gateway → host IP (Linux, --add-host) or silo-gateway sidecar (Docker Desktop) ↓ TCP connection to host:8199 ↓ diff --git a/docs/sandbox-agents.md b/docs/sandbox-agents.md index b4ac95a..fd15863 100644 --- a/docs/sandbox-agents.md +++ b/docs/sandbox-agents.md @@ -57,9 +57,9 @@ The key insight: **your agent doesn't know it's sandboxed.** SILO uses standard 1. **`http_proxy` / `https_proxy` environment variables** — Set automatically inside the container. Standard HTTP clients (`curl`, Python `requests`, `httpx`, `pip`, `npm`) all respect these and route traffic through the proxy without any code changes. -2. **`llm.gateway` DNS alias** — Docker's `--add-host` injects this hostname into the container's `/etc/hosts`, resolving to the host machine's IP. Agents can target `http://llm.gateway:8199/v1/...` as their LLM endpoint. +2. **`llm.gateway` DNS alias** — On native Linux, Docker's `--add-host` injects this hostname into the container's `/etc/hosts`, resolving to the host machine's IP. On Docker Desktop for macOS/Windows, it is a DNS alias of the `silo-gateway` sidecar, which relays to the host proxy. Either way, agents can target `http://llm.gateway:8199/v1/...` as their LLM endpoint. -3. **SILO Docker bridge** — The container runs on `silo-sandbox-net`. On native Linux this network is created with `--internal` for no-NAT isolation; on Docker Desktop for macOS/Windows it uses proxy-routed HTTP clients plus a Docker-network source allowlist on the host proxy. +3. **SILO Docker bridge** — The container runs on `silo-sandbox-net`, created with `--internal` (no NAT, no direct internet route) on every platform. On Docker Desktop, where an internal network has no route to the host, the `silo-gateway` sidecar relays the proxy port. --- @@ -425,7 +425,7 @@ Credential-managed integrations keep the same behavior in browser mode. Gateway | Feature | NemoClaw | SILO | |---|---|---| | **Container hardening** | Basic Docker isolation | Read-only FS, cap-drop ALL, no-new-privileges, PID limits, noexec /tmp, non-root, SILO network, resource throttles | -| **Network model** | Container has internet access | Native Linux no-NAT bridge; Docker Desktop proxy-routed egress with host-proxy source allowlist | +| **Network model** | Container has internet access | Internal (no-NAT) bridge on every platform; `silo-gateway` sidecar relays the proxy on Docker Desktop | | **Egress policy** | No policy engine | Declarative YAML policy, glob patterns, deny-by-default, hot-reload | | **API key protection** | Keys passed into container via env vars | Keys **never enter** the container — injected at proxy level | | **Interactive interception** | Not available | Real-time approve/deny prompts for unauthorized requests | diff --git a/docs/security-model.md b/docs/security-model.md index 3058c4f..e8adb4a 100644 --- a/docs/security-model.md +++ b/docs/security-model.md @@ -11,7 +11,7 @@ SILO implements **defence in depth** across six isolation layers. Each layer is | Layer | Threat Mitigated | Mechanism | |---|---|---| | **Container Hardening** | Privilege escalation, system damage | Non-root, read-only FS, no capabilities, PID limits | -| **Network Isolation** | Data exfiltration, C2 communication | Native Linux no-NAT bridge; Docker Desktop proxy-routed egress with proxy source allowlist | +| **Network Isolation** | Data exfiltration, C2 communication | Internal (no-NAT) Docker bridge on every platform; `silo-gateway` sidecar relays the proxy on Docker Desktop | | **Policy Engine** | Unauthorised outbound access | YAML rules evaluated per-request, deny by default | | **Credential Isolation** | API key theft | Keys stored host-side, injected at request time | | **Encryption at Rest** | Config file theft, key exposure | AES-256-GCM with machine-bound PBKDF2 key | diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 6346702..6ee8271 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -131,9 +131,10 @@ echo $http_proxy echo $https_proxy # Should show: http://llm.gateway:8199 -# Check /etc/hosts -cat /etc/hosts | grep llm.gateway -# Should show: llm.gateway +# Check that llm.gateway resolves +getent hosts llm.gateway +# Native Linux: the host IP (from the --add-host entry in /etc/hosts) +# Docker Desktop: the silo-gateway sidecar's IP (Docker DNS alias, not in /etc/hosts) # Exit sandbox and check the Docker network exit @@ -443,12 +444,10 @@ docker network rm silo-sandbox-net # Enter the sandbox silo connect -# Check hosts file -cat /etc/hosts -# Should show: llm.gateway - -# Test resolution -ping llm.gateway # Should resolve to host IP +# Test resolution (ping won't work: the sandbox drops CAP_NET_RAW) +getent hosts llm.gateway +# Native Linux: the host IP (from the --add-host entry in /etc/hosts) +# Docker Desktop: the silo-gateway sidecar's IP (Docker DNS alias, not in /etc/hosts) # Test proxy connection curl http://llm.gateway:8199/_silo/health diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile index 992dbf0..a2ef1c5 100644 --- a/sandbox/Dockerfile +++ b/sandbox/Dockerfile @@ -9,7 +9,7 @@ # --cap-drop ALL All Linux capabilities dropped # --security-opt no-new-privileges # --pids-limit 128 Fork-bomb protection -# --network none No direct network (inference proxy handles egress) +# --network silo-sandbox-net Internal bridge, no direct internet route # ============================================================================= FROM python:3.12-slim AS base