Forge Verify tools for LlamaIndex — verify every agent action before execution
Project description
llama-index-tools-forge
Forge Verify tools for LlamaIndex. Verify every AI agent action against your policies before execution.
Install
pip install llama-index-tools-forge
Quick Start
import os
from llama_index.core.agent import FunctionAgent
from llama_index.core.tools import FunctionTool
from llama_index.llms.openai import OpenAI
from forge_llamaindex import ForgeVerifyToolSpec
os.environ["VERITERA_API_KEY"] = "vt_live_..."
# Create Forge verification tools
forge = ForgeVerifyToolSpec(policy="finance-controls")
forge_tools = forge.to_tool_list()
# Your application tools
def send_payment(amount: float, recipient: str) -> str:
"""Send a payment to a recipient."""
return f"Sent ${amount} to {recipient}"
app_tools = [FunctionTool.from_defaults(fn=send_payment)]
# Create agent with all tools
agent = FunctionAgent(
tools=forge_tools + app_tools,
llm=OpenAI(model="gpt-4.1"),
system_prompt=(
"Before executing any sensitive action, ALWAYS call verify_action first. "
"Only proceed if the result is APPROVED."
),
)
response = await agent.run("Send $500 to vendor@acme.com")
Two Integration Points
1. Tool Spec — agent calls verify explicitly
from forge_llamaindex import ForgeVerifyToolSpec
spec = ForgeVerifyToolSpec(policy="finance-controls")
tools = spec.to_tool_list()
# Provides: verify_action, get_proof, check_health
2. Event Handler — automatic audit trail
from forge_llamaindex import ForgeEventHandler
import llama_index.core.instrumentation as instrument
handler = ForgeEventHandler(
policy="finance-controls",
block_on_deny=True, # raise exception on denied actions
)
dispatcher = instrument.get_dispatcher()
dispatcher.add_event_handler(handler)
The event handler intercepts all agent tool calls and verifies them through Forge automatically.
Configuration
spec = ForgeVerifyToolSpec(
api_key="vt_live_...", # or VERITERA_API_KEY env var
agent_id="prod-rag-agent",
policy="finance-controls",
fail_closed=True, # deny when API is unreachable
)
LlamaHub
This package follows the llama-index-tools-* naming convention and can be submitted to LlamaHub for discovery.
License
MIT — Veritera AI
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_tools_forge-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_forge-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.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679f398766ea22abda3fb66d8c17b863b6a1e0fba28fb4aacefc88ae82c1f1e4
|
|
| MD5 |
eaec59f1fc2257bbc79c73641bed0dfd
|
|
| BLAKE2b-256 |
587d10d87da7f43d12d089386215c91c9afc382e280e46e6ab779a034343d3ce
|
File details
Details for the file llama_index_tools_forge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_forge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8a534a2bbe3be9dcbdfc4ae0f34160a80bf93fe924c59aaef1ee6994cdead23
|
|
| MD5 |
1f6ff7a52cbf811726a634209976061b
|
|
| BLAKE2b-256 |
e2b0f7ac8bf19dbc08153d90e452f506985395204e600cb033a6a55c0228e5ab
|