Repository navigation
[DOCS] A2A agent credentials from a file or a command #992
Copy link
Copy link
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Summary
inference-gateway/cli#1550 adds two credential sources to the auth block of agents.yaml, an optional scopes list on the oidc block, and three examples that put an A2A agent behind Google, Microsoft Entra ID and Amazon Cognito. The site's a2a.md page, section "Authenticating to A2A Agents", documents token_env and oidc only and says "Set exactly one mode per agent, token_env or oidc, not both", which is now out of date.
User-facing behavior to document:
auth.token_file- path of a file holding the bearer token. It is re-read on every request, so a token rotated in place by the kubelet (projected service account token), spiffe-helper (JWT-SVID) or Vault Agent is picked up without a restart. Nothing is provisioned to the CLI.auth.token_command- argv of a command whose trimmed stdout is the bearer token. It runs without a shell under a 10 second timeout. The token is reused until it expires: theexpclaim when it is a JWT, otherwise five minutes. It is honoured from~/.infer/agents.yamlonly. In a project.infer/agents.yamlit is refused withAuthentication failed for A2A agent "<name>": token_command is only read from ~/.infer/agents.yaml, because a project file arrives with a clone and the agent card is fetched without approval. A failing command is reported by its name and exit status, never by its output.auth.oidc.scopes(optional) - scopes requested on top of the ones the agent card lists. Microsoft Entra ID requiresapi://<api app id>/.defaulton client credentials and the ADK card declares no scopes.- Exactly one of
token_env,token_file,token_commandandoidcper agent. infer agents showprintsbearer token from file <path>andbearer token from command <argv[0]>(arguments are not shown).
Examples to add:
# .infer/agents.yaml
agents:
- name: research
url: https://research.example.com
auth:
token_file: /var/run/secrets/kubernetes.io/serviceaccount/token# ~/.infer/agents.yaml
agents:
- name: billing
url: https://billing.example.com
auth:
token_command: [gcloud, auth, print-identity-token, --audiences=https://billing.example.com]| Provider | Command |
|---|---|
| Google Cloud | gcloud auth print-identity-token --audiences=<agent audience> (add --impersonate-service-account off GCP) |
| Microsoft Entra ID | az account get-access-token --resource api://<api app id> --query accessToken -o tsv |
| HashiCorp Vault | vault read -field=token identity/oidc/token/<role> |
auth:
oidc:
client_id: <client app id>
client_secret_env: AZURE_CLIENT_SECRET
issuer_url: https://login.microsoftonline.com/<tenant id>/v2.0
scopes: [api://<api app id>/.default]Affected pages:
a2a.md, "Authenticating to A2A Agents": add "Bearer token from a file" and "Bearer token from a command" subsections between the static token and OIDC subsections, addscopesto the OIDC field list, fix the "exactly one mode" sentence, and link the new examples next to the a2a-auth link.authentication.md, "Identity providers" or "Runnable examples": one line pointing at the CLI side, since this page already lists Entra, Google and Cognito for the gateway.
Source of truth in the CLI repository: docs/agents-configuration.md section "Authentication", and the examples examples/a2a-auth-gcp, examples/a2a-auth-entraid, examples/a2a-auth-aws.
Source PR: inference-gateway/cli#1550
Acceptance Criteria
-
a2a.mddocumentstoken_fileandtoken_commandwith the file-rotation, caching, timeout and userspace-only rules above, and the exactly-one rule names all four sources. -
a2a.mdlistsauth.oidc.scopesin the OIDC field list with the Entra note. -
a2a.mdlinks the a2a-auth-gcp, a2a-auth-entraid and a2a-auth-aws examples. -
authentication.mdpoints at the CLI-side credential options for the providers it already lists.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Oct 6, 2026
@claude can you document this?
inference-gateway-maintainer commentedon Oct 6, 2026
Claude finished @edenreich's task in 2m 32s —— View job •
docs/issue-992-20261006-1951Documenting A2A agent credentials from a file or a command
a2a.mdandauthentication.md, plus the CLI'sdocs/agents-configuration.mdas source of truthtoken_fileandtoken_commandsubsections toa2a.mdauth.oidc.scopeswith the Entra note and fix the "exactly one mode" sentenceauthentication.mdat the CLI-side credential optionslint:md,format:check,buildall pass)What changed
a2a.md, "Authenticating to A2A Agents" - two new subsections sit between the static token and OIDC ones:auth.token_file): re-read on every request, so a token rotated in place by the kubelet, spiffe-helper or Vault Agent is picked up without a restart, and nothing is provisioned to the CLI.auth.token_command): argv rather than a shell line, no shell, 10 second timeout, trimmed stdout, reused until theexpclaim expires or five minutes for a non-JWT, failures reported by name and exit status only. Documents the~/.infer/agents.yaml-only rule with the verbatim error a project file produces and points attoken_fileas the project-file alternative. Includes the Google Cloud / Entra ID / Vault command table.auth.oidc.scopesis now in the OIDC field list with the Entra IDapi://<api app id>/.defaultnote, the scope sentence further down mentions the extra scopes, the "exactly one mode" sentence names all four sources, and the intro notes whatinfer agents showprints for the new modes. The three cloud examples are linked next to the existing a2a-auth link.authentication.md, "Runnable examples" - one line pointing at the CLI-side credential options for the providers the page already lists.Nothing was left out.
Create a PR - already opened as #993
| Branch