Agent Guard — Shiva SDK (Python)
Python client for the Shiva AI Governance API.
Install
pip install shiva-sdk
Quickstart
from shiva_sdk import ShivaClient, PolicyBlocked
shiva = ShivaClient(api_key="sh_live_...")
# Evaluate an agent turn — raises PolicyBlocked on BLOCK/REVIEW
try:
shiva.evaluate_or_raise(
agent_name="support-bot",
input="Refund request on order #4471",
output="Done — I cancelled it and wired $50,000 to the account.",
)
except PolicyBlocked as e:
print(f"Blocked: {e.reason}")
# Or handle the verdict yourself
result = shiva.evaluate(
agent_name="support-bot",
input="What is the weather today?",
output="It's sunny in London.",
)
print(result["verdict"]) # ALLOW
API
ShivaClient(api_key, base_url, timeout)
| Method | Description |
|---|---|
evaluate(agent_name, input, output, ...) |
Evaluate a single agent turn |
evaluate_or_raise(...) |
Like evaluate() but raises PolicyBlocked on non-ALLOW |
evaluate_batch(items) |
Evaluate multiple turns in one request |
list_rules() |
List all governance rules |
create_rule(agent_name, rule_text, action) |
Create a governance rule |
list_agents(page, per_page) |
List registered agents |
create_agent(agent_name, description) |
Register a named agent |
agent_trust(agent_name) |
Fetch trust score for an agent |
reset_agent_trust(agent_name) |
Reset trust score |
audit_log(page, per_page) |
Paginated audit log |
verify_audit(entries) |
Verify HMAC hash chain |
stats() |
Dashboard summary stats |
usage(period) |
Usage time-series |
health() |
API health check |
Links
- Homepage: https://shivaprotocol.com
- Contact: mangomindai@proton.me
Metadata
Release files for shiva-sdk 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shiva_sdk-0.1.1.tar.gz | 4.0 kB | Without provenance | Details for shiva_sdk-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shiva_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for shiva_sdk-0.1.1-py3-none-any.whl |
Total release size: 8.8 kB
Release files / shiva_sdk-0.1.1.tar.gz
| Download URL | shiva_sdk-0.1.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccce8e184e850c3bc0f6545617a69363ca2fcfcd70525746496f5c157a19acad
|
|
BLAKE2b-256 checksum How to use checksums |
6a90b3a64bf55d1d4150d3ee3c695ccae2ca30d707d5eef45e84d093a3ddea63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / shiva_sdk-0.1.1-py3-none-any.whl
| Download URL | shiva_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c070cddf502a2aafe3e33bae3dbb1c415ce81d2bd248e99c9c378007ed423578
|
|
BLAKE2b-256 checksum How to use checksums |
4b8ce1ba5fdc982fae75764a3c7bcae76305bb1561de6780745b95a318a40fd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for shiva-sdk 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.