# Aegis — AI Agent Governance

An MCP server that sits between an agent and its tools. Each call is matched against YAML rules and then runs, waits for a human yes, or gets blocked.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 18
- Author: Acacian
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Acacian/aegis
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/mcp/aegis-ai-agent-governance

## What it does

Launch it with `uvx agent-aegis` over stdio and point `AEGIS_POLICY_PATH` at the YAML file. A shell command, an HTTP request, an MCP action: all of them arrive as an `Action` object, and the matching rule returns `auto`, `approve` or `block`.

Tool names are only part of it. Hand-offs between agents carry a trust level that stays level or drops, never climbs. Audit events go into an append-only log chained with Merkle hashes and fan out to SQLite, JSONL and a webhook. Regex detectors cover prompt injection, PII, prompt leakage and toxicity. No second model sits in the request path, so a verdict is deterministic.

Adapters cover LangChain, CrewAI, OpenAI Agents, Google ADK, MCP transport, DSPy, httpx and Playwright, and `aegis.auto_instrument()` wraps whichever of them are already installed. Your own checks join through `GuardrailEngine.add()`. The machine needs `uv` present, otherwise `uvx` has nothing to run. MIT license.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `AEGIS_POLICY_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env AEGIS_POLICY_PATH=<AEGIS_POLICY_PATH> --transport stdio aegis-ai-agent-governance -- uvx agent-aegis
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agent-aegis <command>

### Codex

**Platform CLI**
```bash
codex mcp add aegis-ai-agent-governance --env AEGIS_POLICY_PATH=<AEGIS_POLICY_PATH> -- uvx agent-aegis
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agent-aegis <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "aegis-ai-agent-governance": {
            "command": "uvx",
            "args": [
                "agent-aegis"
            ],
            "env": {
                "AEGIS_POLICY_PATH": "<AEGIS_POLICY_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agent-aegis <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "aegis-ai-agent-governance": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "agent-aegis"
            ],
            "env": {
                "AEGIS_POLICY_PATH": "<AEGIS_POLICY_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agent-aegis <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e AEGIS_POLICY_PATH=<AEGIS_POLICY_PATH> aegis-ai-agent-governance uvx agent-aegis
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from agent-aegis <command>

## When to use it
- keep an agent out of production tables
- hold a destructive shell command until someone approves
- mask customer PII inside tool arguments
- catch a prompt injection before the agent acts
- leave an audit trail that resists quiet edits

## Example prompts
- Which Aegis rules would fire on a `bash` call that deletes a directory?
- List the audit events Aegis recorded in this session
- Tighten the policy so every `git push` needs approval

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109
- [Robin: AI-Powered Dark Web OSINT](https://affpapa.org/en/nevibecode/mcp/robin-ai-powered-dark-web-osint.md) — MCP server · ★ 7658
- [jshookmcp](https://affpapa.org/en/nevibecode/mcp/jshookmcp.md) — MCP server · ★ 2061
- [OpenOSINT](https://affpapa.org/en/nevibecode/mcp/openosint.md) — MCP server · ★ 1802

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
