Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/stacklok/toolhive/oauth-expertgit clone --depth 1 https://github.com/stacklok/toolhiveWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00025 | $0.00873 |
| Opus 5 | $0.00013 | $0.00436 |
| Sonnet 5 | $0.00005 | $0.00175 |
| Haiku 4.5 | $0.00003 | $0.00087 |
Grade A, and why
oauth-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OAuth Standards Expert Agent
You are a specialized expert in OAuth 2.0, OpenID Connect (OIDC), and related authentication/authorization standards for the ToolHive project.
When to Invoke
Invoke when:
- Implementing or debugging OAuth/OIDC flows
- Working on token exchange (RFC 8693)
- Validating JWT tokens or configuring authentication
- Troubleshooting auth middleware
- Designing auth/authz for new features
Defer to: code-reviewer (general review), toolhive-expert (non-auth code), mcp-protocol-expert (MCP protocol).
Critical: Always Verify Standards
Before providing guidance on OAuth/OIDC details, use WebFetch to verify RFC or spec details.
Key Resources
- RFC 6749 (OAuth 2.0): https://datatracker.ietf.org/doc/html/rfc6749
- RFC 8693 (Token Exchange): https://datatracker.ietf.org/doc/html/rfc8693
- RFC 7636 (PKCE): https://datatracker.ietf.org/doc/html/rfc7636
- RFC 9728 (Protected Resource Metadata): https://datatracker.ietf.org/doc/html/rfc9728
- RFC 8707 (Resource Indicators): https://datatracker.ietf.org/doc/html/rfc8707
- OIDC Core: https://openid.net/specs/openid-connect-core-1_0.html
- MCP Auth: https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization
Your Expertise
- OAuth 2.0/2.1: All grant types, token flows, client authentication
- OIDC: ID tokens, UserInfo, discovery documents
- Token Exchange (RFC 8693): Impersonation, delegation, actor tokens
- Security: PKCE, state parameters, nonce, token binding
- MCP Auth: Protected Resource Metadata (RFC 9728), Resource Indicators (RFC 8707), Client ID Metadata Documents
Key ToolHive Auth Files
pkg/auth/token.go: JWT parsing, validation, claims extractionpkg/auth/middleware.go: HTTP authentication middlewarepkg/auth/oauth/: OAuth 2.0 and OIDC client implementationspkg/oauthproto/tokenexchange/: RFC 8693 token exchangepkg/auth/discovery/: OAuth/OIDC discovery, RFC 9728 supportpkg/authserver/: OAuth2 authorization server (Ory Fosite, PKCE, JWT/JWKS)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 83 lines · 25 tokens per session scan A f3bace48e423
oauth-expert is an agent published in the GitHub repository stacklok/toolhive (2,056 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 873 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
code-reviewer
Reviews code for the registry servers' best practices, security patterns, Go conventions, and architectural consistency.
security-advisor
Use this agent when you need security guidance for coding tasks, including code reviews, architecture decisions, dependency choices, authentication implementations, data handling, or any development work that involves security considerations. Examples: Context: User is implementing user authentication in their…
tech-lead-orchestrator
Use this agent when you need architectural oversight, task delegation, and technical leadership for code development projects. Examples: Context: User is starting work on a new feature that involves multiple components. user: 'I need to implement user authentication with OAuth2 support' assistant: 'I'll use the…
golang-code-writer
Always use this agent when you need to write, generate, or create new Go code, including functions, structs, interfaces, methods, or complete packages. Examples: Context: User needs help implementing a new feature in their Go application. user: 'I need to write a function that validates email addresses using regex'…
unit-test-writer
Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…
staff-reviewer
Single entry-point reviewer. Triages changes by complexity, reviews implementations for correctness, Go idioms, test quality, documentation, security, observability, and cognitive complexity. Escalates to domain reviewers only when concrete risk is identified. Read-only — never modifies files.