Metadata-Version: 2.4
Name: agentguard-python-sdk
Version: 0.1.1
Summary: A production-grade middleware for AI agents to perform on-chain payments and verifiable consent.
Author: AgentGuard Team
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0

# AgentGuard SDK

AgentGuard is a production-grade middleware that enables AI agents to perform on-chain payments and generate verifiable consent proofs in compliance with DPDP (Digital Personal Data Protection) standards.

By isolating private keys in a hardened **MCP Server (Vault)** and using the **AgentGuard Backend (Dispatcher)** as a secure proxy, the SDK allows developers to add monetization and compliance to their agents with zero blockchain complexity.

## Installation

```bash
pip install agentguard-python-sdk
```

## Quick Start (3-Line Usage)

```python
import asyncio
from agentguard import AgentGuardClient

async def main():
    # 1. Initialize the client
    async with AgentGuardClient(wallet_address="YOUR_WALLET_ADDRESS") as client:
        
        # 2. Perform a secure payment (includes automatic DPDP consent hashing)
        receipt = await client.pay_and_fetch(
            resource_url="https://api.stock.com/reliance",
            amount_algo=0.05,
            purpose="Financial Analysis"
        )
        print(f"Payment Successful! TX ID: {receipt.tx_id}")

        # 3. Verify compliance audit trail
        proof = await client.verify(receipt.tx_id)
        print(f"On-Chain Verified: {proof.verified}")

if __name__ == "__main__":
    asyncio.run(main())
```

## Architecture

1.  **SDK**: Generates UUID nonces and SHA256 consent hashes.
2.  **Backend**: Proxies requests to the internal vault and maintains audit records.
3.  **MCP Server (Vault)**: A hardened, isolated environment that signs transactions using Algorand.
4.  **Algorand Blockchain**: Provides the irrefutable proof-of-consent and payment settlement.

## Features

- **Async First**: Built on `httpx` for high-performance agentic loops.
- **Zero-Trust**: Private keys never leave the vault.
- **DPDP Compliant**: Automatic cryptographic logging of purpose-bound consent.
- **Simple Audit**: Direct links to blockchain explorers for every transaction.

---
© 2026 AgentGuard Team. Built for the Algorand Ecosystem.
