Vendor-neutral identity verifier for AI agents
Project description
demarche (Python)
Vendor-neutral identity verification for AI agents.
Demarche sits between your application and agent-identity issuers (Microsoft Entra Agent ID, Auth0 for AI Agents, any OAuth OBO issuer). Integrate once, verify agents from any issuer.
Install
pip install demarche # core + OAuth OBO + Entra/Auth0
pip install 'demarche[fastapi]' # + FastAPI integration
Quickstart
from demarche import Verifier, entra_agent_id
verifier = Verifier(adapters=[
entra_agent_id(
tenant_id="<your-azure-tenant-id>",
audience="api://your-app",
),
])
result = await verifier.verify(token)
result.principal_id # the user who delegated authority
result.agent_id # the agent acting on the user's behalf
result.scopes # what the agent is authorized to do
result.audit_id # opaque ID for log correlation
For Auth0:
from demarche import Verifier, auth0_ai_agents
verifier = Verifier(adapters=[
auth0_ai_agents(
domain="myapp.us.auth0.com",
audience="https://api.myapp.com",
),
])
For any other OAuth OBO issuer:
from demarche import Verifier, OAuthOBOAdapter, JWKSKeyProvider
verifier = Verifier(adapters=[
OAuthOBOAdapter(
issuer="https://your-issuer.example/",
audience="https://your-api.example",
key_provider=JWKSKeyProvider(
"https://your-issuer.example/.well-known/jwks.json"
),
),
])
FastAPI integration
from demarche.fastapi import DemarcheAuth
auth = DemarcheAuth(verifier)
@app.get("/whoami")
async def whoami(
agent: Annotated[VerificationResult, Depends(auth.require_agent)],
):
return {"user": agent.principal_id, "agent": agent.agent_id}
@app.post("/book-meeting")
async def book_meeting(
agent: Annotated[
VerificationResult,
Depends(auth.require_scope("calendar.write")),
],
):
return {"booked_by": agent.principal_id}
A complete runnable example lives at
examples/fastapi-app/.
Status
Pre-alpha — API surface is stabilising. See the project README and spec for full details.
License
Apache 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file demarche-0.0.0.tar.gz.
File metadata
- Download URL: demarche-0.0.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74c6f330e1882f3c5f04aa732e9ab317b16a0155db1c86e8164c4947005007e6
|
|
| MD5 |
0118f57affd5cd32b2ff13cd4f7c00e1
|
|
| BLAKE2b-256 |
9115b8dafb298b6d854994c6fd5a7fd295f389d3394adcc18695928da217e85d
|
Provenance
The following attestation bundles were made for demarche-0.0.0.tar.gz:
Publisher:
publish.yml on deeplethe/demarche
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demarche-0.0.0.tar.gz -
Subject digest:
74c6f330e1882f3c5f04aa732e9ab317b16a0155db1c86e8164c4947005007e6 - Sigstore transparency entry: 1566819317
- Sigstore integration time:
-
Permalink:
deeplethe/demarche@611c490fbc498ef5fe88894706424830cd21f2d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deeplethe
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@611c490fbc498ef5fe88894706424830cd21f2d4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file demarche-0.0.0-py3-none-any.whl.
File metadata
- Download URL: demarche-0.0.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa7a5b6a60026e5dc224d36383c278d7d835cc3d715fa8fb6c9ed06ffb35642a
|
|
| MD5 |
c8aa98556dfbf64b0c0440d6c67602f5
|
|
| BLAKE2b-256 |
5aa74dccd93af548ebe5de7d06a3307ba632e12022c6d64495f804df2a835a39
|
Provenance
The following attestation bundles were made for demarche-0.0.0-py3-none-any.whl:
Publisher:
publish.yml on deeplethe/demarche
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demarche-0.0.0-py3-none-any.whl -
Subject digest:
fa7a5b6a60026e5dc224d36383c278d7d835cc3d715fa8fb6c9ed06ffb35642a - Sigstore transparency entry: 1566819339
- Sigstore integration time:
-
Permalink:
deeplethe/demarche@611c490fbc498ef5fe88894706424830cd21f2d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deeplethe
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@611c490fbc498ef5fe88894706424830cd21f2d4 -
Trigger Event:
workflow_dispatch
-
Statement type: