M12-024M12: AI Security Red-Teaming & AI PM PlaybooksAI Security Red-Team & IsolationHard
⚡Flashcard Drill➔Mastery:

AI Red-Team: Blocking Agentic SSRF, Cloud Metadata Leaks & Code-Sandbox Escapes

🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
Next: M12-025 →
📐 Mathematical Definition
Agent URL/Code→DNS Rebind Check + Egress ProxyDeny RFC1918∪169.254.169.254\text{Agent URL/Code} \xrightarrow{\text{DNS Rebind Check + Egress Proxy}} \text{Deny } \text{RFC1918} \cup \texttt{169.254.169.254}
⚡ One-Sentence Core Answer
Stop web-browsing and code-executing agents from hitting cloud metadata IPs (169.254.169.254) or internal VPC services using egress proxies, DNS-rebinding guards, and Firecracker microVMs.

📌 Key Takeaways

  • •
    IMDS & Internal VPC Risk: web-fetch tools and Python sandboxes running inside cloud pods can exfiltrate IAM tokens via 169.254.169.254 or probe internal Redis/Postgres ports
  • •
    Socket-Level Egress Proxy: enforce a dedicated outbound proxy that blocks RFC1918, loopback, link-local IPs, and HTTP 30x redirects at connection time—defeating DNS rebinding
  • •
    Hardware-Isolated MicroVMs: run untrusted LLM-generated code inside Firecracker microVMs or gVisor (not bare Docker containers) with strict CPU/RAM/wall-clock limits
  • •
    Zero Secrets Inside Sandbox: never expose production API keys in sandbox env vars; inject auth headers externally at a trusted gateway

📐 Mathematical Derivations

Constrain every sandbox by {Net=Public-Proxy-Only,Secrets=∅,TTL≤30s}\{\text{Net}=\text{Public-Proxy-Only}, \text{Secrets}=\emptyset, \text{TTL}\le 30\text{s}\}, ensuring even full RCE yields zero lateral movement or credential theft.

🏭 Production Trade-offs

For pure data-analysis code interpreters, disable outbound networking completely (egress=deny) and pre-mount sanitized input files.
⚠️ Common Interview Pitfalls
  • ✕
    Filtering SSRF URLs with regex strings (127.0.0.1) that fail against IPv6, decimal IPs, or DNS rebinding
  • ✕
    Putting real database/API secrets inside sandbox environment variables or mounting host Docker sockets
🎯 Interviewer Follow-up Inquiries
  • ?
    How does AWS IMDSv2 hop-limit=1 mitigation help, and why is an explicit egress proxy still mandatory?
  • ?
    How do you let a data-analysis agent query an internal warehouse without giving the sandbox direct DB credentials?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

← PreviousM12-023: AI Red-Team: Defending MCP Tool Poisoning, Rug-Pull Schema Mutations & Tool Shadowing📋 Back to BankNext →M12-025: AI Red-Team: Defending Embedding Inversion & Vector Reconstruction Privacy Attacks