Feature Request: Native Token Metering & Bounded Overshoot (x402 Protocol)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- csharp, javascript
調査の方向性
ファイル、テスト、具体的なエントリポイントは挙げられていません。まず framework の routing layer、upstream modelcontextprotocol の issue #3229、リファレンス SDK @neuforge/pay-js を読みます。完了には、ネイティブな x402 統合の合意済みスコープ、上限付き超過動作、コンプライアンス対応が必要です。
索引モデルが issue の本文から書いたものです。
説明
Context
As enterprise adoption of this framework accelerates, developers are increasingly hitting the "Margin Leak" problem: autonomous agents entering loops and aggressively polling paid LLM resources without proactive financial guardrails.
Currently, developers must build bespoke token-counting wrappers around the LLM calls. If a loop occurs, the API bill skyrockets before the framework can halt it.
Proposal: Adopt the x402 Protocol
We recently authored V2 of the x402 Native Token Metering Protocol upstream in the core modelcontextprotocol repository (Issue #3229).
We propose adding native support for x402 token metering and Bounded Overshoot directly into the framework's routing layer.
How it works (Bounded Overshoot)
Instead of pre-flight token math (which leads to false refusals), the framework passes requests through a meter. If the budget is exceeded, the request returns a standardized -4020 Payment Required error, and the agent safely halts.
Visual Demonstration:
🔥 Margin Leak Simulator Running...
=============================================
🚨 SCENARIO 1: UNPROTECTED AGENT (Status Quo)
=============================================
[Unprotected] Call 1 | Cost: $0.05 | Agent continues looping blindly...
[Unprotected] Call 5 | Cost: $0.25 | Agent continues looping blindly...
[Unprotected] Call 10| Cost: $0.50 | Agent continues looping blindly...
❌ DISASTER: Agent burned $0.50 and is still looping!
=============================================
🛡️ SCENARIO 2: PROTECTED AGENT (x402 Protocol)
=============================================
[Protected] Call 1 | Cost: $0.05 | LLM Call Success.
[Protected] Call 2 | Cost: $0.10 | LLM Call Success.
[Protected] Call 3 | Cost: $0.15 | LLM Call Success.
[Protected] Call 4 | Cost: $0.20 | LLM Call Success.
[x402 Firewall] Call 5 INTERCEPTED! HTTP 402 Payment Required.
✅ SUCCESS: Agent safely halted before catastrophic margin leak.
--> Remaining Budget: $0.00
Compliance (HTTP 451)
Enterprise environments also require strict KYC/Sanctions checks. The x402 spec natively supports returning HTTP 451 (Unavailable For Legal Reasons) if a destination wallet or tool is flagged, preventing the agent from transacting with sanctioned entities.
Reference Implementation
Our team maintains the @neuforge/pay-js SDK which handles the Stripe/Fiat bridging for this exact protocol. We would love to collaborate on submitting a PR to integrate this standard routing logic natively here.
Would the maintainers be open to standardizing this guardrail?
- 主要言語
- C#
- スター
- 28.6k
- フォーク
- 4.8k
- 平均マージ
- 13時間 24分
- マージ済み PR(30日)
- 11
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/semantic-kernel のほかの issue
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14491 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/semantic-kernel#14490 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/semantic-kernel#14483 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
.NET python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/semantic-kernel#14482 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14481 ·
メンテナーはふだん 2 日以内に返信
microsoft/semantic-kernel の issue をすべて見る
似ている issue
-
[Simple] NavigationBar primary commands do not render AppBarButton.Content when it is a UIElementオープンcontrol/navigationbar kind/bug triage/untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
unoplatform/uno.toolkit.ui#1652 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/copilot-camp#1053 ·
メンテナーはふだん 1 日以内に返信
-
bug effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nightscout/nocturne#1861 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows area/Docs partner/agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/fluentui-blazor#5364 ·
メンテナーはふだん 1 日以内に返信