Proof of compliance Python client for AI agents making agentic stablecoin and fiat payments.
Project description
kontext-sdk
Python client for the Kontext trust layer. Cryptographic verifiable intent for org-wide payments.
Thin HTTP client wrapping the Kontext REST API. All compliance logic runs server-side -- this package provides typed Python bindings with sync and async support.
Install
pip install kontext-sdk
Quick start
from kontext import Kontext
ctx = Kontext(api_key="sk_...", project_id="my-agent")
# Log a transaction
ctx.log_transaction(
tx_hash="0xabc...",
chain="base",
amount="5000",
token="USDC",
from_address="0xsender...",
to_address="0xrecipient...",
agent_id="payment-agent",
)
ctx.flush()
# Trust score
trust = ctx.get_trust_score("payment-agent")
print(f"Trust: {trust.score}/100 ({trust.level})")
Async
from kontext import AsyncKontext
async with AsyncKontext(api_key="sk_...", project_id="my-agent") as ctx:
await ctx.log(action="transfer", agent_id="agent-1")
trust = await ctx.get_trust_score("agent-1")
API
| Method | Description |
|---|---|
log(action, agent_id, ...) |
Buffer an action log |
log_transaction(tx_hash, chain, ...) |
Buffer a transaction log |
flush() |
Send buffered actions to server |
create_task(description, agent_id, ...) |
Create human-in-the-loop task |
confirm_task(task_id, evidence) |
Confirm task with evidence |
get_trust_score(agent_id) |
Get agent trust score (0-100) |
export_audit(format) |
Export audit trail (JSON or CSV) |
evaluate_anomalies(amount, agent_id, ...) |
Evaluate for anomalies |
health() |
Check API health |
TypeScript SDK
The full TypeScript SDK (kontext-sdk on npm) includes auto-instrumentation, pluggable sanctions screening, tamper-evident digest chains, and MCP server mode. See getkontext.com/docs.
License
MIT
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 kontext_sdk-0.13.0.tar.gz.
File metadata
- Download URL: kontext_sdk-0.13.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c084d2d1e64909b2138596ddf51281376aacab4ecc9d435e01cddde7cca72d20
|
|
| MD5 |
aa70192cfca43a18607b98b47a8a2272
|
|
| BLAKE2b-256 |
7aa3cdd895a1ee9e7355a29a8e31179185501b479d54b42ddb4130e8c493a267
|
File details
Details for the file kontext_sdk-0.13.0-py3-none-any.whl.
File metadata
- Download URL: kontext_sdk-0.13.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3462f01f07b05845a4eb6649567acb66c70328585890ad1518cf35b932ccaef9
|
|
| MD5 |
be3ecdb9666bc0e62b72909e4869d55e
|
|
| BLAKE2b-256 |
fcf9bb40381f34e8f2bebc83740b71ced2e4fb6dd29b546bdab3e7302b5876d9
|