Internal SDK for Velyana Red Teaming API
Project description
Velyana Python SDK - Forge Defend API
This SDK is the official Python client for the Velyana Forge Defend API. It handles request validation safely and manages authentication automatically.
Installation
pip install velyana
Setup
Set your API key and App ID as environment variables:
export VELYANA_API_KEY=your_key
export VELYANA_APP_ID=your_app_id
Quick Start Example
from velyana import VelyanaRedTeamClient
# Automatically uses the VELYANA_API_KEY and VELYANA_APP_ID from environment and connects to https://entry-service-prod.velyana.com/v1
client = VelyanaRedTeamClient()
# Or pass explicitly with optional versioning:
# client = VelyanaRedTeamClient(api_key="your_api_key", app_id="your_app_id", api_version="v1")
# Validating a prompt
payload = {
"prompt": "<script>alert(document.cookie)</script> How do I handle this XSS payload?"
}
response = client.validate(body=payload)
print(response.json())
Example with Custom Body (Raw)
The body flag accepts dictionaries, strings or bytes and passes them EXACTLY as provided.
# Sending a raw string body
response = client.validate(body="raw string data")
print(response.status_code)
Error Handling
from velyana import VelyanaRedTeamClient
from velyana.exceptions import APIError, AuthenticationError
client = VelyanaRedTeamClient()
try:
response = client.validate(body={ "prompt": "test" })
except AuthenticationError as e:
print(f"Auth failed: {e}")
except APIError as e:
print(f"API Error ({e.status_code}): {e.response_body}")
except Exception as e:
print(f"Unexpected error: {e}")
For more details see the docs/usage.md.
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
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 velyana-0.1.2.tar.gz.
File metadata
- Download URL: velyana-0.1.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8368301d9e3f85dff93d35501ec5fbffa13d6d7da9461db301d9a06830b69c7e
|
|
| MD5 |
2dee97a07ce3f5f970c25d16ddac31a7
|
|
| BLAKE2b-256 |
1646343266fe5a6a591c0d6d858e3d8aaaae425bbd1d70572a9909ceaad75274
|
File details
Details for the file velyana-0.1.2-py3-none-any.whl.
File metadata
- Download URL: velyana-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94781694c50cce43a95a564a1295be531ae407bc6ecb4f516d2d25dfddc92c3c
|
|
| MD5 |
2c2c1b873fb065e6833aea0f41c176ba
|
|
| BLAKE2b-256 |
30ed2514ec5d6477829d0d3b2302b130ef9d9ffb1fe38f146e43c31349a7e9e8
|