Metadata-Version: 2.4
Name: janus-sdk
Version: 0.2.0
Summary: Janus Sentinel Python SDK - Compliance & Policy Checks for AI Agents
Author-email: Krystal Unity <support@krystalunity.com>
License: MIT License
        
        Copyright (c) 2025 Krystal Unity
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://krystalunity.com
Project-URL: Repository, https://github.com/StartKrystal/krystal-unity-core
Project-URL: Issues, https://github.com/StartKrystal/krystal-unity-core/issues
Project-URL: Documentation, https://krystalunity.com/warboard/janus/docs
Keywords: janus,sentinel,ai,compliance,policy,sdk,safety
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24
Dynamic: license-file

# Janus Sentinel SDK

[![PyPI](https://img.shields.io/pypi/v/janus-sdk.svg)](https://pypi.org/project/janus-sdk/)

Compliance & policy checks for AI agents. Perform pre-action checks, approvals, and post-action reporting with minimal code.

## Installation
```bash
pip install janus-sdk
```

## Quickstart (sync)
```python
from janus import JanusClient

client = JanusClient(tenant_id="your_tenant_id", api_key="janus_xyz", fail_open=False)

decision = client.check(
    action="payment.process",
    params={"amount": 5000, "currency": "USD"},
    agent_id="payment-bot-01",
)

if decision.allowed:
    process_payment(...)
    client.report(decision, status="success", result={"transaction_id": "tx_123"}, action="payment.process", agent_id="payment-bot-01")
elif decision.requires_approval:
    print(f"Approval required: {decision.reason}")
else:
    print(f"Action denied: {decision.reason}")
```

## Decorators
```python
from janus import JanusClient, janus_guard

client = JanusClient(tenant_id="acme", api_key="janus_xxx")

@janus_guard(client, action="email.send", agent_id="email-bot")
def send_email(to, subject, body):
    return mailer.send(to, subject, body)
```

## Async
```python
from janus import AsyncJanusClient

async def main():
    async with AsyncJanusClient(tenant_id="acme", api_key="janus_xxx") as client:
        res = await client.check("database.drop", params={"table": "users"})
        if res.allowed:
            await client.report(res, status="success", action="database.drop", agent_id="ops-bot")
```

## Docs
- Quickstart & SDK reference live in `docs/janus/` (quickstart, sdk/*, policies/*, compliance/*, operations/*, api/*).\n- Start with `docs/janus/quickstart.md` for a 5-minute setup.\n

## License
MIT
