Feature Request: Native Token Metering & Bounded Overshoot (x402 Protocol)
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, javascript
- Área
- backend-api-design, payments, security
Línea de trabajo
No se nombran archivos, pruebas ni puntos de entrada concretos. Empieza leyendo la capa de enrutamiento del framework, el issue #3229 de upstream modelcontextprotocol y el SDK de referencia @neuforge/pay-js; para darlo por terminado harían falta un alcance acordado para la integración nativa de x402, un comportamiento de sobrepaso acotado y el tratamiento del cumplimiento normativo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- C#
- Estrellas
- 28.7k
- Forks
- 4.8k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 22
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/semantic-kernel
-
Python: Bug: Anthropic, Bedrock, Google AI and Vertex AI tool formatters ignore include_in_function_choices=FalsePosiblemente ocupada @wasim-builds la tomó hace 2 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/semantic-kernel#14615 ·
Los mantenedores suelen responder en 3 días
-
Python: Bug: AnnotationContent and StreamingAnnotationContent to_element writes CitationType.X, so annotations in a rendered chat history fail to parsePosiblemente ocupada @CRYPTONIKAV la tomó hace 5 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/semantic-kernel#14590 ·
Los mantenedores suelen responder en 3 días
-
Python: Bug: TimePlugin timeZoneOffset and timeZoneName always return an empty stringPosiblemente ocupada @jeevan1098 la tomó hace 4 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
microsoft/semantic-kernel#14583 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Posiblemente ocupada @nightcityblade la tomó hace 16 días. Abierto.NET triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
microsoft/semantic-kernel#14526 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Posiblemente ocupada @VANDRANKI la tomó hace 18 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/semantic-kernel#14522 ·
Los mantenedores suelen responder en 3 días
Todos los issues de microsoft/semantic-kernel
Issues similares
-
status:waiting-for-triage type:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
microsoftgraph/msgraph-sdk-dotnet#3194 ·
Los mantenedores suelen responder en 1 día
-
Backend enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)Abiertoarea: sim area: unity enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
eyalgolan/statecraft-israel#1107 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
dimitar-radenkov/Pointframe#271 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
qew21/Genshin-Subtitles#45 ·