OpenAI 在 2026 年 4 月更新 Agents SDK,核心方向是讓開發者更容易建立能「真的做事」的 agent。
這次重點有兩個:model-native harness 和 native sandbox execution。
簡單說,agent 不只要會呼叫模型。它還需要工作區、檔案、工具、命令執行、狀態保存、錯誤恢復,以及安全邊界。
Agents SDK 這次補上什麼?
OpenAI 說新版 Agents SDK 支援 agent 在受控環境中:
- inspect files。
- run commands。
- edit code。
- work on long-horizon tasks。
- 使用 sandbox workspace。
- 透過 Manifest 描述輸入、輸出和掛載資料。
這表示 SDK 不只是「把模型接工具」。
它開始提供 agent loop 所需的基礎設施:怎麼把檔案給模型看、模型怎麼執行命令、輸出放哪裡、sandbox 掛掉能不能恢復、不同 compute provider 怎麼換。
Agent harness 是什麼?
Harness 可以理解成 agent 的運行框架。
它負責把使用者需求、模型、工具、檔案、記憶、sandbox 和狀態串起來。
OpenAI 這次強調 model-native harness,意思是 harness 的設計更貼近 OpenAI 模型的工作方式,而不是單純做一層通用 wrapper。
新版 harness 包含:
- configurable memory。
- sandbox-aware orchestration。
- Codex-like filesystem tools。
- MCP tool use。
- skills。
- AGENTS.md。
- shell tool。
- apply patch tool。
這些都是 2026 年 agent 系統逐漸標準化的零件。
Native sandbox execution 為什麼重要?
很多有用的 agent 都需要跑 code。
例如:
- 分析資料。
- 修改 repo。
- 跑測試。
- 安裝 dependencies。
- 讀取文件。
- 產生輸出檔。
如果沒有 sandbox,這些操作很容易污染開發者本機或 production 環境。
OpenAI 的新版 SDK 支援自帶 sandbox,也能接 Blaxel、Cloudflare、Daytona、E2B、Modal、Runloop、Vercel 等 provider。
這讓開發者可以先在本機 prototype,再把相同 agent workspace 概念移到 production。
Manifest 解決什麼問題?
Manifest 是描述 agent workspace 的抽象層。
它可以定義:
- 哪些本機檔案要掛進 sandbox。
- 哪些目錄可以輸出結果。
- 資料從 AWS S3、Google Cloud Storage、Azure Blob、Cloudflare R2 等來源進來。
- Agent 應該在哪裡找 input、在哪裡寫 output。
這對長任務很重要。
Agent 如果每次都不知道資料在哪、輸出放哪、哪些檔案可改,可靠性會很差。
Manifest 把這些工作區規則結構化。
為什麼要分離 harness 和 compute?
OpenAI 明確提到,agent 系統應該假設會遇到 prompt injection 和 exfiltration attempts。
所以 harness 和 compute 要分開。
原因是:模型產生的程式碼可能會在 compute 環境裡執行。如果 credential、token、敏感設定也在同一個環境裡,風險就會放大。
比較好的架構是:
| 層級 | 負責 |
|---|---|
| Harness | 狀態、工具編排、政策、上下文、使用者互動 |
| Sandbox compute | 執行程式碼、讀寫受控檔案、產生輸出 |
| Credential boundary | 避免敏感憑證進入模型產生 code 的環境 |
這和最近 agent security 的趨勢一致:不要相信模型輸出,也不要讓 agent 執行環境拿到不必要的權限。
開發者導入建議
如果你要用 Agents SDK 做 production agent,建議先設計這些問題:
- Agent 需要哪些檔案?
- 哪些檔案只能讀不能寫?
- Output 要放哪裡?
- Sandbox 可不可以連網?
- Dependencies 誰負責安裝?
- Credential 是否完全不進 sandbox?
- Sandbox 掛掉後能否從 checkpoint 恢復?
- 哪些 tool call 要記錄?
- 哪些動作需要人工批准?
不要等 agent 做壞事後才補 sandbox。
結論
OpenAI Agents SDK 的這次更新,說明 agent 開發正在從「prompt 加 tool」走向真正的 runtime engineering。
Sandbox、Manifest、harness、compute separation、checkpoint、tools、memory,這些會變成 agent 生產化的基本零件。
能跑 demo 的 agent 很多,能安全處理長任務的 agent 才稀缺。