Metadata-Version: 2.5
Name: atherdlp
Version: 0.0.2
Summary: Developer-first DLP HTTP interceptor (Stage 1)
Project-URL: Homepage, https://github.com/AetherDLP/AtherDLP-sdk
Project-URL: Repository, https://github.com/AetherDLP/AtherDLP-sdk
Project-URL: Issues, https://github.com/AetherDLP/AtherDLP-sdk/issues
Author-email: Subham Singh Chauhan <subhamchauhan1100@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: dlp,httpx,interceptor,observability,security,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.24; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Requires-Dist: respx>=0.21; extra == 'test'
Description-Content-Type: text/markdown

# AtherDLP (Python) — Stage 1 HTTP Interceptor

Stage 1 intercepts outbound HTTP requests, classifies the destination (O(1) registry lookup), attaches a trace context, and emits a structured payload to a handler.

## Install (dev)

```bash
cd AtherDLP-sdk/python
python -m pip install -e ".[test]"
```

## Usage

```python
import httpx
import atherdlp

def handler(payload: dict) -> None:
    print(payload)

atherdlp.set_handler(handler)
atherdlp.install()

httpx.get("https://api.openai.com/v1/models", headers={"authorization": "Bearer x"})

atherdlp.uninstall()
```

### Tracing

- If the request includes a **correlation header** (e.g. **`X-Correlation-Id`**), it is **propagated automatically** (safe values only: **ASCII alphanumeric + `-`, 1–64 chars**).
- If **not** present or invalid, AtherDLP **generates its own** trace id (`trace.trace_id` in the payload).
- **Ather-specific** tracing is **always** added on the outbound call via **`x-ather-trace-id`** (and **`x-ather-span-id`**).

More detail: **`docs/SDK.md`** → *Trace And Recursion Guards*.

```python
httpx.post(url, headers={"X-Correlation-Id": "my-route-8842"})
```

## Output payload

```json
{
  "request": { "method": "...", "url": "...", "headers": { }, "body": null },
  "classification": { "kind": "llm|http.out|unknown", "vendor": "...", "sensitivity": "..." },
  "trace": { "trace_id": "...", "span_id": "...", "parent_span_id": null }
}
```