Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

caracalai-asgi

ASGI middleware for Caracal mandate verification. Protects FastAPI, Starlette, Quart, and any other ASGI application with fail-closed verification of Caracal-issued mandates.

Part of Caracal: the identity and authorization layer for AI agents - short-lived, policy-approved authority instead of credentials.

Install

pip install caracalai-asgi

Use

from caracalai_asgi import CaracalASGIAuth
from caracalai_revocation import InMemoryRevocationStore
from fastapi import FastAPI

app = FastAPI()
app.add_middleware(
    CaracalASGIAuth,
    audience="resource://billing-api",
    revocations=InMemoryRevocationStore(),
    routes={"/payouts": {"required_scopes": ["billing:payout"], "require_delegation": True}},
    exclude=["/healthz"],
)

The issuer defaults to CARACAL_STS_URL and the zone to CARACAL_ZONE_ID. Verified claims are available as request.state.caracal.

Metadata

Release files for caracalai-asgi 0.2.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for caracalai-asgi 0.2.0rc1
File Size Uploaded Provenance Actions
caracalai_asgi-0.2.0rc1.tar.gz 8.3 kB Without provenance Details for caracalai_asgi-0.2.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for caracalai-asgi 0.2.0rc1
File Interpreter ABI Platform Actions
caracalai_asgi-0.2.0rc1-py3-none-any.whl Python 3 none any Details for caracalai_asgi-0.2.0rc1-py3-none-any.whl

Total release size: 16.6 kB

Release files / caracalai_asgi-0.2.0rc1.tar.gz

Download URL caracalai_asgi-0.2.0rc1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eaac124682132afd9c6e448e834180f892fb7233351b17653c9228fc4e64d762
BLAKE2b-256 checksum
How to use checksums
04f166853f612550143bcc58bc708dd0c856fdd012eed0e2a60894cf0a7cd213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / caracalai_asgi-0.2.0rc1-py3-none-any.whl

Download URL caracalai_asgi-0.2.0rc1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78dfc5a7b01f17f3a056f10d9c1223f86b0845cd911b5d58cb6a409a4af5fb7e
BLAKE2b-256 checksum
How to use checksums
90b1885f90564a2d77d0a2cd0b07d29321e5b4ca53d6e00984580d983b7d828d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Security for caracalai-asgi 0.2.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page