[BUG] Agent card declares no security scheme although every A2A call needs a bearer token

Aperta
#3,788 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start at gateway.go L171-173 where the agent card is assembled, then read http.go L37 and http_test.go L357 to see how the well-known route is authenticated. Read A2A spec §7.3 and §3.1.11 before editing, since the issue leaves open whether to declare the scheme on the authenticated card or serve a minimal unauthenticated one. Done when securitySchemes/securityRequirements are populated and the gateway tests pass; wait for a maintainer to pick the option first.

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

Descrizione

📋 Prerequisites
  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software (checked against main at e8cd153)
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue
🎯 Affected Service(s)

Controller (A2A gateway)

🚦 Impact/Severity

Minor

🐛 Bug Description

The agent card declares no security schemes or requirements (gateway.go L171-173), while every A2A operation, the card included, requires a bearer token. A generic client therefore cannot discover how to authenticate (§7.3). The card also sets extendedAgentCard: true, and §3.1.11 requires the extended card to be fetched with one of the schemes declared in the public card's securitySchemes, which cannot hold when none are declared.

🔄 Steps To Reproduce
  1. Fetch /agents/<namespace>/<name>/.well-known/agent-card.json with a valid token.
  2. Inspect securitySchemes and securityRequirements.
🤔 Expected Behavior

The card declares the scheme the gateway enforces, for example an openIdConnectSecurityScheme pointing at the configured issuer's discovery document, or an HTTP bearer scheme, with a matching requirement.

📱 Actual Behavior

Both are empty.

🔍 Additional Context

The well-known card route serves the extended card and returns 401 without a token (http.go L37, http_test.go L357). Filling securitySchemes alone helps a client that already has a token, but not one that is trying to find out how to get one. Two options:

  • declare the scheme on the card and keep the card behind authentication;
  • serve a minimal public card without authentication (interfaces and security schemes only) and keep the full card at GetExtendedAgentCard, as §3.1.11 describes.

The second option means an unauthenticated caller learns that an Agent exists, which matters for #3787. Which one is preferred?

Note: §3.1.11 and §13 call the requirements field AgentCard.security; the a2a-go v2 type names it SecurityRequirements.

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.