# Microsoft TokenOps 以共享 run 預算治理多 Agent token 呼叫

> 📖 本站完整內容索引（documentation index）：[llms.txt](/llms.txt)

> 原作者：Microsoft Developer (@msdev) · 策展與摘要：EasyVibeCoding · 平台：X (Twitter) · 熱度：🔥 · 日期：2026-08-30

> 原始來源：https://x.com/msdev/status/2093425027500978292

## 證據與延伸閱讀

- [Microsoft TokenOps 以共享 run 預算治理多 Agent token 呼叫。](https://commandline.microsoft.com/tokenops-real-time-run-scoped-cost-control-ai-agents) — 官方文件 · 最後核對：2026-08-30 · 支持主張：Adds implementation and architecture resources to the TokenOps event: the article contrasts monthly caps with shared run-ledger precomputed policies, while the repository is presented as a field guide and reference architecture.
- [TokenOps run-aware token governance — @nick_cloudops](https://x.com/nick_cloudops/status/2093458630439760209) — 一手來源 · 最後核對：2026-08-30 · 支持主張：The README contributes concrete architecture and setup signals—one shared run_id and ledger, pre-call policies, SQLite state, and runnable demos—while the X post itself only asks whether anyone has tried TokenOps and supplies no independent result.
- [Microsoft TokenOps architecture and repository resources — github.com](https://github.com/theagentplane/tokenops) — 官方 Repository · 最後核對：2026-08-30 · 支持主張：Adds implementation and architecture resources to the TokenOps event: the article contrasts monthly caps with shared run-ledger precomputed policies, while the repository is presented as a field guide and reference architecture.
- [Microsoft TokenOps cost-control benchmark — @techtarget_itm](https://x.com/techtarget_itm/status/2091980147876598265) — 一手來源 · 最後核對：2026-08-30 · 支持主張：Adds benchmark figures to Microsoft's run-scoped TokenOps description, contrasting simple throttling with steering output and behavior before halting; the figures are attributed to a Microsoft presentation and were not independently reproduced.
- [Microsoft TokenOps cost-control benchmark — techtarget.itmedia.co.jp](https://techtarget.itmedia.co.jp/tt/article/2608/25/226082501) — 一手來源 · 最後核對：2026-08-30 · 支持主張：Adds benchmark figures to Microsoft's run-scoped TokenOps description, contrasting simple throttling with steering output and behavior before halting; the figures are attributed to a Microsoft presentation and were not independently reproduced.
- [Microsoft TokenOps architecture and repository resources — @msdev](https://x.com/msdev/status/2093425029543571652) — 一手來源 · 最後核對：2026-08-30 · 支持主張：Adds implementation and architecture resources to the TokenOps event: the article contrasts monthly caps with shared run-ledger precomputed policies, while the repository is presented as a field guide and reference architecture.

## 中文摘要

Microsoft TokenOps 以共享 run 預算治理多 Agent token 呼叫。

**架構與治理** Microsoft Command Line 將 TokenOps 定義為管理 token 預算的 control plane（控制平面）。每次 run 只配置一個共享預算，所有 Agent 分支、模型呼叫與工具呼叫都記錄在同一個 shared ledger 中；token lineage 則沿著父子 Agent 的分支追蹤，避免子 Agent 脫離父層 run 的限制。政策層會在下一次呼叫執行前判斷應採取何種措施，runtime adapter 再於實際呼叫邊界執行結果，包括 `allow`、`STEER` 或 `HALT`。

**成本控制方式** TokenOps 主張，單純設定每月上限或讓各 Agent 持有獨立計數器，無法真正控制進行中的失控 run。相較之下，共享 run 預算可在 token 耗盡前把工作導向成本較低的行動，也能在達到政策邊界時停止流程。`STEER` 可修改下一次呼叫，例如精簡輸出、改道或修正行為；`HALT` 則是最後一道 circuit breaker。這套設計同時保留跨 Agent 的成本 lineage，讓管理者知道整個 run 的 token 消耗由誰、在哪個分支產生。

**程式庫與可操作內容** Microsoft Developer 於 2026 年 8 月 28 日分享 Microsoft Command Line 架構文章，以及 GitHub 上的 [theagentplane/tokenops](https://github.com/theagentplane/tokenops) 程式庫。README 將 TokenOps 描述為多 Agent 系統的 run-aware token governance control plane 與 SDK，具體列出：

- 入口 Agent 註冊 run，所有模型與工具呼叫共用一個 `run_id` 與一個 ledger。
- 政策可在下一次呼叫前停止、修改或插入行為。
- 使用共享 SQLite 狀態，並提供控制平面伺服器、管理介面與儀表板。
- 內建十套預設政策，以及雙 Agent、三 Agent 和 LangChain 的可執行示範。
- 專案標示為 `0.x draft`，環境需求包含 Python 3.10+。

**評測數據與限制** TechTarget Japan 於 2026 年 8 月 24 日報導一項由 Microsoft 工程師 Tisha Chawla 與 Susheem Koul 簡報中的 benchmark：在開放原始碼 AI Agent 環境中，啟用 TokenOps 政策後，平均支出據報降低約 78%；完成率則從簡單 throttling 下的 67%，提升至先 `STEER`、再 `HALT` 時的約 96%。不過，這些數字尚未由外部單位重現，來源也未提供任務、模型、成本計算方式、統計方法或原始資料，因此不能直接推論到其他部署環境。

**實際成熟度** Nicholas Chang 於 2026 年 8 月 29 日僅詢問是否有人試過 TokenOps，未提供親自執行、程式貢獻或結果；該貼文不能視為成功驗證。README 的 `0.x draft` 狀態也不足以證明其已具備正式環境所需的穩定性、政策正確性、效能表現或安全模型，來源亦未交代授權、部署安全性、API schema、runtime 細節，以及 token 計算是否對應供應商帳單。媒體畫面中的示範還顯示，一項 SaaS 定價比較任務因預算防護而在 0.0000 秒終止、未回傳摘要，並出現 `ButtonMixin.page_link()` 收到未預期 `query_params` 的型態錯誤；這只能視為示範畫面中的執行狀況，不能當成正式效能或可靠性結論。 

<video src="https://pub-75d4fe1e4e80421b9ecb1245a7ae0d1a.r2.dev/curated/1788080911873-jj2n116p.mp4" poster="https://pub-75d4fe1e4e80421b9ecb1245a7ae0d1a.r2.dev/curated/b92b7f383bb130ea.jpg" autoplay loop muted playsinline preload="metadata" style="max-width:100%;height:auto;display:block;margin:1rem 0"></video>
> TokenOps 介面在執行選定 SaaS 定價比較任務時因預算上限觸發而停止的畫面

## 標籤

Agent, 自動化, Microsoft, GitHub, LangChain
