Docker × AI Agent 系列小結:Kernel 隔離、Egress 與資源熔斷
English Abstract: This post wraps up the three-part Docker × AI Agent series. Each article added one defensive layer for containers that run autonomous AI agents: kernel isolation with MicroVM sandboxes, network and credential isolation with an internal-only Docker network and an egress proxy, and resource circuit breaking with cgroups and ulimit. It summarizes the three layers side by side and traces how each one builds on earlier Autocruise posts on Docker proxy configuration, Docker engine ulimits, and Docker credential stores. 近期連續三篇 Docker × AI Agent 系列文,應對的是同一個課題:當容器裡執行的不再是行為固定的微服務,而是會自行產生程式碼、呼叫 Shell 的 AI Agent,「在容器就安全」這個假設要怎麼修正。三篇文章各自補上一道防線,構築成防禦縱深,本文把它們整理在一起,作為此系列的索引。 (一)在 Docker 容器中執行 AI Agent,需要哪三道防線? 在 Docker 容器中執行 AI Agent,需要同時具備 Kernel 隔離、網路與憑證隔離、資源熔斷三道防線,分別對應 Agent 突破隔離、帶走機密與耗盡資源三種風險。 防線 處理的風險 關鍵設定 Kernel 隔離 共用宿主機 Kernel、runc 漏洞、掛載 docker.sock sbx MicroVM、K8s RuntimeClass 網路與憑證隔離 /proc/self/environ、DNS 隧道、.env 外洩 internal: true 、Egress Prox...