What You’ll Learn
- That
169.254.169.254is blocked by default on every Declaw sandbox — no opt-in required - Verifying the metadata endpoint is unreachable (SSRF protection)
- Verifying normal internet access still works in the same sandbox
- How to add an explicit
deny_outrule as belt-and-suspenders documentation of intent - Understanding why blocking the metadata service matters
Why This Matters
In cloud environments (AWS, GCP, Azure), the instance metadata service at169.254.169.254 can expose:
- IAM credentials and access tokens
- Instance identity documents
- User data scripts (which may contain secrets)
- Network configuration details
169.254.169.254 by default — it is a hardcoded rule applied to every sandbox, so the metadata endpoint is never reachable even with no network policy set. Adding 169.254.169.254/32 to deny_out is therefore redundant; the example below uses it to make the intent explicit and to verify the default protection holds, not to provide it.
Prerequisites
This example is available in Python. TypeScript version coming soon.
Code Walkthrough
The metadata IP is already blocked by default. The explicitdeny_out rule below documents that intent and lets you assert it in tests — it does not change the behavior: