沙箱比AI更聪明? | Your Sandbox Is Smarter Than Your AI

 

仨人组团给你AI请了监工、保镖、还包了自助餐,偶尔装环境会闹点小脾气爱报错,但从此写代码不翻车、不泄密、不花钱,普通人也能一键当老板。

Babysitter, bodyguard, and free buffet for your AI coder. Setup can be a bit grumpy, but it keeps code clean, secrets safe, and wallet at zero – even newbies ship like a pro.


很多人以为,AI写代码最大的瓶颈是模型不够聪明。其实恰恰相反,真正拖后腿的,往往是没有流程、没有隔离、没有安全边界。就像谈恋爱,再优秀的人,如果第一次见面就把银行卡密码告诉对方,最后哭的八成还是自己。

Most people think AI coding is limited by model intelligence. Ironically, the bigger problem is the lack of workflow, isolation, and security. It’s like dating—no matter how charming you are, handing over your bank PIN on the first date rarely ends well.

这套方案最大的魅力,就是把三个官方免费工具组合起来:Claude Code Sandbox负责安全隔离,Superpowers负责工程化流程,而GitHub Models(本文案例基于其可用时期)负责免费模型推理,最终用Python自动生成Markdown日报。整个过程几乎零成本,而且符合现代AI开发流程。需要注意的是,GitHub 已宣布 GitHub Models 将于2026年7月底退役,因此该案例更适合作为工程化思路参考。 

The beauty of this stack is combining three official tools: Claude Code Sandbox for isolation, Superpowers for structured engineering, and GitHub Models (available when this workflow was created) for free inference, producing Markdown daily reports with Python. It costs almost nothing while following modern AI engineering practices. Do note that GitHub has announced GitHub Models will be retired by the end of July 2026, so treat this as a reusable engineering pattern rather than a future-proof dependency.  

操作步骤 / Steps

准备沙箱底座: / Prepare the sandbox:

npm i -g @anthropic-ai/claude-code

npm i -g @anthropic-ai/sandbox-runtime

# Linux额外: sudo apt install bubblewrap socat

mkdir daily-notes && cd daily-notes

claude

/sandbox

装上Superpowers监工: / Install Superpowers:

/plugin marketplace add obra/superpowers-marketplace

/plugin install superpowers@superpowers-marketplace

# 验证:Tell me about your superpowers

GitHub免费Token: 去 https://github.com/settings/tokens 新建fine-grained PAT,勾models:read,设环境变量 export GITHUB_MODELS_TOKEN=xxx

GitHub free token: Create a fine-grained PAT, enable models:read, then export GITHUB_MODELS_TOKEN.

让Superpowers带你TDD: 在Claude Code里说:用Superpowers brainstorm,我要一个Python CLI,读./notes/*.md,调用GitHub Models免费API总结成日报。

Ask Superpowers to brainstorm and build a Python CLI that reads ./notes/*.md and summarizes them into a Markdown daily report through GitHub Models.

核心Python代码 / Core Python Code

import os, glob

from openai import OpenAI


client = OpenAI(

    base_url="https://models.github.ai/inference",

    api_key=os.environ["GITHUB_MODELS_TOKEN"]

)


notes = "\n".join(open(f).read()[:2000] for f in glob.glob("./notes/*.md"))

resp = client.chat.completions.create(

    model="openai/gpt-4o-mini", # 免费档,RPM高

    messages=[{"role":"user","content": f"总结成3点日报:\n{notes}"}],

    max_tokens=500

)

print(resp.choices[0].message.content)

沙箱内安全运行: / Run safely inside the sandbox:

npx @anthropic-ai/sandbox-runtime --allow-write./dist --allow-net models.github.ai claude -- python main.py

# 只能写dist,只能访问GitHub Models,.env偷不走

成果:./dist/daily.md 自动生成,全程零Approve,零费用。

Result: ./dist/daily.md is generated automatically with zero approvals and virtually zero operating cost.


真正厉害的地方,并不是几十行Python,而是整个工程化思维。Sandbox负责把AI关进”儿童游乐场”,Superpowers负责让AI先思考再干活,而TDD又让它先写测试再写代码。以前像喝醉了乱写,现在更像请来一个经验丰富、但脾气不错的技术主管。 

The magic isn’t the Python script—it’s the engineering discipline. Sandbox keeps AI inside a secure playground, Superpowers forces planning before coding, and TDD encourages tests before implementation. Instead of a reckless intern, you get a calm senior engineer following a repeatable process.  

对于普通开发者来说,这也是一种非常值得学习的思路:不要一味追最新模型,而是先搭好流程。模型会越来越强,但真正决定交付质量的,永远是工程能力。毕竟,再帅的男朋友,如果袜子永远乱丢,生活体验也会直线下降;AI也是同样的道理。

For everyday developers, the biggest lesson is simple: stop chasing only bigger models and start building better workflows. Models will keep improving, but reliable delivery comes from engineering discipline. Even the most attractive partner becomes exhausting if they leave dirty socks everywhere—AI behaves the same way.


相关链接(Related Links):
https://github.com/obra/superpowers

 https://github.com/obra/superpowers-marketplace

 https://github.com/marketplace/models

 https://docs.github.com/en/github-models

 https://gh.io/models

 https://github.com/settings/tokens

 https://code.claude.com/docs/en/sandbox-environments

 https://github.com/anthropic-experimental/sandbox-runtime

 https://www.anthropic.com/engineering/claude-code-sandboxing

 https://github.com/tashfeenahmed/freellmapi

https://github.com/Vinci-da-Gama/try-github-model-18july2026

评论

爽文共赏/Popular Posts

5分钟拿下原生IP + 免费节点 手残变大佬 | From Noob to Pro in 5 Minutes: 10 Real IPs + Daily Fresh Free Nodes

免费节点无限续?OneBox+subs-check,付费党沉默了 | Free Nodes Never Die? OneBox + subs-check, Paid Users Left Speechless

一口气搭好!Cloudflare融合Railway与Galaxy打造纯净原生免费VPS | Build a Pure Free VPS with Cloudflare + Railway + Galaxy in One Go

3 Steps to AI Video Fame✨WebSocket+Copilot Auto-Update, Newbies Win Too | 3 步 AI 视频封神✨WebSocket+Copilot 自动更,小白也能卷赢

Stop Note-Taking Pain—AI One-Click, Efficiency Skyrockets | 别再苦抄笔记!用AI一键效率爆表💥

Game-Changing! Get AI Parenting+Math Enlightenment for Free | 0成本get AI育儿+数学启蒙双buff,躺赢养娃