What You’ll Learn
- Creating a sandbox with
allow_internet_access=Falseto 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:- Sensitive data is written into the sandbox
- Malicious code tries to POST the data to
evil.com— blocked - DNS-based exfiltration (encoding data in DNS queries) is also impossible
- The data can still be read locally for legitimate processing
Prerequisites
This example is available in Python. TypeScript version coming soon.