# Security and isolation Each sandbox is a separate virtual machine. This page tells what it can reach and where to put secrets. ## Isolation | From | How the sandbox is kept apart | |---|---| | Other sandboxes | Own Linux kernel, memory, disk and network interface. The firewall drops traffic between sandboxes. | | The computer that runs it | The firewall drops traffic to that computer. A sandbox has no access to a Host's files. | | The local network | No access to private, loopback, link-local or cloud metadata addresses. `169.254.169.254` answers only with the sandbox's own data. | | Other customers | Your API key works only for your workspace. Commands and files also need a per-sandbox token, which the SDK sends for you. | No isolation is perfect. For credentials and private data, use [trusted placement](#trusted). ## Where sandboxes run Sandboxes run on machines that we own and on Host computers. A Host is a person who lends an idle Mac and controls it ([Become a Host](https://fdtn.dev/docs/hosts.md)). Do not put credentials or private data in a sandbox that can run on a Host computer. ### Trusted placement A trusted sandbox runs only on a machine that we own. ```bash $ fdtn create base -d --trusted ``` - SDK or API: send the metadata `fdtn_own_fleet_only` with the value `"1"` on create. - If no machine that we own has space, the create waits or fails. It never moves to a Host computer. - The `claude` template always uses trusted placement. - Our administrators can read the memory of any sandbox, trusted ones too. ## Network rules A sandbox has full outbound internet access, except: | Rule | Detail | |---|---| | Blocked ports | Mail ports `25`, `465`, `587`. Use an email API over HTTPS. | | Blocked addresses | `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, `127.0.0.0/8`, `169.254.0.0/16`, `0.0.0.0/8`, `224.0.0.0/4`; IPv6 `fc00::/7`, `fe80::/10`, `ff00::/8`, `::1`. | | Other blocks | Mining pools and Tor exit nodes | | Exit address | Changes with the machine that runs the sandbox. Do not allow-list one fixed address. | | Traffic | Included in the price, with fair-use limits | | Abuse | Crypto mining and port scans suspend the workspace. | Inbound: ports are private by default and need the sandbox's traffic token. You can make ports public only at create. See [Ports and URLs](https://fdtn.dev/docs/ports.md). ## Keys and secrets - Keep your API key in `~/.fdtn/key` or `FDTN_API_KEY`. Copy it into a sandbox only if code there must start other sandboxes ([API keys](https://fdtn.dev/docs/keys.md)). - Any process in a sandbox can read every secret in it. Give a sandbox only the secrets its job needs, and only with trusted placement. - Use provider keys with a low limit and a short expiry. Revoke them after the job. - For an Anthropic key, save it as a [secret](https://fdtn.dev/docs/secrets.md): the sandbox gets a placeholder, and the real key stays sealed with AWS KMS on our gateway. Webhook messages are signed with HMAC-SHA256 and go only to public HTTPS addresses ([Webhooks](https://fdtn.dev/docs/webhooks.md)). ## Next - [**API keys**: Create and rotate keys.](https://fdtn.dev/docs/keys.md) - [**Ports and URLs**: Reach a server in a sandbox.](https://fdtn.dev/docs/ports.md) - [**Host privacy**: What a Host computer shares.](https://fdtn.dev/docs/hosts/privacy.md) Source: https://fdtn.dev/docs/security/