Catalog PyPI
PACKAGE EXPLORERView in registry

agentity-sdk-python

PyPI

Agentity Protocol Python SDK — identity, signer, LangChain integration

Versions collected1
Direct dependencies8From release 0.1.2
Last observed20 Oct, 22:29 UTC

README

Version 0.1.2 documentation

agentity-sdk-python

Python SDK for the Agentity Protocol. Create agent identities, sign HTTP requests, verify tokens, integrate with LangChain and CrewAI.

Installation

pip install agentity-sdk-python

Usage

Create an agent identity

from agentity_sdk import AgentKeyPair

kp = AgentKeyPair()
aid = kp.create_identity(
    owner_did="did:agentity:human:alice",
    scopes=["stripe:payments:read", "calendar:events:write"],
    ttl_days=30,
)
print(f"DID: {aid.did}")
print(f"Signature valid: {aid.verify_signature()}")

Sign HTTP requests

from agentity_sdk import RequestSigner

signer = RequestSigner(kp, aid)
headers = signer.sign_request("GET", "/api/v1/payments")
# {
#   "Agentity-Token": "<base64(AID)>.<base64(sig)>",
#   "Agentity-Nonce": "<uuid-v4>",
#   "Agentity-Timestamp": "<ISO-8601>",
# }

Verify on the server side

from agentity_sdk import RequestVerifier

verifier = RequestVerifier()
used_nonces = set()
aid = verifier.verify_request(
    headers, "GET", "/api/v1/payments",
    used_nonces=used_nonces,
)

Rotate keys

new_aid = kp.rotate(aid, ttl_days=90)
print(f"Version: {new_aid.version}")       # 2
print(f"Previous AID: {new_aid.previousAid}")

LangChain integration

from agentity_sdk.integrations.langchain import AgentityLangChainMixin

class MyAgent(AgentityLangChainMixin):
    def run(self):
        headers = self._agentity_sign_headers("POST", "https://api.example.com/data")
        print(f"Agent DID: {self.agentity_did()}")

Provider manifest

from agentity_sdk import ProviderManifest, ScopeEntry, ScopeRisk

manifest = ProviderManifest(
    provider="did:agentity:provider:stripe",
    name="Stripe",
    description="Payment processing API",
    scopes=[
        ScopeEntry(id="payments:read", description="Read payments", risk=ScopeRisk.LOW),
        ScopeEntry(id="payments:write", description="Create payments", risk=ScopeRisk.HIGH),
    ],
)

Public API

ExportDescription
AgentKeyPairEd25519 keypair + create_identity() + rotate()
AgentIdentityPydantic model — DID, scopes, proof, status
AgentDidDID string builder
RequestSignerSign HTTP requests with Agentity headers
RequestVerifierVerify tokens server-side
ProviderManifestPublish service scope definitions
AgentityLangChainMixinMixin for LangChain agents

Tests

pip install -e .[dev]
pytest tests/

License: Apache 2.0

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.217 May 20268

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
agenttity/agentity

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:29 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:20b74bc4af7a1656d5346d9b61e9a2f1c71d314397a3a1168f0dc83085d7d3b5