Python SDK for the Agent Action Ledger API
Project description
aal-sdk (Python)
Python SDK for Agent Ink — the audit trail and logging API for AI agents. Full parity with the TypeScript SDK.
Getting Started
- Sign up at agentink.dev (free during beta)
- Go to Dashboard > API Keys and create a new key
- Install the SDK and use your key in the examples below
Installation
pip install aal-sdk
With optional integrations:
pip install aal-sdk[anthropic] # Anthropic client wrapper
pip install aal-sdk[mcp] # MCP server wrapper
Quick Start
import asyncio
from aal_sdk import AALClient
async def main():
client = AALClient({
"api_url": "https://api.agentink.dev",
"api_key": "your-api-key",
})
session = client.start_session({"agent_id": "my-agent"})
session.log_action({
"action_type": "TOOL_CALL",
"tool_name": "get_weather",
"parameters": {"city": "London"},
"response": {"temp": 15},
"status": "SUCCESS",
"latency_ms": 42,
})
await client.shutdown()
asyncio.run(main())
Auto-Instrumentation
Anthropic Client
from aal_sdk import AALClient
from aal_sdk.anthropic import wrap_anthropic_client
from anthropic import AsyncAnthropic
client = AALClient({"api_url": "...", "api_key": "..."})
session = client.start_session({"agent_id": "claude-agent"})
anthropic = wrap_anthropic_client(AsyncAnthropic(), session)
# All tool_use blocks are now automatically logged
MCP Server
from aal_sdk import AALClient
from aal_sdk.mcp import wrap_mcp_server
from mcp import Server
client = AALClient({"api_url": "...", "api_key": "..."})
session = client.start_session({"agent_id": "mcp-agent"})
server = Server("my-server")
wrap_mcp_server(server, session)
# All tool calls are now automatically logged
API Reference
AALClient
AALClient(config)-- Create a client withapi_url,api_key, optionalflush_intervalandbatch_sizestart_session(config)-- Create a new session (returnsAALSession)session(session_id, agent_id)-- Get a handle to an existing sessionget_events(params)-- Query events with optional filtersget_session(session_id)-- Get session detailsshutdown()-- Drain buffer and close connections
AALSession
log_action(input)-- Log an action event (buffered, auto-flushed)
Wrappers
wrap_anthropic_client(client, session)-- Auto-log Anthropic tool_use blockswrap_mcp_server(server, session)-- Auto-log MCP tool calls
Documentation
Full documentation at agentink.dev/docs.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 aal_sdk-0.1.3.tar.gz.
File metadata
- Download URL: aal_sdk-0.1.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925dc27833573e9906e48efdc707ac91b123acbdf908516f230c29bfb18ed934
|
|
| MD5 |
709937d1f3d47b4a6fc99a75d3ded355
|
|
| BLAKE2b-256 |
7330466bd111d52fa984a21825c88fab8f08e6382382afe11e545b21825f2660
|
Provenance
The following attestation bundles were made for aal_sdk-0.1.3.tar.gz:
Publisher:
publish-python.yml on diegobkc/agent-action-ledger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aal_sdk-0.1.3.tar.gz -
Subject digest:
925dc27833573e9906e48efdc707ac91b123acbdf908516f230c29bfb18ed934 - Sigstore transparency entry: 1019194422
- Sigstore integration time:
-
Permalink:
diegobkc/agent-action-ledger@4bf4888f7e4946ad893458166b54db3142bba628 -
Branch / Tag:
refs/tags/sdk-python-v0.1.3 - Owner: https://github.com/diegobkc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4bf4888f7e4946ad893458166b54db3142bba628 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aal_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: aal_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e08eb6adf7196ac26eb0cdd4778fb2aabdff37905f7247d152b4a9e4d559a7a
|
|
| MD5 |
616147c923ace30b0b788c5bad5fb444
|
|
| BLAKE2b-256 |
b2b7774d4c0842919ecf5fa5a2c97707cc28d9e820194b3904eebb98eca7ee92
|
Provenance
The following attestation bundles were made for aal_sdk-0.1.3-py3-none-any.whl:
Publisher:
publish-python.yml on diegobkc/agent-action-ledger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aal_sdk-0.1.3-py3-none-any.whl -
Subject digest:
4e08eb6adf7196ac26eb0cdd4778fb2aabdff37905f7247d152b4a9e4d559a7a - Sigstore transparency entry: 1019194617
- Sigstore integration time:
-
Permalink:
diegobkc/agent-action-ledger@4bf4888f7e4946ad893458166b54db3142bba628 -
Branch / Tag:
refs/tags/sdk-python-v0.1.3 - Owner: https://github.com/diegobkc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4bf4888f7e4946ad893458166b54db3142bba628 -
Trigger Event:
push
-
Statement type: