[FEATURE] Design trusted Agent identity for outbound model requests

Aperta
#3,740 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start by reading the Actor identity work in #3359, #3361, and #3362, then trace how model requests reach an explicitly configured gateway and how agentgateway keys usage limits. Decide which component verifies and resolves the Agent identity, how failures behave, and whether token injection or Actor labels are needed. Validate the design with two Agents sharing an AgentTemplate and ModelConfig: each should receive separate limits, regardless of a caller-supplied identity header.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

📋 Prerequisites
📝 Feature Summary

No response

❓ Problem Statement / Motivation

Agentgateway needs to track model usage and enforce token limits per kagent Agent. Two Agents can share an AgentTemplate and ModelConfig but still need separate limits. This must work across the kagent, Claude, Codex, and BYO harnesses.

#2737 proposed sending X-Agent-Id. PR #2901 demonstrated that this gives two Agents separate agentgateway buckets (end-to-end result). However, review found that sendAgentIDHeader is too specific, could send identity to unintended model endpoints, and produces a header that an agent process could forge. The Claude harness requirement also shows why a solution confined to one compiler is insufficient.

We agreed to design a general, trusted way to identify the Agent on outbound requests before continuing #2901 (discussion).

💡 Proposed Solution

Use the merged Actor identity work as the starting point: #3359 and #3361 provide gateway-injected Actor JWTs, and #3362 lets a downstream service resolve an Actor token to the actual kagent Agent. For model requests sent to an explicitly configured gateway, explore having that gateway verify the token, resolve the Agent, and use the Agent identity as its usage and limit key. The credential must not reach the upstream model provider, and a caller-supplied X-Agent-Id must not be trusted.

The design should decide:

  1. Whether the existing Actor token and ResolveAgentIdentity are sufficient, or whether Actor labels from Substrate #186 and #3208 are needed.
  2. Whether current placeholder-based token injection is sufficient, or whether to depend on Substrate #3137, which proposes injection without a client-supplied placeholder.
  3. Which component verifies the token and resolves the Agent, how failures are handled, and what agentgateway changes are needed to key limits by verified identity.

Validate the agreed design with two Agents sharing an AgentTemplate and ModelConfig: they should receive separate limits, and changing a caller-supplied identity header should not change which Agent is charged.

Related discussion: Substrate egress proposal, Quentin’s Codex implementation and test, and agreement to continue in a design issue

🔄 Alternatives Considered

No response

🎯 Affected Service(s)

None

📚 Additional Context

No response

🙋 Are you willing to contribute?
  • I am willing to submit a PR for this feature
Lingua principale
Go
Stelle
4.5k
Fork
937
Merge medio
1g 10h
PR unite (30g)
150

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kagent-dev/kagent

Tutte le issue di kagent-dev/kagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.