agentid-core (Python)
Reference Python library for issuing and verifying Agent Passports and Delegation Chains as defined in SPEC.md.
Install
The package is not yet published to PyPI. From the repository root:
python3 -m venv .venv && source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ./sdks/python
For local development from this repo:
cd sdks/python
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
Issue a passport
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from agentid import Passport
key = Ed25519PrivateKey.generate()
passport = Passport.issue(
issuer="did:agentid:org:acme",
subject="did:agentid:agent:orchestrator-01",
audience="mcp://tools.acme.internal",
capabilities=["tool:sql_read", "tool:http_get"],
private_key=key,
ttl_seconds=3600,
)
print(passport.token) # compact JWS for the X-Agent-Passport header
Delegate with attenuation
from agentid import Caveat, DelegationChain
chain = DelegationChain.start(
parent=passport,
delegatee="did:agentid:agent:subagent-01",
capabilities=["tool:sql_read"], # subset of the parent
private_key=key,
caveats=[Caveat("tool_allowlist", ["sql_read"])],
)
print(chain.to_header()) # value for the X-Delegation-Chain header
Attempting to grant a capability the parent does not hold raises
AgentIDError(ErrorCode.ATTENUATION_VIOLATION).
Verify a request
from agentid import verify_request
result = verify_request(
passport_token=passport.token,
resolve_key=lambda iss: key.public_key(), # your key resolver
chain_header=chain.to_header(),
audience="mcp://tools.acme.internal",
required_capability="tool:sql_read",
request_context={"tool": "sql_read"},
)
print(result.subject, result.capabilities)
Verification is fail-closed: any failure raises AgentIDError with a stable
ErrorCode (see SPEC.md §7).
API surface
| Symbol | Purpose |
|---|---|
Passport |
Issue, verify, and inspect agent passports. |
DelegationChain |
Build and verify attenuated delegation chains. |
Caveat |
Restrict capabilities at request time. |
verify_request |
One-call verification for middleware. |
AgentIDError / ErrorCode |
Deterministic failure handling. |
Metadata
Release files for agentid-core 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentid_core-0.1.0.tar.gz | 15.7 kB | With provenance | Details for agentid_core-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentid_core-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agentid_core-0.1.0-py3-none-any.whl |
Total release size: 30.9 kB
Release files / agentid_core-0.1.0.tar.gz
| Download URL | agentid_core-0.1.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f49a890496279c7326daa7dfb000c140c7b62f5e4f92685295d4c993984f600c
|
|
BLAKE2b-256 checksum How to use checksums |
02009d7c7d616543ba3f00c2d535d0190ad38644f72d2e795efb351660bae3c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logRelease files / agentid_core-0.1.0-py3-none-any.whl
| Download URL | agentid_core-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b55d00cdac66b5e898200384e94ac7ee0c1d980b7043095be6bb9c044178454
|
|
BLAKE2b-256 checksum How to use checksums |
15f14aceea0f09ab5a6f8b5745445201c1123661b4b40c559e69d66ce8a502bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logSecurity for agentid-core 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agentid_core-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logA 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.