Skip to main content

Janus Sentinel Python SDK - Compliance & Policy Checks for AI Agents

Project description

Janus Sentinel SDK

Compliance & Policy Checks for AI Agents

Janus is the industry-standard SDK for ensuring AI agents comply with safety policies, regulatory requirements (SB-1047), and operational constraints. It provides a simple, high-performance interface for pre-action checks and post-action reporting.

Installation

pip install janus-sdk

Usage

Synchronous Client

from janus import JanusClient

# Initialize client
client = JanusClient(
    tenant_id="your_tenant_id",
    api_key="janus_xyz",
    fail_open=False  # Default: fail closed on connection errors
)

# 1. Check if action is allowed
result = client.check(
    action="payment.process",
    params={"amount": 5000, "currency": "USD"},
    agent_id="payment-bot-01"
)

if result.allowed:
    # 2. Execute action
    process_payment(...)
    
    # 3. Report outcome
    client.report(
        result,
        status="success",
        result={"transaction_id": "tx_123"}
    )
elif result.requires_approval:
    print(f"Approval required: {result.reason}")
else:
    print(f"Action denied: {result.reason}")

Decorators (Easier Integration)

from janus import JanusClient, janus_guard

client = JanusClient(...)

@janus_guard(client, action="email.send", agent_id="email-bot")
def send_email(to, subject, body):
    # This function is automatically guarded.
    # If policy check fails, it raises PermissionError.
    return mailer.send(to, subject, body)

Async Support

Janus fully supports async/await for non-blocking operations:

from janus import AsyncJanusClient

async with AsyncJanusClient(...) as client:
    res = await client.check("database.drop", params={"table": "users"})
    if not res.allowed:
        raise PermissionError(res.reason)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

janus_sdk-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

janus_sdk-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file janus_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: janus_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for janus_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29edbbae5f642255c1719e5503b7d571fc0331f5da5a0740ab3f871af12c8aa7
MD5 ca41b12a981db51b8483cebe1cd25406
BLAKE2b-256 3e633957b3f2a2bd8dc49dbc488e3d87bde1b9730dd2d947b3c235c4a4bccddd

See more details on using hashes here.

File details

Details for the file janus_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: janus_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for janus_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 118e7cc32020b9845bd1dbf4ec5c137fe73cf23033315f11f8e9e11cdfc11988
MD5 c532c9ace914dd328cd0213d01edddab
BLAKE2b-256 72cdae5313e030cddf42a0f3125c393f5b49c2e6958c2f4427ffdde472265c17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page