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
Metadata
Release files for kybershield 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kybershield-1.0.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kybershield-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / kybershield-1.0.0.tar.gz
| Download URL | kybershield-1.0.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f14428694f96bf1efd185f26e122d4bef7d903fb26f6f37f8d859878df319ebf
|
|
BLAKE2b-256 checksum How to use checksums |
0fec3f2bf2c6b191b4393753af0f0ef6e9d50681ab49e16e73f7c059c531d456
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / kybershield-1.0.0-py3-none-any.whl
| Download URL | kybershield-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58aeadfad5516d9c79c91002cb7e1f648fca1901dbc7973fe1b72e9b40e51acc
|
|
BLAKE2b-256 checksum How to use checksums |
923a9a3584c9cfaa1236de2ee636ce932d5f5ec612d074f458d59874df065a86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|