rankigi
Tamper-evident audit trails for AI agents. Non-blocking, zero-overhead governance that never impacts your agent's critical path.
Install
pip install rankigi
Optional extras:
pip install rankigi[langchain] # LangChain callback handler
pip install rankigi[signing] # Ed25519 passport signing
Quick Start
from rankigi import Rankigi
rk = Rankigi(
api_key="rk_live_...",
agent_id="your-agent-uuid",
)
# Track a tool call — input/output are SHA-256 hashed before transmission
rk.track_tool_call("web_search", {"query": "Q4 revenue"}, results)
# Track with intent reasoning (encrypted with AES-256-GCM)
rk.track_tool_call(
"web_search",
{"query": "Q4 revenue"},
results,
intent="User asked about quarterly financials, searching for latest data",
)
# Track agent output
rk.track_agent_output("The Q4 revenue was $12M.")
# Track errors
rk.track_error(some_exception)
# Track custom events
rk.track_custom_event("policy_check", {"rule": "pii_filter", "passed": True})
# Graceful shutdown (optional — flushes pending events)
rk.close()
Context Manager
with Rankigi(api_key="rk_live_...", agent_id="your-agent-uuid") as rk:
rk.track_tool_call("web_search", {"query": "test"}, {"results": []})
# Events are automatically flushed on exit
LangChain Integration
from rankigi.langchain import RangigiCallbackHandler
handler = RangigiCallbackHandler(
api_key="rk_live_...",
agent_id="your-agent-uuid",
)
# Add to any LangChain agent — governance is now automatic
agent = initialize_agent(
tools=tools,
llm=llm,
callbacks=[handler],
)
Features
- Non-blocking — events are queued and sent on a background daemon thread
- Privacy-first — inputs/outputs are SHA-256 hashed before transmission
- Intent Chain — optional AES-256-GCM encrypted agent reasoning
- Passport signing — Ed25519 event signatures for tamper-evident chains
- LangChain support — drop-in callback handler for automatic governance
- Zero dependencies — stdlib only (extras for LangChain, signing)
- Automatic retry — exponential backoff with local buffering
Configuration
rk = Rankigi(
api_key="rk_live_...", # Required: API key from /dashboard/keys
agent_id="your-agent-uuid", # Required: Agent ID from /dashboard/agents
base_url="https://rankigi.com", # Optional: custom deployment URL
on_error=lambda e: log(e), # Optional: error callback
max_retries=3, # Optional: retry attempts (default 3)
max_buffer=1000, # Optional: max buffered events (default 1000)
timeout=5.0, # Optional: HTTP timeout in seconds
signing_key="base64...", # Optional: Ed25519 key for passport signing
passport_id="passport-uuid", # Optional: passport ID for event signing
intent_key="hex-string", # Optional: AES-256 key for intent chain
)
Documentation
Full documentation at rankigi.com/docs
License
MIT
Metadata
Release files for rankigi 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 | |
|---|---|---|---|
| rankigi-1.0.0.tar.gz | 15.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rankigi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.0 kB
Release files / rankigi-1.0.0.tar.gz
| Download URL | rankigi-1.0.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80b1a9e776e81f9281b2180e4e9d9a568a1da7f17d1374eb3e7f9a4ce2b5a7e7
|
|
BLAKE2b-256 checksum How to use checksums |
b2ee6691c6be6a7264ecbd05872454e5bbb3fa208ec78ae8c23e86ca0d204808
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / rankigi-1.0.0-py3-none-any.whl
| Download URL | rankigi-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
409ff859245819c3edc6ab3ce30f3a299d99f2241f52f569ec0a658adb22fa06
|
|
BLAKE2b-256 checksum How to use checksums |
a3b5946f845081f551a77da93624769be25f7d99e330ce055a0f1da9530ff07e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|