Self-custody DID + capability VC profile for AI agents (Python port of @p-vbordei/agent-id)
Project description
agent-id (Python)
Idiomatic Python port of
@p-vbordei/agent-id. Self-custody DID + capability Verifiable Credential profile for AI agents. Byte-deterministic-compatible with the TypeScript reference: passes the same C1 / C2 / C3 conformance vectors. 17 tests pass.
What's in the box
generate_key_pair()/did_key_from_public_key()— Ed25519 keys +did:keycodec.issue(opts)— sign a Capability VC with theeddsa-jcs-2022cryptosuite.verify(vc)— JSON-Schema → validity window → signature → DID resolution, accumulating errors.resolve(did)—did:key(offline) anddid:web(HTTP, with timeout + response cap) resolution.
Install
pip install agent-id
# or
uv add agent-id
Quickstart
import asyncio
from agent_id import IssueOptions, did_key_from_public_key, generate_key_pair, issue, verify
async def main() -> None:
principal = generate_key_pair()
agent = generate_key_pair()
vc = await issue(IssueOptions(
principal=principal,
subject={
"id": did_key_from_public_key(agent.public_key),
"type": "Agent",
"principal": did_key_from_public_key(principal.public_key),
"model": {"vendor": "anthropic", "id": "claude-opus-4-7"},
"capability": {"action": "answer", "sla": {"latency_ms_p95": 2000}},
"valid_from": "2026-04-24T00:00:00.000Z",
},
))
result = await verify(vc)
print(f"issued VC for {vc['credentialSubject']['id']}")
print(f"verified = {result.verified}")
asyncio.run(main())
Run it:
python examples/quickstart.py
How it relates
| Language | Repo | Notes |
|---|---|---|
| TypeScript (reference) | agent-id | canonical spec, conformance suite |
| Python | agent-id-py | this repo |
| Rust | agent-id-rs | sibling port |
All three implementations produce byte-identical output for serialization-critical surfaces. See docs/architecture.md for details.
Conformance
uv run pytest -v # runs the same C1 / C2 / C3 vectors as the TS reference
Vectors in vectors/ are copied verbatim from the TS conformance suite. Pass / fail behaviour matches byte-for-byte.
Architecture
See docs/architecture.md for the module layout, dependency choices, and byte-determinism invariants.
Development
git clone https://github.com/p-vbordei/agent-id-py
cd agent-id-py
uv venv -p 3.13
uv pip install -e ".[dev]"
uv run pytest -v
uv run ruff check .
Contributions welcome — see CONTRIBUTING.md.
License
Apache-2.0 — see LICENSE.
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 kindred_agent_id-0.1.0.tar.gz.
File metadata
- Download URL: kindred_agent_id-0.1.0.tar.gz
- Upload date:
- Size: 74.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de6abfdca246731cc76818e3979ee9bf4204f623f09830b12b0bf0178ee2224d
|
|
| MD5 |
ad3416c70562a43be72cca659f56fdfd
|
|
| BLAKE2b-256 |
b4eff7dc8fc003bd6c0c745839b2a528019e0a0562d8010b6881574b1617d771
|
Provenance
The following attestation bundles were made for kindred_agent_id-0.1.0.tar.gz:
Publisher:
publish.yml on p-vbordei/agent-id-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kindred_agent_id-0.1.0.tar.gz -
Subject digest:
de6abfdca246731cc76818e3979ee9bf4204f623f09830b12b0bf0178ee2224d - Sigstore transparency entry: 1591083366
- Sigstore integration time:
-
Permalink:
p-vbordei/agent-id-py@73599c0de8bd75793418757827e3f12e2e29f0ad -
Branch / Tag:
refs/heads/main - Owner: https://github.com/p-vbordei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73599c0de8bd75793418757827e3f12e2e29f0ad -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file kindred_agent_id-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kindred_agent_id-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 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 |
27bb5e0629f086383c4e0a53307dd70508694eac5a54495a288cbe4dbfd06eba
|
|
| MD5 |
81112249a385664edc62f17c36e878be
|
|
| BLAKE2b-256 |
b5a1553fca5c1b9462629145e2927f76ebd5faa07c290072c4f535af851ad454
|
Provenance
The following attestation bundles were made for kindred_agent_id-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on p-vbordei/agent-id-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kindred_agent_id-0.1.0-py3-none-any.whl -
Subject digest:
27bb5e0629f086383c4e0a53307dd70508694eac5a54495a288cbe4dbfd06eba - Sigstore transparency entry: 1591083406
- Sigstore integration time:
-
Permalink:
p-vbordei/agent-id-py@73599c0de8bd75793418757827e3f12e2e29f0ad -
Branch / Tag:
refs/heads/main - Owner: https://github.com/p-vbordei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73599c0de8bd75793418757827e3f12e2e29f0ad -
Trigger Event:
workflow_dispatch
-
Statement type: