-
Notifications
You must be signed in to change notification settings - Fork 657
Support auth.md-based capability discovery for agent and MCP clients #677
Copy link
Copy link
Closed
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Metadata
Metadata
Assignees
Labels
P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Priority
None yet
Problem
gogcli is explicitly built for coding agents, CI pipelines, and MCP clients. It already has strong foundations for agent-safe execution: named OAuth clients, keyring backends, command allowlists/denylists (
--enable-commands-exact), baked safety-profile binaries, and a typed MCP server (gog mcp) that deliberately avoids a generic command bridge.However, there is currently no structured way for an agent or MCP client to discover:
Right now, agents must either be pre-configured out-of-band or probe blindly. This creates friction in autonomous harnesses and multi-agent orchestration where the agent runtime doesn't know what the tool is allowed to do.
Proposed Feature
Add optional support for
auth.md-based capability discovery, specifically tailored to gogcli's existing agent-safety model.Building on what already exists:
gog schema --jsonexposes the command/flag schema--enable-commands-exactdefines allowed command surfacesgog mcpexposes a typed, read-only-by-default MCP stdio serverThe proposal is to extend this with a machine-readable auth and capability document that agent clients can discover at startup.
What gogcli could expose
gmail.modify,drive,calendar)Possible interfaces
For HTTP/SSE deployments of the MCP server, this could also be exposed as a well-known endpoint:
Why This Matters for gogcli Specifically
gogcli is increasingly used inside agent runtimes (Claude Code, OpenClaw, Codex, Gemini CLI) via the MCP server. In these environments:
drivewrite access or is read-only--gmail-no-sendis active without attempting a sendStructured capability discovery would let the agent adapt its behavior before calling tools, rather than learning constraints through failures.
Suggested Implementation Ideas
Possible architecture (lightweight, non-breaking):
gog agent auth-infosubcommand under the existinggog agentgroupgog_capabilitiesregistered alongside existing typed tools ingog mcp/.well-known/capabilities.jsonfor HTTP transport modePotential flow for an agent runtime:
gog_capabilitiestool immediatelySecurity Considerations
The implementation should avoid:
Prefer:
gog agentcommandsgog mcpphilosophyThis would make gogcli a first-class citizen in agentic workflows — not just a tool that agents call, but one that agents can reason about before calling.
Reference
Official
auth.mdspecification and format: https://github.com/workos/auth.md