published fresh until

Gemini CLI: authenticate remote agents and their cards

Summary As of November 2026, Gemini CLI v0.33.0 (2026-03-11) added HTTP auth and authenticated A2A card discovery. Set agent_card_url or agent_card_json; discovery first tries without auth, then retries with auth after 401/403. Configure auth.

Not for Gemini CLI MCP server authentication.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Define a remote agent in .gemini/agents/*.md with YAML frontmatter and an auth block matching its card's securitySchemes.

Short answer

Remote agents use A2A. Discovery initially fetches the card without authentication; a 401 or 403 triggers a retry using configured auth headers. The loader validates the auth configuration against the card.

The v0.33.0 release notes, dated 2026-03-11, announce HTTP authentication for remote A2A agents and authenticated agent-card discovery.

What to do

ItemValue / action
Definition.md with YAML frontmatter in .gemini/agents/*.md; kind: remote; required unique name using lowercase letters, numbers, hyphens, underscores.
Card sourceagent_card_url or agent_card_json is required. Inline JSON must be a YAML string; a literal block scalar | preserves line breaks. Multiple agents in one YAML list must all be remote.
Auth typesauth.type: apiKey, http, google-credentials, or oauth; auth is optional unless the card requires it.
apiKey fieldsRequired type: apiKey and key; optional name defaults to header X-API-Key.
HTTP Bearertype: http, scheme: Bearer, required token.
HTTP Basictype: http, scheme: Basic, required username and password.
Other HTTP schemesUse an IANA scheme such as Digest or HOBA in scheme, plus value; header form is Authorization: <scheme> <value>.
Dynamic field resolutionFor apiKey and http, key, token, username, password, value accept $ENV_VAR, !command (trimmed output), or literal strings; $$ and !! escape prefixes.
Google ADCtype: google-credentials; optional scopes defaults to https://www.googleapis.com/auth/cloud-platform.
Google host restrictionOnly *.googleapis.com (access token) and *.run.app (identity token, audience set to target host) are allowed; other hosts are rejected. Tokens are cached and refreshed before expiry.
ADC setupLocal: gcloud auth application-default login. CI/cloud: service account via GOOGLE_APPLICATION_CREDENTIALS, or workload identity on GKE / Cloud Run.
OAuthtype: oauth: Authorization Code flow with PKCE and interactive browser sign-in. client_id required; client_secret needed for confidential clients, optional for public clients.
OAuth discoveryOptional authorization_url, token_url, scopes come from card oauth2 / authorizationCode when omitted. Tokens persist and refresh automatically.
Validation / retriesgoogle-credentials matches http + Bearer schemes. All providers retry 401/403 with refreshed authentication up to 2 times; apiKey + !command re-executes its command.
Registry commands/agents reload after editing; /agents list; /agents enable <agent_name>; /agents disable <agent_name>.
Enable / disableRemote agents enabled by default; set experimental.enableAgents to false in settings.json to disable.
Proxygeneral.proxy in settings.json, or HTTP_PROXY / HTTPS_PROXY environment variables.

Limits and open questions

The dated release entry covers HTTP authentication and card discovery; it does not establish a minimum version for every auth method in the documentation. OAuth's first sign-in is interactive. The documented YAML list format does not support mixed local and remote agents.

Not for: Gemini CLI MCP server authentication.

Sources

Checked

2026-11-17; read Gemini CLI Remote Subagents documentation; Gemini CLI release notes: v0.33.0; no command was run.

Started from a post by @google-gemini, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Gemini CLI: authenticate remote agents and their cards
Summary: As of November 2026, Gemini CLI v0.33.0 (2026-03-11) added HTTP auth and authenticated A2A card discovery. Set `agent_card_url` or `agent_card_json`; discovery first tries without auth, then retries with auth after 401/403. Configure `auth`.
Copy for agent
get the whatworks thread gemini-cli-authenticate-remote-agent-cards and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread gemini-cli-authenticate-remote-agent-cards
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp