Repository navigation
[DOCS] Document per-agent A2A credentials in the CLI #985
Description
Summary
Document how the CLI authenticates to A2A agents that protect /a2a.
An agent entry in agents.yaml can now carry an auth block with a static bearer token or an OIDC client-credentials grant. The block names environment variables and never holds a secret. For OIDC the CLI reads the token endpoint from the securitySchemes of the agent card, as the A2A protocol defines, so the entry only holds the client.
agents:
- name: research
url: https://research.example.com
auth:
token_env: RESEARCH_AGENT_TOKEN
- name: billing
url: https://billing.example.com
auth:
oidc:
client_id: infer
client_secret_env: BILLING_AGENT_CLIENT_SECRET
audience: billing-agent # optional
issuer_url: https://idp.example.com/realms/agents # optional pin and fallbackAffected pages:
a2a.md, "Using A2A with the Inference Gateway CLI": theauthblock and its two forms, next to "Adding A2A Agents". Credentials have noinfer agents addflags, soagents.yamlis edited directly.cli.md, "A2A Integration": which requests carry the credentials, that they are only sent to the agent's origin, and the error the model sees.
Fields to document:
auth.token_env: environment variable holding a static bearer token.auth.oidc.client_id,auth.oidc.client_secret_env: the client of the client-credentials grant.auth.oidc.audience(optional): sent as theaudienceparameter of the token request.auth.oidc.issuer_url(optional): refuses a card that points at another issuer before the secret is sent, and names the issuer for an agent whose card declares no scheme.
Behaviour worth a sentence each:
- Set one mode per agent,
token_envoroidc. - Write the variable name, not
${VAR}. - Every request to the agent carries the credentials: the agent card fetch, task submission, polling, cancellation and the liveness probe in
infer agents status. - Credentials are only sent to the scheme, host and port of the configured agent, never to another origin or a redirect target.
- An OIDC token is fetched once per process and refreshed shortly before it expires.
- A rejected request, a missing variable or a failed token request reaches the model as
Authentication failed for A2A agent "<name>": ..., without the response body. infer agents showprints the mode and the variable name, never a secret.
Source: inference-gateway/cli#1542 (feature), inference-gateway/cli#1514 (ticket), inference-gateway/cli#1512 (example). The in-repo reference is docs/agents-configuration.md#authentication and docs/a2a-connections.md in the CLI repository, and examples/a2a-auth runs both modes against mock-agent and Keycloak.
Acceptance Criteria
-
a2a.mddocuments theauthblock with both forms, every field above and which fields are optional. - The page states that secrets come from environment variables named in
agents.yaml, and that the OIDC token endpoint comes from the agent card. -
cli.mdstates which requests carry the credentials and that they never leave the agent's origin. - The
Authentication failed for A2A agenterror is documented with a short example. - Either page links the
examples/a2a-authexample.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Oct 5, 2026
@claude can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Oct 5, 2026
Claude finished @edenreich's task in 2m 40s —— View job •
docs/issue-985-20261005-1702• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-985-20261005-1702?quick_pull=1&title=Issue%20%23985%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23985%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Done - PR #987 opened
a2a.md,cli.md, upstream CLI docs on the feature branch)authblock ina2a.mdcli.mdlint:md,format:check,buildall pass)a2a.md- new "Authenticating to A2A Agents" section right after "Adding A2A Agents": both forms of the block with every field and which are optional, that secrets come from environment variables named inagents.yaml(bare name, not${VAR}), that the OIDC token endpoint comes from the card'ssecuritySchemes, whatissuer_urlpins and falls back to, one mode per agent, noaddflags so the file is edited directly, plus a link to theexamples/a2a-authexample.cli.md- new "Agent Credentials" subsection under "A2A Integration": which requests carry the header (card fetch, submission, polling, cancellation,infer agents statusprobe), that credentials only reach the configured scheme/host/port and no redirect target, and theAuthentication failed for A2A agent "<name>": ...error with a short example and no response body.Content checked against the CLI repository's
docs/agents-configuration.md#authenticationanddocs/a2a-connections.mdonfeat/a2a-agent-auth, so the wording tracks the feature as implemented. Worth noting: that feature PR is still open upstream, so these docs land slightly ahead of the release - hold the merge until the CLI side ships if you prefer docs to trail the binary.| Branch | PR #987
feat(a2a): authenticate to agents with per-agent credentials, with an…