agent-cid (Python)
Python port of
@p-vbordei/agent-cid. Content-addressed artifact manifest for AI agents — CIDv1 + Ed25519 + DID + RFC 8785 JCS. Byte-deterministic-compatible with the TypeScript reference: passes the same C1–C5 conformance vectors.
Install
pip install agent-cid
Usage
import asyncio
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from agent_cid import build, verify, pubkey_to_did_key, BuildOpts, SignerInput
async def main():
priv = Ed25519PrivateKey.generate()
pub = priv.public_key().public_bytes(
serialization.Encoding.Raw, serialization.PublicFormat.Raw,
)
did = pubkey_to_did_key(pub)
manifest = await build(
b"hello world",
BuildOpts(
producer_did=did,
schema_uri="https://example.org/schema",
media_type="text/plain",
signers=[SignerInput(did=did, sign_fn=lambda b: priv.sign(b))],
),
)
r = await verify(manifest, b"hello world")
print(r.ok) # True
asyncio.run(main())
Conformance
pip install -e ".[dev]"
pytest -v
Vectors in vectors/ are copied verbatim from the TS conformance suite.
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agent_cid-0.1.0.tar.gz
(56.7 kB
view details)
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
agent_cid-0.1.0-py3-none-any.whl
(13.8 kB
view details)
File details
Details for the file agent_cid-0.1.0.tar.gz.
File metadata
- Download URL: agent_cid-0.1.0.tar.gz
- Upload date:
- Size: 56.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9ee4081a44df579f5daed97a2fc5d014ed7a218bfe25e8b5e3d5ef8420ca95
|
|
| MD5 |
541c4e503d681e2e85ddf7e396bd67eb
|
|
| BLAKE2b-256 |
23ee5ad2b4d8e1ac49e9ce6a08ab3072155bcddaa2cf9ca13fcaeb19fffdbd6d
|
File details
Details for the file agent_cid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_cid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
302b4597bc177b1000f091c8825474ec639ea543ff6b187e75b600f030427175
|
|
| MD5 |
d571be04c2cabb9292bf0cc7dfc89429
|
|
| BLAKE2b-256 |
e3b9b0ff908f12e45a0e5940b542e66f0efab74f16deb48a5c853e6428ded91b
|