<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sandbox on AI + 量化工程</title><link>https://miasyster.github.io/tags/sandbox/</link><description>Recent content in Sandbox on AI + 量化工程</description><generator>Hugo</generator><language>zh</language><lastBuildDate>Fri, 03 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://miasyster.github.io/tags/sandbox/index.xml" rel="self" type="application/rss+xml"/><item><title>让 AI 写的代码跑起来，但别让它跑出去</title><link>https://miasyster.github.io/posts/sandbox-defense-in-depth/</link><pubDate>Fri, 03 Apr 2026 00:00:00 +0000</pubDate><guid>https://miasyster.github.io/posts/sandbox-defense-in-depth/</guid><description>AI 生成的代码必须被执行，否则它就只是文本。但执行意味着风险。我没有选择容器隔离，也没有用 RestrictedPython，而是设计了一个三层防御：先在编译期用 AST 拒绝危险结构，再在运行时替换整个 builtins，最后用操作系统级资源限制兜底。三层各解决不同类别的风险，重叠但不冗余。</description></item></channel></rss>