Skip to main content

What You’ll Learn

  • Creating a sandbox with allow_internet_access=False to block all outbound traffic
  • Writing sensitive data (API keys, passwords) into the sandbox
  • Confirming HTTP exfiltration attempts are blocked
  • Understanding why DNS exfiltration is also prevented by deny-all
  • Verifying the data remains accessible locally within the sandbox

Scenario

An AI agent processes sensitive data (credentials, API keys) inside a sandbox. Even if the code is compromised or malicious, deny-all networking ensures it cannot exfiltrate data:
  1. Sensitive data is written into the sandbox
  2. Malicious code tries to POST the data to evil.comblocked
  3. DNS-based exfiltration (encoding data in DNS queries) is also impossible
  4. The data can still be read locally for legitimate processing

Prerequisites

This example is available in Python. TypeScript version coming soon.

Code Walkthrough

Create a sandbox with all outbound traffic denied:
Write simulated credentials into the sandbox:
Attempt to exfiltrate via HTTP — the connection is blocked:
DNS exfiltration is inherently blocked — no outbound packets can leave:
Verify the data is still readable locally:

Expected Output