Skip to main content

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.

Metadata

Release files for aegis-tool-firewall 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aegis-tool-firewall 1.0.0
File Size Uploaded Provenance
aegis_tool_firewall-1.0.0.tar.gz 30.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aegis-tool-firewall 1.0.0
File Interpreter ABI Platform
aegis_tool_firewall-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.4 kB

Release files / aegis_tool_firewall-1.0.0.tar.gz

Download URL aegis_tool_firewall-1.0.0.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
685549ad736b3a8e06630387f4344c70fb7e15de01e90b25a401df8c9dac64a9
BLAKE2b-256 checksum
How to use checksums
4fd6b2951f0afeb2f00a9313703f5991084d0108acf6f879829e416b43bbbc30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / aegis_tool_firewall-1.0.0-py3-none-any.whl

Download URL aegis_tool_firewall-1.0.0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c72d20defbae3c19b5cf5923fd162c858beb0cbb6559f6f60a416921412e1ced
BLAKE2b-256 checksum
How to use checksums
fa123a5060c0b9266e6e884d5d3d0b9430833e50a7a88c05ce2341a4823db1d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for aegis-tool-firewall 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page