Skip to main content

Creduent Protocol SDK — cryptographic identity for AI agents

Project description

Creduent Python SDK

The official Python SDK for the Creduent Protocol - a federated, open trust-verification layer and cryptographic identity infrastructure for autonomous AI agents.

Installation

Install the self-contained package from PyPI with a single command:

pip install creduent

Quickstart

Below is a complete quickstart demonstrating keypair generation, self-signing, verification, registration, and attestation resolution using the SDK.

from creduent import (
    generate_keys,
    sign,
    verify,
    register,
    attest,
    CreduEntError
)

try:
    # 1. Generate a new Ed25519 keypair
    private_key_pem, public_key_str = generate_keys()
    print(f"Generated Public Key: {public_key_str}\n")

    # 2. Sign a draft agent.json document
    draft_document = {
        "agent_id": "agent://creduent/reconbot",
        "owner": "Creduent",
        "public_key": public_key_str,
        "endpoint": "https://api.idevsec.com/recon",
        "capabilities": ["osint", "dns_lookup", "vulnerability_scan"]
    }
    
    signed_doc = sign(draft_document, private_key_pem)
    print("Signed agent.json:")
    print(signed_doc)
    print()

    # 3. Verify a self-signed agent.json (from dict, URL, domain, or agent:// URI)
    # Verification with a document dictionary
    result = verify(signed_doc)
    print(f"Self-Signed Verification Result (dict): {result.valid}")
    
    # Verification with a live agent URL
    live_result = verify("https://api.idevsec.com/.well-known/agent.json")
    print(f"Live Verification Result (URL): {live_result.valid}")
    print(f"Live Agent ID: {live_result.agent_id}")
    print(f"Live Capabilities: {live_result.capabilities}\n")

    # 4. Register an agent with the Creduent registry
    # Returns RegisterResult with success (bool), attestation (dict|None), error (str|None)
    reg_result = register(
        agent_id="agent://creduent/reconbot",
        domain="api.idevsec.com",
        agent_json_url="https://api.idevsec.com/.well-known/agent.json"
    )
    print(f"Registration Successful: {reg_result.success}")
    print(f"Attestation: {reg_result.attestation}\n")

    # 5. Fetch and validate an active attestation for an agent
    # Returns AttestResult with attested (bool), level (str), issued_at, expires_at, error (str|None)
    attest_result = attest("agent://creduent/reconbot")
    print(f"Is Attested: {attest_result.attested}")
    print(f"Attestation Level: {attest_result.level}")
    print(f"Issued At: {attest_result.issued_at}")
    print(f"Expires At: {attest_result.expires_at}\n")

except CreduEntError as e:
    print(f"Creduent Protocol Error occurred: {e}")

Protocol Specification

For full information on the cryptographic standards, JCS canonicalization, and the federated verification workflows, read the complete Creduent Protocol Specification.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

creduent-0.1.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

creduent-0.1.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file creduent-0.1.2.tar.gz.

File metadata

  • Download URL: creduent-0.1.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for creduent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98ec11f8c29a7d19ff6669428e81f5cc0419d5de5eae33dcc7eefa8558203e8b
MD5 617bf520bc12fef71fe0fa2a88322f0f
BLAKE2b-256 081a55ac52b46b9ceab100018aaee9cd86935810efd3ea980d6fa27f2dd54f3c

See more details on using hashes here.

File details

Details for the file creduent-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: creduent-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for creduent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 549e250345f02dfcfddd93dda1a071c3ff08fd78b35d65ec48438299301fc08e
MD5 939bbc0b09a6e2999a9935fa3caec855
BLAKE2b-256 ab494275edab06a91d1d2d6036abb25d9d3a79abdfc0ad9ad376ed4778d8bc19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page