Python SDK for Open Agent ID — register, sign, and verify AI agent identities
Project description
open-agent-id
Python SDK for Open Agent ID -- register, sign, and verify AI agent identities.
Installation
pip install open-agent-id
Or for development:
pip install -e ".[dev]"
Quick start
Register a new agent
import asyncio
from agent_id import AgentIdentity
async def main():
identity = await AgentIdentity.register(
name="my-search-agent",
capabilities=["search", "summarize"],
api_key="your-platform-key",
)
print(identity.did) # did:agent:tokli:agt_...
print(identity.public_key_base64url)
# IMPORTANT: persist the private key securely -- it is only returned once.
asyncio.run(main())
Load an existing identity
from agent_id import AgentIdentity
identity = AgentIdentity.load(
did="did:agent:tokli:agt_a1B2c3D4e5",
private_key="<base64url-encoded-private-key>",
)
Sign an HTTP request
headers = identity.sign_request("POST", "https://api.example.com/v1/tasks", '{"task":"search"}')
# headers contains X-Agent-DID, X-Agent-Timestamp, X-Agent-Nonce, X-Agent-Signature
Verify another agent's signature
valid = await AgentIdentity.verify(
did="did:agent:other:agt_X9yZ8wV7u6",
payload=canonical_payload,
signature=signature_b64,
)
Look up an agent
info = await AgentIdentity.lookup("did:agent:tokli:agt_a1B2c3D4e5")
print(info["name"], info["status"])
Running tests
pip install -e ".[dev]"
pytest
License
Apache 2.0 -- see LICENSE.
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
open_agent_id-0.1.0.tar.gz
(12.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_agent_id-0.1.0.tar.gz.
File metadata
- Download URL: open_agent_id-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6b6c7bf2f5eed5bd1298ff03461a119ce955631c384a846e7281d6742424692
|
|
| MD5 |
9b5521ecf722bfd5c04a15e5bfc43987
|
|
| BLAKE2b-256 |
6ff81490f3334d253fde48b383e487f18b167dc2e719b086e25677468ae52f58
|
File details
Details for the file open_agent_id-0.1.0-py3-none-any.whl.
File metadata
- Download URL: open_agent_id-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f26b4fe676b2deb6c9b906a88349c749006ec2acb1f2c332f844d9864d53b6f
|
|
| MD5 |
d30c8364a01e415b3f0b8ddfc6300754
|
|
| BLAKE2b-256 |
ea2468fd3ecdb42f36bc920be457a25c279ea90d3929b6137f06e6919108f433
|