Observed since 20 Oct, 20:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Human-in-the-loop control layer for AI agents
Aegis is a human-in-the-loop control layer that wraps existing LangChain-style agents and intercepts risky actions before execution.
Get Aegis running in under 5 minutes:
Install the package:
pip install -e .
Run the demo:
python demo.py
When execution pauses, open the approval URL in your browser (it will be printed to the console)
Review the action and enter your name/email, then click Approve or Deny
View the logs:
cat logs.jsonl
That's it! You've seen Aegis in action.
When you run demo.py, you'll see output like this:
======================================================================
AEGIS DEMO - Human-in-the-Loop Control for AI Agents
======================================================================
Setting up Aegis with cost_limit=$100.00
(Actions costing more than $200 require human approval)
----------------------------------------------------------------------
ACTION 1: Low-cost operation (auto-approved)
----------------------------------------------------------------------
Agent wants to spend $50.00 on an API call
→ Cost is below threshold → Auto-approved
✓ Action auto-approved and logged
----------------------------------------------------------------------
ACTION 2: High-cost operation (requires approval)
----------------------------------------------------------------------
Agent wants to spend $250.00 on an expensive API call
→ Cost exceeds threshold → Human approval required
⏸ EXECUTION PAUSED - Waiting for human decision
📋 NEXT STEPS:
1. A URL will appear below
2. Open that URL in your browser
3. Review the action details and explanation
4. Enter your name/email and click Approve or Deny
5. Execution will resume automatically
============================================================
AEGIS: Action requires human approval
Visit: http://127.0.0.1:8000/approve/550e8400-e29b-41d4-a716-446655440000
============================================================
When you open the URL, you'll see a simple web page with:
After clicking Approve or Deny, you'll see a confirmation page and execution resumes.
After the demo completes, logs.jsonl will contain entries like:
{"timestamp": "2024-01-15T10:30:00", "policy_version": "v1", "action_type": "spend_money", "risk": "low", "cost": 50.0, "explanation": "Cost $50.00 is within auto-approval threshold of $100.00", "decision": "allowed"}
{"timestamp": "2024-01-15T10:30:01", "policy_version": "v1", "action_type": "spend_money", "risk": "high", "cost": 250.0, "explanation": "Cost $250.00 exceeds approval threshold of $200.00", "decision": "paused"}
{"timestamp": "2024-01-15T10:30:15", "policy_version": "v1", "action_type": "spend_money", "risk": "high", "cost": 250.0, "explanation": "Cost $250.00 exceeds approval threshold of $200.00", "decision": "approved", "approved_by": "alice@example.com"}
Status: Vfinished (conceptually complete)
Aegis version 1.0.0 is a finished system artifact. The core functionality is complete and stable. No further development is planned without explicit scope decisions and version bumps.
AI agents can make tool calls with real-world side effects (e.g., spending money, sending emails, calling APIs). Aegis evaluates actions for risk, automatically approves safe actions, and pauses execution for human approval when risky actions are detected.
from aegis.wrapper import AegisWrapper
# Create your agent
agent = YourLangChainAgent()
# Wrap it with Aegis (cost_limit in dollars)
wrapped = AegisWrapper(agent, cost_limit=100.0)
# Run the agent
result = wrapped.run("your input")
When a high-risk action is detected, execution pauses and a URL is printed to the console. Visit the URL to review the action explanation and approve or deny.
Aegis has clear boundaries on what it intercepts:
✔ Intercepted:
spend_money, send_email, call_api)❌ NOT Intercepted:
Aegis only intercepts actions that have real-world side effects. It does not inspect or modify agent reasoning, prompts, or model outputs.
Wrap any agent in one line:
from aegis.wrapper import AegisWrapper
# Your existing agent
agent = YourAgent()
# Wrap with Aegis
wrapped = AegisWrapper(agent, cost_limit=100.0)
# Use as normal
result = wrapped.run("your input")
Use the convenience constructor for LangChain agents:
from aegis.wrapper import AegisWrapper
from langchain.agents import initialize_agent
# Create your LangChain agent
agent = initialize_agent(tools, llm, agent="zero-shot-react-description")
# Wrap with Aegis (one line)
wrapped = AegisWrapper.from_langchain(agent, cost_limit=50.0)
# Agent runs with Aegis protection
result = wrapped.run("your query")
Switch between development and production modes:
# Development mode (default) - verbose console output
wrapped = AegisWrapper(agent, cost_limit=100.0, mode="dev")
# Production mode - explicit blocking messages
wrapped = AegisWrapper(agent, cost_limit=100.0, mode="prod")
Mode affects console messaging only. Risk evaluation and approval flow are identical in both modes.
Aegis supports multiple action types across three categories:
Financial actions:
Data-destructive actions:
Production-impacting actions:
Other actions:
Risk evaluation is handled by aegis.rules.evaluate_risk(), which:
DEFAULT_RULES dictionary for configurationUsers can customize rules by modifying DEFAULT_RULES in aegis/rules.py.
Install dependencies:
pip install fastapi uvicorn
Run the demo:
python demo.py
The demo will:
logs.jsonlThe FastAPI server runs on http://127.0.0.1:8000 automatically when needed.
Aegis has firm boundaries on what it does not provide:
No LLM-based risk scoring: All risk evaluations are deterministic and rule-based. No AI models are used to assess risk.
No autonomous overrides: High-risk actions cannot bypass human approval. There is no mechanism for the system to override its own rules.
No auth system: The approval interface has no authentication. Anyone with the approval URL can approve or deny actions. This is intentional for simplicity.
No persistence guarantees: Approvals are stored in-memory only. Server restarts lose pending approvals. Logs are append-only files with no backup or replication.
No workflow orchestration: Aegis does not manage agent workflows, retries, or error handling. It only intercepts and approves individual actions.
These boundaries are by design to keep Aegis focused on its core purpose: human-in-the-loop control for risky actions.
Aegis is designed for:
If you need deterministic risk evaluation, complete audit trails, and simple human approval workflows, Aegis fits your needs.
Aegis is explicitly NOT for:
If you need authentication, persistence, production deployment features, or complex workflows, Aegis is not the right tool. Use a different system designed for those requirements.
Here are concrete scenarios where Aegis prevents problems:
Without Aegis:
With Aegis:
Without Aegis:
With Aegis:
Without Aegis:
With Aegis:
When something goes wrong (or right), you can replay exactly what happened:
Open the log file:
cat logs.jsonl
Or use the audit viewer:
python audit_viewer.py
# Then open http://127.0.0.1:8001/audit
Find the incident:
spend_money, send_email)decision: "paused" (these required approval)See why it was paused:
explanation fieldSee who made the decision:
decision: "approved" or decision: "denied"approved_by field"approved_by": "alice@example.com"Verify the policy version:
policy_version field"policy_version": "v1"Trace the full sequence:
"paused" entry (when approval was requested)"approved" or "denied" entry (human decision)Every decision leaves a complete audit trail in logs.jsonl:
Explanations: Every log entry includes an explanation field that shows why the action was auto-approved or required approval. This is deterministic and reproducible.
Human identity: For approved/denied decisions, the approved_by field records who made the decision. This is required before approving or denying, so every human decision is attributed.
Policy version: Every log entry includes policy_version (e.g., "v1"). This ties each decision to the specific rules that were active at that time. If you change rules, you can see which version applied to each historical decision.
Append-only format: Logs are written in JSONL format (one JSON object per line). Logs are append-only - entries are never modified or deleted. This ensures the audit trail cannot be tampered with.
How do we prove a human was involved?
decision: "paused" - this shows the action was intercepteddecision: "approved" or "denied" - this shows a human decision was madeapproved_by field - this shows which human made the decisionpolicy_version matches the rules you expectAll of this is in plain JSON that can be read, searched, and analyzed with standard tools.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.4 | 11 Jan 2026 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e1b5aa150c3d59f661e37d5c4b9a309e497cef4e6b82cb7bbb4b6328345b8582