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.1.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.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: creduent-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5664ec82212ebc6543c8251f36d1a2c995dd2b84d024c5f04938f861a094fdda
MD5 1cd25c0283b2e219e29f5e92b648d2fc
BLAKE2b-256 0ac450ecbade5d1339bd8762b523d2e7ab86f4bd627a874327e0c0c760f6a886

See more details on using hashes here.

File details

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

File metadata

  • Download URL: creduent-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 accab584b56594e1dd1c97860e772de2e30d4f5771c01b7ae0bd4e38f06cf07d
MD5 6823f6bbb5b5f195e23802ac2f5baf14
BLAKE2b-256 df0137dd9db652dea6d0d62dc83c6f79353900f128f98abc74472017f5a04bfc

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