Official Python SDK for KyberShield AI Security Gateway
Project description
KyberShield Python SDK
Official Python SDK for the KyberShield AI Security Gateway.
Installation
pip install kybershield
With LangChain extras:
pip install "kybershield[langchain]"
Quick Start
from kybershield import KyberShield, BlockedError, KyberShieldError
ks = KyberShield(agent_key="ks_your_key_here")
try:
result = ks.query("SELECT * FROM customers LIMIT 10")
print(result.verdict) # 'allowed'
print(result.risk_score) # 5
print(result.quantum_signature) # 'ML-DSA-87:...'
print(result.data) # rows from your database
except BlockedError as e:
print(f"Blocked: {e.result.reason} (risk: {e.result.risk_score})")
except KyberShieldError as e:
print(f"Gateway error: {e} (status: {e.status_code})")
# Health check
healthy = ks.ping()
print(f"Gateway healthy: {healthy}")
Context Manager
with KyberShield(agent_key="ks_your_key") as ks:
result = ks.query("SELECT 1")
print(result.verdict)
Environment Variables
export KYBERSHIELD_AGENT_KEY=ks_your_key_here
export KYBERSHIELD_GATEWAY_URL=https://app.kybershield.ai
# No key needed — reads from environment
ks = KyberShield()
Links
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
kybershield-1.0.0.tar.gz
(4.2 kB
view details)
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 kybershield-1.0.0.tar.gz.
File metadata
- Download URL: kybershield-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f14428694f96bf1efd185f26e122d4bef7d903fb26f6f37f8d859878df319ebf
|
|
| MD5 |
2ed06c9f6092284d53c5f76d5090845c
|
|
| BLAKE2b-256 |
0fec3f2bf2c6b191b4393753af0f0ef6e9d50681ab49e16e73f7c059c531d456
|
File details
Details for the file kybershield-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kybershield-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58aeadfad5516d9c79c91002cb7e1f648fca1901dbc7973fe1b72e9b40e51acc
|
|
| MD5 |
303d8f1dd7c71a2b85238235531c6846
|
|
| BLAKE2b-256 |
923a9a3584c9cfaa1236de2ee636ce932d5f5ec612d074f458d59874df065a86
|