Vaultak runtime security callback handler for LlamaIndex agents
Project description
llama-index-callbacks-vaultak
Runtime security for LlamaIndex agents, powered by Vaultak.
Intercept every agent action, tool call, and LLM query in real time — score risk, enforce policies, mask PII, and automatically block dangerous behavior before it reaches your production systems.
Install
pip install llama-index-callbacks-vaultak
Quick Start
from llama_index.core.callbacks import CallbackManager
from llama_index.callbacks.vaultak import VaultakCallbackHandler
# Initialize the handler
handler = VaultakCallbackHandler(api_key="vtk_...")
callback_manager = CallbackManager([handler])
# Use with a query engine
query_engine = index.as_query_engine(
callback_manager=callback_manager
)
# Query — every action is now monitored and secured
response = query_engine.query("Summarize our Q3 revenue data")
Set Globally
from llama_index.core import Settings
from llama_index.core.callbacks import CallbackManager
from llama_index.callbacks.vaultak import VaultakCallbackHandler
Settings.callback_manager = CallbackManager([
VaultakCallbackHandler(api_key="vtk_...")
])
Use with Agents
from llama_index.core.agent import ReActAgent
from llama_index.core.callbacks import CallbackManager
from llama_index.callbacks.vaultak import VaultakCallbackHandler
handler = VaultakCallbackHandler(
api_key="vtk_...",
agent_name="my-production-agent",
risk_threshold=6.0,
)
agent = ReActAgent.from_tools(
tools,
callback_manager=CallbackManager([handler]),
)
What Gets Monitored
| LlamaIndex Event | Vaultak Action |
|---|---|
FUNCTION_CALL start |
Risk-scores the action, blocks if above threshold |
FUNCTION_CALL start |
Checks tool call against policy rules |
FUNCTION_CALL end |
Scans output for PII and masks it |
LLM start |
Checks LLM inputs against policy |
EXCEPTION |
Sends alert + triggers rollback |
QUERY end |
Scans response for PII |
Configuration
handler = VaultakCallbackHandler(
api_key="vtk_...", # Required
agent_name="my-agent", # Label in the Vaultak dashboard
block_on_high_risk=True, # Block actions above threshold
risk_threshold=7.0, # 0-10 scale
verbose=True, # Log all scored actions
)
Links
Project details
Release history Release notifications | RSS feed
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 llama_index_callbacks_vaultak-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_callbacks_vaultak-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3e996e3e1e4683445f3cfc109b6215e43a1aacc7cf7bbbf320da1c1a8b13157
|
|
| MD5 |
752b760fdf226cba3e34b380f640865d
|
|
| BLAKE2b-256 |
4249c3b5aaadcb79eb02d8be0b67d289c47b8108f4e1dd333287ebc21ab9c0c4
|
File details
Details for the file llama_index_callbacks_vaultak-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_callbacks_vaultak-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4484e3c1f05799de594761bbcc9569b555dee720fe140c30d5133203adf9423
|
|
| MD5 |
2509ca8abedc82a23a833df82fb189df
|
|
| BLAKE2b-256 |
0ffcccddcbb467260d10de11106db40391b8a763960ca75c4d9b5b41f7bddd1d
|