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

Abierto
#3,788 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

📋 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.

Lenguaje dominante
Go
Estrellas
4.5k
Forks
937
Merge medio
1 d 10 h
PR fusionados (30 d)
150

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de kagent-dev/kagent

Todos los issues de kagent-dev/kagent

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.