A production-grade runtime security firewall and audit governance framework for LLM agents and tool-use pipelines.
Project description
Aegis Tool Firewall
Aegis is a lightweight security firewall for AI agent tool calls. It intercepts tool execution at the function boundary, blocks destructive actions, redacts sensitive payloads, persists audit trails, supports async tool functions, tracks tenant context safely, and degrades gracefully when audit storage fails.
Installation
pip install -e .
For development and tests:
pip install -e .[dev]
Quickstart
from aegis.core import guardrail
from aegis.exceptions import PolicyViolationError
@guardrail
def execute_query(query: str) -> str:
return f"Executing: {query}"
print(execute_query(query="SELECT * FROM users WHERE id = 1;"))
try:
execute_query(query="DROP TABLE users;")
except PolicyViolationError as exc:
print(f"Blocked by Aegis: {exc}")
CLI
Initialize a default policy file:
aegis init
Validate a policy file:
aegis check guardrails.yaml
Show local audit status:
aegis status --db aegis_audit.db
Launch the inspection dashboard:
aegis dashboard --port 8000 --db aegis_audit.db
Architecture Overview
aegis/core.pyintercepts sync or async tool calls with@guardrail.aegis/engine.pyevaluates payloads against destructive-command and redaction policies.aegis/context.pymaintains task-safe and thread-safe execution context.aegis/db.pypersists audit events and falls back safely if the primary store fails.aegis/cli.pyexposesinit,check,status, anddashboardentry points.aegis/dashboard.pyserves a local inspection UI for audit logs, top rules, and filters.
The dashboard follows the design direction in Design.md and UI_UX.md: dark-mode first, high-contrast verdict colors, a fixed sidebar, summary metrics, and a responsive audit table.
Demo Pipeline
Run the end-to-end demo:
python examples/demo_full_pipeline.py
The demo shows async guardrail enforcement, multi-tenant context isolation, resilient audit logging with fallback, and quick audit log readback.
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 aegis_ai_firewall-0.1.2.tar.gz.
File metadata
- Download URL: aegis_ai_firewall-0.1.2.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
743253d7a72badaa19cb926fee405579087a72fb478384b5a67a8feefedd639d
|
|
| MD5 |
12081d688c014ce897cdbab171eaa887
|
|
| BLAKE2b-256 |
8a02c8fd684600999f6211b625a7d91559b0d3bca4459be5c08e5a528f908683
|
File details
Details for the file aegis_ai_firewall-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aegis_ai_firewall-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b1f558963ff4011ed292e09ff0104bcc5695d996dd52bfaff41d6b689a5b00
|
|
| MD5 |
ecd0b1c2ad1261be6d56d907c5aa18c1
|
|
| BLAKE2b-256 |
a9483ef72ead85cbd3b102fe428c14ff94c243bf2efd3738bdbba4919e96aef9
|