Python SDK for HELM — fail-closed tool calling for AI agents
Project description
HELM SDK — Python
Typed Python client for the HELM kernel API. One dependency: httpx.
Install
pip install helm
Quick Example
from helm_sdk import HelmClient, HelmApiError, ChatCompletionRequest, ChatMessage
helm = HelmClient(base_url="http://localhost:8080")
# OpenAI-compatible chat (tool calls governed by HELM)
try:
res = helm.chat_completions(ChatCompletionRequest(
model="gpt-4",
messages=[ChatMessage(role="user", content="List files in /tmp")],
))
print(res.choices[0].message.content)
except HelmApiError as e:
print(f"Denied: {e.reason_code}") # e.g. DENY_TOOL_NOT_FOUND
# Export + verify evidence pack
pack = helm.export_evidence()
result = helm.verify_evidence(pack)
print(result.verdict) # PASS
# Conformance
from helm_sdk import ConformanceRequest
conf = helm.conformance_run(ConformanceRequest(level="L2"))
print(conf.verdict, conf.gates, "gates")
API
| Method | Endpoint |
|---|---|
chat_completions(req) |
POST /v1/chat/completions |
approve_intent(req) |
POST /api/v1/kernel/approve |
list_sessions() |
GET /api/v1/proofgraph/sessions |
get_receipts(session_id) |
GET /api/v1/proofgraph/sessions/{id}/receipts |
export_evidence(session_id?) |
POST /api/v1/evidence/export |
verify_evidence(bundle) |
POST /api/v1/evidence/verify |
replay_verify(bundle) |
POST /api/v1/replay/verify |
conformance_run(req) |
POST /api/v1/conformance/run |
health() |
GET /healthz |
version() |
GET /version |
Error Handling
All errors raise HelmApiError with a typed reason_code:
try: helm.chat_completions(req)
except HelmApiError as e: print(e.reason_code)
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
helm_sdk-0.4.0.tar.gz
(33.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
helm_sdk-0.4.0-py3-none-any.whl
(40.3 kB
view details)
File details
Details for the file helm_sdk-0.4.0.tar.gz.
File metadata
- Download URL: helm_sdk-0.4.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f16bcac4884cc7b3a3863fe94a0f9c9b83c95b0459d44eb7a6be408e0d00f91
|
|
| MD5 |
3065046e66e3a6c39653f69343775edb
|
|
| BLAKE2b-256 |
5f9b252c201e8b426c737c5206e61b87ce49f37d9b848ca087aa5f934a325374
|
File details
Details for the file helm_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: helm_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d0520ee54464e6d8e5911cc022ce83dbac27edba2b2c9e454e5b753f6a50e3f
|
|
| MD5 |
fed41147a3385edb94e659fd37d186c4
|
|
| BLAKE2b-256 |
a6fc5ff63211ffd9ad8cbf128db843be13153470fb5e1a7d31b3c464daaa8b99
|