🛡️ Aegis Runtime (aegis-runtime)
The zero-trust deterministic flight controller for AI agents.
Enterprises refuse to deploy fully autonomous AI agents in production because probabilistic LLMs suffer from three fatal flaws:
- Prompt Injections & Unauthorized Actions: Malicious inputs trick agents into wiring funds, issuing refunds, or deleting records.
- Infinite Loops & Partial Corruption: Agents spiral in tool-call loops or crash mid-workflow, leaving databases in corrupted states.
- Zero Compliance Guarantees: Regulated industries (fintech, healthcare, legal) require deterministic code enforcement and tamper-proof audit trails—not probabilistic "hope."
Aegis treats the LLM like a brilliant, erratic intern. Every tool call is wrapped in deterministic Python code (@aegis.guard and @aegis.transaction) that enforces hard mathematical guarantees before any side effect touches your infrastructure.
⚡ Core Capabilities
- Deterministic State Locks: Enforce code-level prerequisites (
issue_refundcannot execute unlessverify_customersucceeded in the same session). - Circuit Breakers: Hard execution caps on repetitive tool calls to kill infinite loops instantly.
- Atomic Time-Travel Rollbacks: Automatic state snapshots before multi-step workflows—if Step 3 fails, Steps 1 and 2 rewind automatically.
- Cryptographic Audit Logs: Every allowed or blocked tool execution generates a tamper-proof SHA-256 hash receipt.
- Zero External Dependencies: Pure Python standard library core (
0bloated dependencies).
🚀 Quickstart
pip install aegis-runtime
from aegis_runtime import AegisRuntime, SecurityViolation
aegis = AegisRuntime()
@aegis.guard(max_calls=3)
def verify_customer(email: str) -> str:
aegis.set_state("customer_verified", True)
return f"Verified {email}"
@aegis.guard(requires=["customer_verified"])
def issue_refund(amount: float, email: str) -> str:
return f"Refunded ${amount} to {email}"
🔥 Live Proof: Neutralizing an Indirect Prompt Injection
In examples/live_agent.py, a 120B frontier LLM is compromised by a hidden CRM metadata injection attempting to bypass customer verification and send $5,000. Aegis intercepts the compromised tool call in deterministic Python and logs a SHA-256 receipt:
[AI ATTEMPTED TOOL CALL] issue_refund({'amount': 5000, 'email': 'sarah.m@gmail.com'})
[AEGIS SHIELD ACTIVATED] Live AI Compromised, Attack Neutralized!
Reason: Policy violation: issue_refund requires customer_verified=True
Cryptographic Audit Log:
{'timestamp': 1795043630.3087144, 'tool': 'issue_refund', 'status': 'BLOCKED_POLICY', 'args': '()', 'hash': 'c58f693e73d0032529ce47cb9d9ad6a664cc73368f6f9e919719727b6909a23d'}
🧪 Running the Examples
# 1. Test deterministic blocking of unauthorized database deletion
python examples/test_attack.py
# 2. Test atomic time-travel state rollback on mid-transaction failure
python examples/test_rollback.py
# 3. Test live prompt injection defense against an LLM (requires GROQ_API_KEY in .env)
pip install groq
python examples/live_agent.py
🗺️ Roadmap
- v0.2: Deterministic State Locks, Circuit Breakers, Atomic Rollbacks, SHA-256 Audit Receipts
- v0.3: Native adapters for OpenAI, Anthropic, LangGraph, and CrewAI
- v0.4: Policy-as-Code YAML/JSON configurations & CLI audit verifier
- Aegis Cloud: Real-time fleet observability, live human-in-the-loop approvals, and one-click replay
📄 License
MIT License — see LICENSE for details.
Metadata
Release files for aegis-runtime 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aegis_runtime-0.2.0.tar.gz | 5.3 kB | Without provenance | Details for aegis_runtime-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aegis_runtime-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for aegis_runtime-0.2.0-py3-none-any.whl |
Total release size: 11.0 kB
Release files / aegis_runtime-0.2.0.tar.gz
| Download URL | aegis_runtime-0.2.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d621d582576a104e3d5cd04d731cc75db872835c8d94f700454df2e28865b345
|
|
BLAKE2b-256 checksum How to use checksums |
96850f7c6383d3a592344da26663cf567a31eb77ee40fa2c2647a9e732fd7c31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / aegis_runtime-0.2.0-py3-none-any.whl
| Download URL | aegis_runtime-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ace4e7021e93e2f1bdb6176b153b4b91b0815532cb6ad728faf895d28076c67e
|
|
BLAKE2b-256 checksum How to use checksums |
5f2e0a59f89f4d1e52470f42ac43b98b3fbcd2aa9017e84c5706969797edcd9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for aegis-runtime 0.2.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.