Metadata-Version: 2.5
Name: aiap-client
Version: 1.0.0
Summary: AI Agency Protocol (AIAP) client — identity, scope, and ephemeral authority for AI agents
Author-email: Kanjani AI Research & Causum <owner@ai-governance-protocol.org>
License: Proprietary
Keywords: agency,agents,ai,aiap,credentials,identity,jit,protocol
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Requires-Python: >=3.11
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0
Provides-Extra: aws
Requires-Dist: boto3>=1.26.0; extra == 'aws'
Provides-Extra: cert
Requires-Dist: cryptography>=41.0; extra == 'cert'
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: respx; extra == 'dev'
Description-Content-Type: text/markdown

# 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

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

## Quick Start

```python
from aiap_client import AgencyClient, AgencyLevel

client = AgencyClient(
    broker_url="https://www.cyber-ai-scim.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:

```python
result = await client.execute(
    intent="Invoke model for risk assessment",
    use_case="underwriting",
    action="bedrock:InvokeModel",
    parameters={"modelId": "anthropic.claude-sonnet-4-6", "body": {...}},
)
print(result.output)  # Only the result
```

## Certificate Authentication

```python
from aiap_client import AgencyClient, CertificateSigner

client = AgencyClient(
    broker_url="https://www.cyber-ai-scim.com",
    agent_id="YXFQTW0VCL",
    signer=CertificateSigner(cert_path="agent.pem", key_path="agent-key.pem"),
)
```

## Protocol

See [RFC-001: AI Agency Protocol](../../../specification/RFC-001-AI-Agency-Protocol.md)
