Skip to main content
agentonboard-sdk[fastapi] provides AgentBearerAuth, a FastAPI Depends() security dependency that reads the Bearer token, caches public JWKS keys in memory, verifies the RS256 signature and aud claim, and maps outcomes to HTTP 401, 403, and 500 responses.

Copy-paste agent prompt


1. Install the Python SDK


2. Guard your FastAPI routes

Pass resolver to look up your existing database user by verified email. When resolver returns None, AgentBearerAuth responds with 403 ACCOUNT_REQUIRED:
main.py

Enabling explicit agent signup (POST /api/signup)

Keep agent_auth (auto_create=False) on all regular routes so read and write calls never create accounts as a side effect. Add one dedicated POST /api/signup route using create_agent_account_async:
main.py

3. Token-only verification (without account lookup)

If you omit resolver, AgentBearerAuth verifies the JWT signature and claims and returns AgentIdentity(email=...):
main.py

4. Test with curl

Mint a 5-minute test token using POST /api/v1/token/exchange and call your FastAPI endpoint:

Django

Testing & Production