Python SDK for RailGuard AI Guardrails
Project description
RailGuard Python SDK
Python SDK for RailGuard AI Guardrails - validate and secure your LLM applications.
Installation
pip install railguard-sdk
Usage
from railguard import create_client
# Initialize client
client = create_client(
api_key="your-api-key",
base_url="https://railguardapi-production.up.railway.app"
)
# Validate AI output
response = client.validate({
"text": "Your AI output text",
"agentId": "your-agent-id",
"rules": ["no-pii", "no-toxicity"]
})
print(response)
# Get rules
rules = client.get_rules(agent_id="your-agent-id")
# Get validation history
validations = client.get_validations(agent_id="your-agent-id", limit=10)
API Reference
create_client(api_key, base_url)
Creates a new RailGuard client instance.
api_key(str): Your RailGuard API keybase_url(str, optional): API base URL. Defaults tohttp://localhost:3001
client.validate(request)
Validates text against configured rules.
request(dict): Validation request object
Returns: Validation response with results
client.get_rules(agent_id=None)
Retrieves rules for an agent.
agent_id(str, optional): Filter by agent ID
Returns: List of rules
client.get_validations(agent_id=None, limit=None)
Retrieves validation history.
agent_id(str, optional): Filter by agent IDlimit(int, optional): Maximum number of results
Returns: List of validation records
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file railguard_sdk-1.0.0.tar.gz.
File metadata
- Download URL: railguard_sdk-1.0.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ef0691618a7eb7777090e5fc86d4ebe1b82641dd1d79f52539d772039894cd8
|
|
| MD5 |
402577f21d31aeccdec9f3d9f0c4f322
|
|
| BLAKE2b-256 |
dcfeea79285aeda990311283cb41d2241bb2f968fa14225e2fc160b04934c6c0
|
File details
Details for the file railguard_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: railguard_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a5de94a37d6dc50f74f0344949a23a35dbf21df17d17da42cfbc6a03efcc0ba
|
|
| MD5 |
4e2fdb44b946af5e6a6ecd918e786505
|
|
| BLAKE2b-256 |
058af44bf3a8778abfb2f286a9975a1708c4ef42801d000a1d8116dca20a3a2c
|