← Back to all examples

LlamaIndex Agent Tool Firewall

limetry + LlamaIndex-style toolsPythonintegrationautomated tests

Wrap FunctionTool-style callables with limetry so retrieve allows and delete_index denies before the tool body runs.

Source folder: examples/llamaindex-agent-tool-firewall

Documentation & Guide

README.md

LlamaIndex agent tool firewall

Gate LlamaIndex-style FunctionTool calls with the limetry Python SDK before the tool body runs.

Install

pip install -e ../../packages/sdk-python
pip install -r requirements.txt

Pattern

from firewall import build_engine, governed_tool

engine = build_engine()
retrieve = governed_tool("retrieve", my_retrieve_fn, engine=engine)

Test

pytest test_firewall.py

Source Files

4 files in examples/llamaindex-agent-tool-firewall
markdown
# LlamaIndex agent tool firewall

Gate LlamaIndex-style FunctionTool calls with the [`limetry`](../../packages/sdk-python)
Python SDK before the tool body runs.

## Install

```bash
pip install -e ../../packages/sdk-python
pip install -r requirements.txt
```

## Pattern

```python
from firewall import build_engine, governed_tool

engine = build_engine()
retrieve = governed_tool("retrieve", my_retrieve_fn, engine=engine)
```

## Test

```bash
pytest test_firewall.py
```

Contact

Talk to the Limetry team

Questions about self-run Limetry, Limetry Cloud, or partnerships — send a note.  Open contact.