Metadata-Version: 2.5
Name: guardloop-sdk
Version: 0.1.0
Summary: Python client for Guardloop, a guardrail and observability layer for AI agents.
Project-URL: Homepage, https://github.com/muzammil-kj/guardloop
Project-URL: Repository, https://github.com/muzammil-kj/guardloop
Project-URL: Issues, https://github.com/muzammil-kj/guardloop/issues
Author: Muzammil Khan
License-Expression: MIT
License-File: LICENSE
Keywords: agents,ai,guardrails,human-in-the-loop,llm,observability
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# guardloop-sdk

Python client for [Guardloop](https://github.com/muzammil-kj/guardloop), a
guardrail and observability layer for AI agents.

## Install

```bash
pip install guardloop-sdk
```

Requires Python 3.9 or newer.

## Usage

```python
from guardloop_sdk import GuardloopClient

client = GuardloopClient(
    api_key="gl_live_your_real_key_here",
    base_url="https://guardloop-api.onrender.com",
)

result = client.report(
    agent_name="invoice-parser",
    event_type="classification",
    confidence=0.62,
    input_summary="Invoice #4921 from Acme Corp, amount $14,200",
    output_summary="Classified as: needs_manual_review (unusual amount)",
    cost_usd=0.0008,
)

if result.escalated:
    print(f"Escalated to a human: {result.reason}")
else:
    print("Auto-approved, no human needed.")
```

`client.report(...)` raises `GuardloopError` if the request fails, network
issues included, rather than silently assuming an event was approved.