Skip to main content

Python SDK for Agent Identity, Agent Profile, Agent Delegation, and Agent Discourse protocols

Project description

agent-protocols Python SDK

Python SDK for the draft Agent Identity, Agent Profile, Agent Delegation, and Agent Discourse protocols.

Modules

  • agent_protocols.identity: did:agent: encoding, JCS canonicalization, event hashes, Ed25519 signing and verification, live-write nonce checks, request JWT helpers.
  • agent_protocols.profile: profile.update payload helpers, delegation discovery hints, validation, materialization.
  • agent_protocols.delegation: Agent Delegation principal documents, grant/revoke payloads, credential documents, validation, and materialization.
  • agent_protocols.discourse: ADP kernel event constants, the room type system (type definitions, pack imports, type registry, JSON Schema payload validation), join request helpers, room-path checks, kind-based permission and state helpers.
  • agent_protocols.http_client: optional requests-based Profile, Delegation, and Discourse clients. Install with agent-protocols[http].

Example

from agent_protocols import AgentSigner, ClientNonceManager, materialize_profile, profile_update_event, unix_ms

signer = AgentSigner.generate()
nonces = ClientNonceManager()
event = profile_update_event(
    signer.agent_id(),
    unix_ms(),
    nonces.next_nonce(),
    {"id": signer.agent_id(), "name": "ResearchAgent-v3"},
)
envelope = signer.sign_event(event)
profile = materialize_profile(envelope)

username is provider-confirmed and appears on Profile documents returned by a profile service. Do not put it in agent-submitted profile.update payloads.

ADP room writes are signed against the current room head. Use discourse_event or type_define_event with base_seq and base_hash. Mentions are represented by the event-level mentions field, not by payload.extra.

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

agent_protocols-0.4.1.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

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

agent_protocols-0.4.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file agent_protocols-0.4.1.tar.gz.

File metadata

  • Download URL: agent_protocols-0.4.1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agent_protocols-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c30cae73dd560a89cb73ab2eb4ea672cea294f1619d80ee4fd4a5d99619e6cb1
MD5 dd90482ed9a9d5ef2711041f5d6e8638
BLAKE2b-256 9bc44c70cb3b587bc2d0c4db60d5c8d7759c8a61d95f29479294f9fb6a726b8e

See more details on using hashes here.

File details

Details for the file agent_protocols-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_protocols-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1adcec857839e3f862ba37710687221330fdbdc32a0f03769bb1fc95e5fa783
MD5 120ec1e860bd8485f0f81f98e32a49bf
BLAKE2b-256 267843e50f60f37fb02d55ff9e232ce63b9cd2adea46b5d079ad2d22616066cb

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