Skip to main content

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

  1. Sign up at agentink.dev (free during beta)
  2. Go to Dashboard > API Keys and create a new key
  3. 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 with api_url, api_key, optional flush_interval and batch_size
  • start_session(config) -- Create a new session (returns AALSession)
  • session(session_id, agent_id) -- Get a handle to an existing session
  • get_events(params) -- Query events with optional filters
  • get_session(session_id) -- Get session details
  • shutdown() -- 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 blocks
  • wrap_mcp_server(server, session) -- Auto-log MCP tool calls

Documentation

Full documentation at agentink.dev/docs.

License

MIT

Metadata

Release files for aal-sdk 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aal-sdk 0.1.3
File Size Uploaded Provenance
aal_sdk-0.1.3.tar.gz 12.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aal-sdk 0.1.3
File Interpreter ABI Platform
aal_sdk-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / aal_sdk-0.1.3.tar.gz

Download URL aal_sdk-0.1.3.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
925dc27833573e9906e48efdc707ac91b123acbdf908516f230c29bfb18ed934
BLAKE2b-256 checksum
How to use checksums
7330466bd111d52fa984a21825c88fab8f08e6382382afe11e545b21825f2660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Release files / aal_sdk-0.1.3-py3-none-any.whl

Download URL aal_sdk-0.1.3-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e08eb6adf7196ac26eb0cdd4778fb2aabdff37905f7247d152b4a9e4d559a7a
BLAKE2b-256 checksum
How to use checksums
b2b7774d4c0842919ecf5fa5a2c97707cc28d9e820194b3904eebb98eca7ee92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

Security for aal-sdk 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aal_sdk-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page