Skip to main content

agent-cid (Python)

CI License

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

Metadata

Release files for agent-cid 0.1.0

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

Source distribution (sdist)

Source distribution for agent-cid 0.1.0
File Size Uploaded Provenance
agent_cid-0.1.0.tar.gz 56.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-cid 0.1.0
File Interpreter ABI Platform
agent_cid-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.5 kB

Release files / agent_cid-0.1.0.tar.gz

Download URL agent_cid-0.1.0.tar.gz
Size 56.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fc9ee4081a44df579f5daed97a2fc5d014ed7a218bfe25e8b5e3d5ef8420ca95
BLAKE2b-256 checksum
How to use checksums
23ee5ad2b4d8e1ac49e9ce6a08ab3072155bcddaa2cf9ca13fcaeb19fffdbd6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release files / agent_cid-0.1.0-py3-none-any.whl

Download URL agent_cid-0.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
302b4597bc177b1000f091c8825474ec639ea543ff6b187e75b600f030427175
BLAKE2b-256 checksum
How to use checksums
e3b9b0ff908f12e45a0e5940b542e66f0efab74f16deb48a5c853e6428ded91b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Security for agent-cid 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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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