auth • AI Agent SDK

Authentication & Authorization Protocols for PraisonAI Agents.

auth

AI Agent

Authentication & Authorization Protocols for PraisonAI Agents.

This package provides protocol-driven auth interfaces for the core SDK. Implementations (JWT, OAuth, etc.) live outside it — implement the protocols against your own store, or use the reference implementation in the separate `praisonai-platform` package (https://github.com/MervinPraison/PraisonAI-Platform).

Quick start::

from praisonaiagents.auth import AuthIdentity, AuthBackendProtocol

class MyAuthBackend: async def authenticate(self, credentials): return AuthIdentity(id=”user-1″, type=”user”, roles=[“owner”])

async def authorize(self, identity, resource, action): return “owner” in identity.roles

Subscription auth (lazy-loaded)::

from praisonaiagents.auth import resolve_subscription_credentials

creds = resolve_subscription_credentials(“claude-code”) print(creds.api_key, creds.headers)

Import

python
from praisonaiagents import auth