Metadata-Version: 2.5
Name: zotniq
Version: 0.1.0a1
Summary: Zotniq SDK: runtime DLP for AI applications. Detect, mask, and block sensitive data before it leaves your process.
Project-URL: Homepage, https://zotniq.ai
Project-URL: Documentation, https://docs.zotniq.ai
Project-URL: Source, https://github.com/zotniq/zotniq
Project-URL: Issues, https://github.com/zotniq/zotniq/issues
Project-URL: Changelog, https://docs.zotniq.ai/resources/changelog/
Author-email: Zotniq <hello@zotniq.ai>
License: Apache-2.0
Keywords: ai-security,anthropic,data-governance,dlp,gdpr,guardrails,hipaa,llm,openai,phi,pii
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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 :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx<1.0,>=0.27
Requires-Dist: pydantic<3.0,>=2.0
Provides-Extra: all
Requires-Dist: openai>=1.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Provides-Extra: siem
Description-Content-Type: text/markdown

# Zotniq SDK

[![PyPI version](https://img.shields.io/pypi/v/zotniq.svg)](https://pypi.org/project/zotniq/)
[![Python versions](https://img.shields.io/pypi/pyversions/zotniq.svg)](https://pypi.org/project/zotniq/)
[![License](https://img.shields.io/pypi/l/zotniq.svg)](https://github.com/zotniq/zotniq/blob/main/LICENSE)

Runtime data-loss prevention for AI applications. Detect, mask, and block sensitive data before it leaves your process — locally by default, cloud-augmented on request.

```bash
pip install zotniq
```

## Quick start

```python
from zotniq import Zotniq

# Local-only, no key required, zero network calls
client = Zotniq()
findings = client.detect("Contact bob@example.com")

# Cloud-augmented (server-side LLM contextual pass)
client = Zotniq(api_key="zot_sk_...")
result = client.preflight.check(
    text="my ssn is 123-45-6789",
    destination="AI_TOOL",
)
print(result.decision)      # Decision.ALLOWED_WITH_MASKING
print(result.masked_text)   # my ssn is XXX-XX-6789
```

## Install with extras

```bash
pip install zotniq[openai]   # OpenAI drop-in wrapper
pip install zotniq[siem]     # SIEM forwarders (Splunk, Datadog, webhook, file)
pip install zotniq[all]      # everything
```

## Modes

- `mode="auto"` (default) — cloud if `api_key` is set, local otherwise
- `mode="local"` — always local, no network calls
- `mode="cloud"` — always cloud, raises `AuthError` if no key

## OpenAI drop-in

```python
from zotniq import Zotniq
from zotniq.integrations.openai import wrap_openai

client = wrap_openai(Zotniq(api_key="zot_sk_..."), api_key="sk-...")
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "my ssn is 123-45-6789"}],
)
# SSN is automatically masked before OpenAI ever sees the prompt.
```

## SIEM forwarding

```python
from zotniq import Zotniq
from zotniq.siem import SplunkForwarder

client = Zotniq(
    api_key="zot_sk_...",
    on_decision=SplunkForwarder(
        url="https://splunk.acme.com:8088/services/collector",
        token="hec-token",
    ),
)
# Every preflight.check() call fires an async POST to your SIEM.
# Decision metadata only — never raw payload content.
```

Full documentation at [docs.zotniq.ai/sdk](https://docs.zotniq.ai/sdk).

## License

Apache-2.0.
