[FEATURE] Design trusted Agent identity for outbound model requests

オープン
#3,740 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

📋 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
主要言語
Go
スター
4.5k
フォーク
937
平均マージ
1日 10時間
マージ済み PR(30日)
150

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kagent-dev/kagent のほかの issue

kagent-dev/kagent の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。