cd /news/ai-agents/show-hn-secure-bearer-jwt-and-jwks-p… · home topics ai-agents article
[ARTICLE · art-81745] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Show HN: Secure Bearer JWT and JWKS pattern for headless AI agents (MCP #824)

Mawyxx proposed a security pattern for Model Context Protocol (MCP) that uses bearer JSON Web Tokens (JWT) and JSON Web Key Sets (JWKS) to authenticate headless AI agents without exposing a master secret to the LLM path. The pattern mints short-lived RS256 JWTs with an audience of 'mcp' and a domain claim, verified by the MCP server via JWKS, and is gated behind an environment variable. This addresses the threat model where static keys or human OAuth flows are inadequate for agent-to-MCP authentication.

read1 min views2 publishedJul 31, 2026
Show HN: Secure Bearer JWT and JWKS pattern for headless AI agents (MCP #824)
Image: source

Mawyxxstarted this conversation in

Show and tell

Pre-submission Checklist #

What would you like to share?## Security: Bearer JWT + JWKS for agent callers (no master secret in the LLM path)Headless agents calling MCP tools usually get one of two defaults — both fail a serious threat model: #

That’s what ## Static key vs human OAuth vs JWKS passport

Minimal wire #

Agent host:     opaque mint secret (env / secret manager)  →  never sent to MCP
Agent → LIME:   mint RS256 JWT { aud=mcp, domain=<mcp-host>, TTL≈minutes }
Agent → MCP:    Authorization: Bearer <jwt>
MCP RS:         JWKS verify → authorize by sub

Gate behind env ( If static keys already match the threat model, ignore. If agent auth is heading into review, this is the pattern that usually survives it. ## Relevant Links |

── more in #ai-agents 4 stories · sorted by recency
── more on @mawyxx 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-secure-beare…] indexed:0 read:1min 2026-07-31 ·