Skip to main content

Repello Argus Python SDK

PyPI Version Python Versions License Build Status Contributor Covenant

The official Python SDK for the Repello Argus AI Guardrails API.

The Argus Python SDK provides a robust, high-performance interface for integrating Repello Argus into your Python applications. It allows developers to scan LLM prompts and responses in real-time to detect and mitigate a wide range of security, safety, and content risks.

This SDK is designed for both rapid prototyping with code-defined policies and enterprise-grade orchestration using the Argus Platform, enabling features like centralized policy management, detailed analytics, and conversation tracking.


Key Features

  • Comprehensive Security Policies: Scan for PII, prompt injection, toxicity, secrets, banned topics, unsafe content, and more.
  • Flexible Policy Management: Define policies directly in your code for rapid development, or leverage the Argus Platform to manage policies centrally in the UI without code changes.
  • Full Platform Observability: Use Assets and Sessions to organize and track your data, providing deep insights into application usage and conversation context in the Argus dashboard.
  • Developer-First Experience: Built with type-safe enums (Verdict, Action, etc.) and a clear exception hierarchy for robust and predictable integration.
  • Resilient & Performant: Powered by httpx for modern, asynchronous-ready HTTP requests and tenacity for automatic, resilient retries on network failures.

Installation

Install the package from PyPI using pip:

pip install repello-argus-client

The SDK requires Python 3.8 or higher.

Quickstart

This example shows how to get started in under a minute. It defines a simple policy in code to block toxic prompts.

First, set your API key as an environment variable:

export ARGUS_API_KEY="your_api_key_here"

Then, run the following Python code:

# quickstart.py
import os
from repello_argus_client import ArgusClient, PolicyName, Action, Verdict

# 1. Load your API Key from the environment
API_KEY = os.environ.get("ARGUS_API_KEY")
if not API_KEY:
    raise ValueError("ARGUS_API_KEY environment variable not set.")

# 2. Define a simple policy in your code
my_policy = {
    PolicyName.TOXICITY: {"action": Action.BLOCK}
}

# 3. Create a client and perform a scan
argus_guard = None
try:
    argus_guard = ArgusClient.create(api_key=API_KEY, policy=my_policy)
    result = argus_guard.check_prompt("You are a piece of garbage.")

    # 4. Handle the result using the Verdict enum
    print(f"Verdict: {result['verdict']}")

    if result['verdict'] == Verdict.BLOCKED:
        print("✅ The prompt was blocked. Application should halt this request.")
    else:
        print("The prompt was allowed to proceed.")

finally:
    if argus_guard:
        argus_guard.close()

Documentation

For a comprehensive guide covering all features, advanced usage patterns, and a full API reference, please see our official documentation:

https://docs.repello.ai/

Usage Example: Platform Workflow

Platform users (with a Runtime Security Key) can leverage policies managed directly in the Argus UI. This simplifies the code significantly.

# platform_usage.py
import os
from repello_argus_client import ArgusClient, Verdict

# This workflow assumes you have:
# 1. A Runtime Security Key (rsk_...).
# 2. An Asset created in the Argus UI with its own policy.
API_KEY = os.environ.get("ARGUS_RUNTIME_API_KEY")
ASSET_ID = "your_asset_id_from_the_dashboard"

argus_guard = None
try:
    # Connect to your asset and enable saving results to the platform.
    # Notice no local `policy` object is needed.
    argus_guard = ArgusClient.create(
        api_key=API_KEY,
        asset_id=ASSET_ID,
        save=True
    )

    # This scan will be evaluated against the policy configured in the Argus UI.
    result = argus_guard.check_prompt("This prompt will be checked against the UI policy.")

    print(f"Verdict from platform policy: {result['verdict']}")

finally:
    if argus_guard:
        argus_guard.close()

📂 More Examples

See the examples/ directory for more use cases, including:

  • Asynchronous usage
  • Streaming integrations
  • Platform workflows with assets and sessions

📄 License

This project is licensed under the Apache License 2.0.

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for guidelines on how to submit pull requests, report issues, and suggest features.

This project follows the Contributor Covenant Code of Conduct. By participating, you agree to abide by its terms.

Support

If you encounter any issues or have questions, please file an issue on our GitHub Issues page or contact our support team at support@repello.ai.

© 2025 RepelloAI. All rights reserved.

Metadata

Release files for repello-argus-client 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repello-argus-client 0.2.4
File Size Uploaded
repello_argus_client-0.2.4.tar.gz 31.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repello-argus-client 0.2.4
File Interpreter ABI Platform
repello_argus_client-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 58.8 kB

Release files / repello_argus_client-0.2.4.tar.gz

Download URL repello_argus_client-0.2.4.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e780bee520d87e8fa2ca7c00b66b2d17d70d00973b47b4a8a030c36b54db0782
BLAKE2b-256 checksum
How to use checksums
045e2afa399ab3d53a746c3a5bc5a243076eccb716175371e661f9bf91e75d77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / repello_argus_client-0.2.4-py3-none-any.whl

Download URL repello_argus_client-0.2.4-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bc436d6003b900292a3ff6cf4e1829428079f55e8c54a547625f0e660dec536
BLAKE2b-256 checksum
How to use checksums
50a703a8044b42065e5d13697aea426e5e4728220e7457df6ff7495fc823890e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page