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.4.tar.gz (11.5 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.4-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: creduent-0.1.4.tar.gz
  • Upload date:
  • Size: 11.5 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.4.tar.gz
Algorithm Hash digest
SHA256 8a15e13e69598981cd2aae7e0b1a8ff00840d8275bde5a7a4b42339e7a9cf893
MD5 cfafb47db40893dc310a8858d11a258d
BLAKE2b-256 5a811716e5d8eabdf2a3f585be846f7f05c2e4625a9522dc7f45bb7ebf338418

See more details on using hashes here.

File details

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

File metadata

  • Download URL: creduent-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f35d62ccce91421a91fe0ca3d621ab6170dd701863aa9763984818c8351ec05d
MD5 7a3ba9b928065d140b6e895f6b828082
BLAKE2b-256 976cf390b33fdeb55a2dd68acebd868ccc1cb09e468eec0103df4d1165357f96

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