Skip to main content

aiap-client — AI Agency Protocol SDK

Identity is persistent. Agency is ephemeral.

Python SDK for the AI Agency Protocol (AIAP). Enables agents to request scoped, time-limited authority from a central broker.

Install

pip install aiap-client
pip install aiap-client[aws]   # + boto3 for credential sessions
pip install aiap-client[cert]  # + cryptography for certificate auth

Quick Start

from aiap_client import AgencyClient, AgencyLevel

client = AgencyClient(
    broker_url="https://broker.example.com",
    agent_id="YXFQTW0VCL",
    mac_secret="your-hmac-secret",
)

# Request JIT credentials
grant = await client.request_agency(
    intent="Invoke underwriting model",
    use_case="underwriting",
    resources=["bedrock:InvokeModel"],
    duration_seconds=900,
)

if grant.granted:
    session = grant.to_boto3_session(region="us-east-1")
    bedrock = session.client("bedrock-runtime")
    # Invoke with scoped creds — expires in 15 min
else:
    print(f"Denied: {grant.reason}")

Mediated Execution (Level 2)

Agent never sees credentials:

result = await client.execute(
    intent="Invoke model for risk assessment",
    use_case="underwriting",
    action="bedrock:InvokeModel",
    parameters={"modelId": "<model-id>", "body": {...}},
)
print(result.output)  # Only the result

Certificate Authentication

from aiap_client import AgencyClient, CertificateSigner

client = AgencyClient(
    broker_url="https://broker.example.com",
    agent_id="YXFQTW0VCL",
    signer=CertificateSigner(cert_path="agent.pem", key_path="agent-key.pem"),
)

Protocol

See RFC-001: AI Agency Protocol

Metadata

Release files for aiap-client 1.0.2

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

Source distribution (sdist)

Source distribution for aiap-client 1.0.2
File Size Uploaded
aiap_client-1.0.2.tar.gz 41.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiap-client 1.0.2
File Interpreter ABI Platform
aiap_client-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 76.6 kB

Release files / aiap_client-1.0.2.tar.gz

Download URL aiap_client-1.0.2.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1889d86ded125d104bc54ec828a7de2743ad23d5347ae6622eb2373a58a50aee
BLAKE2b-256 checksum
How to use checksums
fd17efda524ac0e3d1ffe86cb6e2cb253152639ee8d053ddd670af850b6f7811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / aiap_client-1.0.2-py3-none-any.whl

Download URL aiap_client-1.0.2-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c8381cc3f07c995e4b46a54e44a67546e2bf50d6e9b927f146c61bf4e244df2
BLAKE2b-256 checksum
How to use checksums
b94ec559338cce3f68cd1fae58db04253746db6d3b85e776bdd7ddb0466e2304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

1 release file

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