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.3.tar.gz (11.4 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.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: creduent-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 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.3.tar.gz
Algorithm Hash digest
SHA256 f4df1e66810311ce2d622a3164bda55cd8da8b45464503093fa334219b11160d
MD5 c4dc22ce8db7d7f2ca2b98770d0f6806
BLAKE2b-256 15cfc6743331a3050cb4637731e3ee6c1ab005c81b40d7a3719f439e18222e00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: creduent-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 18a8c3633e40aa5d26cf616d1a6044a93dc56f37fdeaf329c6100a85aab97eb3
MD5 90c55c28e6df80f3ce2edffda65644fa
BLAKE2b-256 e3b417fabe4f1ca1718571116bcef0d334446b70119f820ecd5fca905a1c7434

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