Skip to main content

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

  1. aegis/core.py intercepts sync or async tool calls with @guardrail.
  2. aegis/engine.py evaluates payloads against destructive-command and redaction policies.
  3. aegis/context.py maintains task-safe and thread-safe execution context.
  4. aegis/db.py persists audit events and falls back safely if the primary store fails.
  5. aegis/cli.py exposes init, check, status, and dashboard entry points.
  6. aegis/dashboard.py serves 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aegis_ai_firewall-0.1.1-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file aegis_ai_firewall-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aegis_ai_firewall-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33205ec7eb23ea3075e1722ac39001854ae13b8e230545711e1f14362f3970c4
MD5 861770c304af04f472edb864d3bb4bc7
BLAKE2b-256 c9aa7857798ccfa920cda0cee40367c9d83824148cbcbb159a8ee26bf81088be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page