Aegis-MCP
Aegis-MCP
A lightweight, cloud-native Zero-Trust Firewall, DLP Redactor & Cryptographic Audit Proxy for Model Context Protocol (MCP) servers, built with Python 3.12, FastAPI, Pydantic v2, SQLite, and uv.
Aegis-MCP sits between AI Agents (Claude Desktop, Cursor, autonomous orchestrators) and downstream MCP servers, inspecting every tools/call invocation in real time to block Indirect Prompt Injection, Destructive SQL/Shell Execution, and Path Traversal, while automatically scrubbing PII & Secrets and recording every decision in a tamper-evident SHA-256 hash-chained SQLite ledger.
Architecture
flowchart LR
host["MCP Host<br/>(Claude Desktop, Cursor, agents)"]
subgraph gateway["Aegis-MCP Gateway"]
direction LR
auth["Auth / RBAC / ABAC"]
canon["Canonicalize"]
threat["Threat Rules & Taint"]
dlp["DLP"]
ledger["SHA-256 Ledger & Merkle"]
auth --> canon --> threat --> dlp --> ledger
end
upstream["Upstream MCP Servers"]
host -->|"tools/call, resources/read, prompts/get"| auth
ledger -->|"ALLOWED / SANITIZED"| upstream
upstream -->|"toolguard-screened, DLP-redacted replies"| hostEvery request from an MCP host passes through the gateway pipeline in order: identity and policy checks (app/auth.py, app/policy.py, app/constraints.py), anti-evasion canonicalization (app/normalize.py), threat rules and toxic-flow taint tracking (app/firewall.py, app/taint.py), DLP redaction (app/redactor.py), and the hash-chained audit ledger with Merkle checkpoints (app/ledger.py, app/merkle.py). Only allowed or sanitized calls reach the upstream MCP server.
Key Capabilities
Zero-Trust MCP Tool-Call Inspection (
POST /api/v1/mcp/inspect):Evaluates MCP tool invocations (
agent_id,server_name,tool_name,arguments,environment) against deterministic security policies in< 2 ms.Threat Detection Engine (
app/firewall.py):prompt_injection: Blocks instruction override attempts (ignore previous instructions,system prompt:,<|im_start|>).path_traversal: Blocks unauthorized filesystem escapes (../,/etc/passwd,/etc/shadow,.ssh/id_rsa,.env).destructive_sql: Blocks destructive SQL/DDL payloads (DROP TABLE,TRUNCATE TABLE,DELETE FROM ... WHERE 1=1).command_injection: Blocks shell metacharacter chaining and destructive system commands (rm -rf,; curl,| bash,`,$()).
Real-Time DLP & Secret Redaction (
app/redactor.py):Automatically scrubs sensitive data inside nested tool arguments before forwarding to MCP servers or external LLMs:
Secrets & Tokens: OpenAI/Anthropic/GitHub keys (
sk-...,ghp_...,AKIA...) andBearertokens $\rightarrow$[REDACTED_SECRET].Emails: Standard email addresses $\rightarrow$
[REDACTED_EMAIL].IBANs: European/International bank accounts $\rightarrow$
[REDACTED_IBAN].
Tamper-Evident SHA-256 Audit Ledger (
GET /api/v1/audit&GET /api/v1/audit/verify):Every inspection decision (
ALLOWED,SANITIZED,BLOCKED) is persisted in an embedded SQLite ledger (sqlite3stdlib, default/tmp/aegis_mcp.dbforreadOnlyRootFilesystem: truecompatibility).Each record (hash v2,
app/ledger.py) computesentry_hashas the SHA-256 of the RFC 8785 (JCS) canonical JSON of the full entry (prev_hash, timestamp, identity/scope, decision, risk score, violations, DLP categories, sanitized-arguments digest, policy version/mode,would_block, MCP session id), forming an immutable chain verifiable viaGET /api/v1/audit/verify. Legacy v1 links (SHA256(prev_hash | timestamp | agent_id | server_name | tool_name | decision | risk_score)) are migrated additively and still verified; a v1 link after a v2 link is rejected as a downgrade.
Anti-Evasion Canonicalization (
app/normalize.py): threat rules and DLP also run on NFKC-normalized, zero-width/bidi-stripped (CVE-2021-42574), tag-revealed, homoglyph-folded, percent/HTML-decoded and bounded recursive Base64/hex-decoded views; matches only visible after decoding addobfuscated_payload.Prometheus Observability (
GET /metrics) & Perimeter Auth (X-API-Key):Zero-dependency Prometheus 0.0.4 text exposition tracking
aegis_mcp_requests_total,aegis_mcp_blocked_total,aegis_mcp_redactions_total,aegis_mcp_ledger_errors_total, and theaegis_mcp_inspection_duration_secondsSLO histogram (1 ms–500 ms buckets around the 10 ms p99 objective). Label values are sanitized and capped at 64 per label (overflow →other); noagent_id/session_idlabels.OpenTelemetry traces (
app/telemetry.py) over OTLP/HTTP with GenAI/MCP semantic conventions (gen_ai.system,mcp.server.name,mcp.tool.name,mcp.method.name,aegis.decision,aegis.risk_score, pseudonymizedaegis.session.id) for the HTTP server span, the JSON-RPC proxy,/mcpStreamable HTTP andMCPFirewall.inspect; W3Ctraceparentis honored.DLP-scrubbed structured JSON logs with
trace_id,span_id,request_id(X-Request-Id),decisionandrisk_score; Grafana dashboarddeploy/grafana/aegis-mcp.jsonandPrometheusRulealertsdeploy/prometheus/aegis-mcp-rules.yaml(p99 > 10 ms, toxic-flow / tool-drift spikes, chain/checkpoint errors).
4-Phase Zero-Tolerance CI/CD & Container Hardening:
Multi-stage
Dockerfilerunning underUID 10001(appuser) with Kubernetes manifests (k8s/) and OPA/Rego policies (policy/).
Threat Model, Security Policy & Compliance Mapping:
docs/THREAT-MODEL.md: STRIDE analysis for every trust boundary (MCP client, gateway transports, upstream servers, audit ledger and Ed25519 checkpoints, operators, webhooks/OTLP), a residual risk register, and a control matrix against the OWASP LLM Top 10 2025, OWASP Agentic AI Threats, MITRE ATLAS, NIST AI RMF, the EU AI Act (Art. 12 & 14) and ISO/IEC 42001.SECURITY.md: supported versions, private vulnerability disclosure (GitHub Security Advisories), response targets, and how to verify releases (cosign, SLSA) and the audit ledger (scripts/verify_ledger.py).
Related MCP server: Fetch MCP Server
Tech Stack
Layer | Technology |
Language & runtime | Python 3.12, managed with |
Web framework | FastAPI on Uvicorn (ASGI) |
Data validation & settings | Pydantic v2, |
Upstream transports |
|
Identity & cryptography | PyJWT, |
Policy | YAML RBAC/ABAC documents ( |
Audit storage | SQLite ( |
Observability | Prometheus text exposition, OpenTelemetry OTLP/HTTP, structured JSON logs |
Quality tooling | pytest, pytest-cov, mypy (strict), ruff, black, isort, bandit, pip-audit, radon, xenon, atheris, mutmut, k6 |
Delivery | Multi-stage |
Quick Start
Install as an Agent Skill (Claude Code, Cursor, Windsurf, Copilot)
Install the free, official Aegis-MCP skill from Agensi.io to let your coding agent wire app.stdio_wrap, generate RBAC/ABAC/taint YAML policies (dev-monitor.yaml / prod-strict.yaml), run tool-poisoning scans, and verify the audit ledger automatically.
make install # uv sync --frozen
make dev # uv run uvicorn app.main:app --reload --port 8000
make test # pytest with coverage (--cov-fail-under=85)
make check # full gate: lock, format, lint, types, SAST, deps, complexity, coverage, fuzz, detection, latency, red-team
make redteam # promptfoo adversarial red-team against the gateway (Node.js 22 / npx)
make docker # docker build -t aegis-mcp:latest .Local Run & Simulation
# Option A: Run locally with uv
uv run uvicorn app.main:app --reload --port 8000
# Option B: Run MCP security & DLP traffic simulation
uv run python -m scripts.simulate_mcp_traffic --dry-run
# Option C: Build and run hardened production container
docker build -t aegis-mcp:latest .
docker run --rm -p 8000:8000 aegis-mcp:latestFirewalling local stdio MCP servers (Claude Desktop / Cursor / Windsurf)
app.stdio_wrap sits between a local MCP host and any stdio MCP server subprocess:
uv run python -m app.stdio_wrap [--server-name NAME] [--agent-id AGENT] \
[--environment dev|staging|prod] [--policy PATH] [--db-path PATH] -- <command> [args...]Replace the server's command/args in your host's mcpServers config with the wrapper (use absolute paths; --directory points uv at this checkout):
{
"mcpServers": {
"filesystem": {
"command": "uv",
"args": [
"run", "--directory", "/opt/aegis-mcp", "python", "-m", "app.stdio_wrap",
"--server-name", "filesystem-mcp", "--agent-id", "cursor",
"--policy", "/opt/aegis-mcp/policy/local.yaml",
"--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "/srv/workspace"
]
},
"postgres": {
"command": "uv",
"args": [
"run", "--directory", "/opt/aegis-mcp", "python", "-m", "app.stdio_wrap",
"--server-name", "postgres-mcp", "--environment", "prod",
"--policy", "/opt/aegis-mcp/policy/local.yaml",
"--", "npx", "-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/app"
]
}
}
}Framing: UTF-8 newline-delimited JSON-RPC 2.0 on
stdin/stdout(lines capped at1 MiBfrom the host and5 MiBfrom the server); the server'sstderrand wrapper diagnostics go tostderronly.Inbound:
tools/call,resources/readandprompts/getrun the fullMCPFirewall.inspectpipeline (threat rules, RBAC,tool_constraints, toolguard drift/poisoning, toxic-flow taint, DLP, ledger). Blocked calls are never forwarded and are answered with-32003(violations,audit_hash). Discovery requests,notifications/*and client responses are DLP-redacted; other methods get-32601, client batches-32600.Outbound: replies are matched to their pending request and toolguard-screened (
initializepinning,*/listTOFU pinning, drift hiding, poisoning hiding, RBAC least-privilegetools/list), DLP-redacted (a redaction promotes the session toprivate_datataint), and reserved codes-32003/-32004are rewritten to-32000. Server-initiated messages are DLP-redacted; unsolicited responses are dropped.Session: one
stdio-<32 hex>session id per wrapper lifetime binds taint tracking and ledger v2 entries across every call.Secret hygiene: every
AEGIS_*variable (e.g.AEGIS_API_KEY,AEGIS_DLP_HMAC_KEY) is stripped from the server's environment; the server is spawned withshell=False.
Marketplace Plugin Bundle
plugins/aegis-mcp/ is a self-contained, publishable plugin bundle: a plugin.json manifest, logo, mcp_config.json stdio-wrapper template, and ready-to-use dev-monitor / prod-strict example policies. See the plugin README for installation and wiring, and the agent skill for the install, govern, and verify workflow.
Configuration
Gateway Environment Variables (AEGIS_*)
Variable | Default | Effect |
|
| Deployment environment of the gateway. In |
|
|
|
| unset | YAML RBAC/ABAC policy. Every decision records |
|
| Only operator-approved (pinned) tools/prompts may be listed or called. Drifted definitions are always blocked. |
|
| Scan discovered |
|
| JSON list of browser |
|
| Sliding idle lifetime and capacity ( |
|
| Wall-clock cap of one relayed SSE stream (and the upstream read timeout for streams). |
|
| Behavioral rate limiting ( |
|
| Token bucket per |
|
| Sliding window of sensitive reads ( |
|
| LRU cap of tracked buckets and velocity windows (bounded memory). |
|
| SQLite write-ahead logging for the audit ledger (readers never block the chain writer). |
| unset | Export OpenTelemetry traces over OTLP/HTTP. Unset follows |
| unset | OTLP/HTTP collector base URL (e.g. |
|
|
|
|
|
|
Native MCP Streamable HTTP (POST/GET/DELETE /mcp)
Point any Streamable HTTP MCP client at /mcp with X-Aegis-MCP-Server: <server> (and the usual auth). initialize mints a gateway Mcp-Session-Id bound to the caller, server and environment (the upstream's session id is never exposed); later requests without it get 400, unknown/foreign sessions 404, a mismatched MCP-Protocol-Version 400. Requests run the full firewall pipeline with ledger entries bound to the session; SSE replies are relayed event by event with per-event DLP (the final response is toolguard-screened and bound to the caller's id, a missing one becomes -32004); notifications/* and client responses are redacted and acknowledged with 202; GET relays the server-initiated stream; DELETE ends the session. JSON-RPC batches are accepted for sessions that negotiated 2025-03-26.
Poisoning scanner CLI
uv run python -m scripts.scan_mcp_server --url https://host/mcp --header "Authorization: Bearer <token>" --fail-on high
uv run python -m scripts.scan_mcp_server --manifest servers.json --json # {"servers": {...}} enables shadowing checksExit codes: 0 clean, 1 findings at/above --fail-on, 2 connection/protocol error.
Argument-level ABAC (tool_constraints)
default_action: deny
rules:
- server_name: "postgres-mcp"
allow_tools: ["query"]
tool_constraints:
- server_name: "filesystem-mcp"
path_allow: ["/srv/workspace"] # realpath-canonicalized: symlink / dot-dot escapes blocked
- server_name: "postgres-mcp"
tool_name: "query"
sql_mode: read_only # one SELECT/WITH, no write/DDL tokens outside literals
- tool_name: "fetch"
egress_allow: ["api.github.com", "*.example.org"]
max_bytes: 65536
max_items: 100Violations (argument_path_not_allowed, argument_sql_not_read_only, argument_egress_not_allowed, argument_max_bytes_exceeded, argument_max_items_exceeded) block with risk 100. Constrained keys default to path/file/file_path/filename/directory, query/sql/statement and url/uri/endpoint/href (override via path_args, sql_args, url_args).
Verification & Security Gates
Quality Gates
uv run black --check . && uv run isort --check-only --profile black . && uv run ruff check .
uv run mypy --strict app tests fuzz scripts
uv run pytest -v --cov=app --cov-report=term-missing --cov-fail-under=85
uv run python -m fuzz.fuzz_firewall --self-test
uv run python -m scripts.evaluate_detection --min-recall 0.95 --max-fpr 0.02 --min-cases 300
uv run python -m scripts.benchmark_latency --iterations 300 --max-p99-ms 10.0 --fail-on-regression
uv run python -m scripts.run_promptfoo_redteam --fail-on-failuremake check runs all of the above, plus uv lock --check, bandit, pip-audit, xenon and a stricter --cov-fail-under=90 test run.
Adversarial Red-Team (promptfoo, make redteam)
benchmarks/promptfoo/ is an offline promptfoo suite that attacks the real gateway. It needs no LLM API keys. promptfooconfig.yaml declares the cases, and the custom Python provider aegis_provider.py runs each one in-process through FastAPI's TestClient. Every run uses a temporary SQLite WAL ledger, an explicit red-team policy and AEGIS_ENVIRONMENT=prod in enforce mode, so it never touches .aegis_claude_audit.db or the default ledger. The suite covers 5 attack vectors plus benign controls:
Mode | What it proves |
| Direct and encoded instruction overrides (zero-width, bidi, fullwidth/NFKC, homoglyph, Base64, percent) are |
| Hidden |
| Tool descriptions that hijack another server's tools are blocked. A bare name collision is pinned as an advisory finding (score 60) |
|
|
| Obfuscated secrets and PII come back |
|
|
Attack strings are never committed verbatim. [[_]] splitters keep the YAML inert, [[SYNTH_*]] macros build synthetic secrets at runtime (gitleaks-clean), and encodings are applied by the provider. scripts/run_promptfoo_redteam.py uses an installed promptfoo binary, then the ~/.npm/_npx cache, then npx --yes promptfoo. It disables telemetry and update checks, prints the evaluated, passed and failed counts, and exits 0 only when every assertion passes and at least 15 cases ran. It exits 1 when the gate fails and 2 when promptfoo cannot run. CI runs the same command after installing Node.js 22.
make redteam # uv run python -m scripts.run_promptfoo_redteam --fail-on-failure
uv run python -m scripts.run_promptfoo_redteam --json-out redteam.json --timeout 120
AEGIS_REDTEAM_BASE_URL=http://127.0.0.1:8000 make redteam # attack a live gateway instead (optional AEGIS_REDTEAM_API_KEY)Latency Budget & Load Testing
The gateway has a 10 ms p99 latency budget per firewalled call.
Reproducible benchmark (make bench)
scripts/benchmark_latency.py runs two suites in-process against a temporary SQLite (WAL) audit ledger:
Suite | Scenarios |
|
|
| FastAPI end to end: |
For each scenario it reports p50 / p95 / p99 / max latency in ms and sequential throughput in rps. Output is a JSON report followed by a Markdown table; --json-out FILE also saves the JSON. Every run starts with untimed warm-up calls (--warmup, default 50) and then times --iterations calls (default 500).
make bench # or: uv run python -m scripts.benchmark_latency
make bench-gate # CI gate: --iterations 300 --fail-on-regression
uv run python -m scripts.benchmark_latency --skip-asgi --json-out bench.jsonCI regression gate. With --fail-on-regression, the script exits 1 when the worst inspect scenario p99 is above --max-p99-ms (default 10.0). CI runs this as the latency-gate step. Only the pure inspect overhead is gated, which catches algorithmic regressions in regex, canonicalization or DLP code. The ASGI numbers are reported but not gated, so CI does not fail on socket and thread-pool scheduling noise on shared runners.
Load test (k6, make load)
benchmarks/load_k6.js sends an open-model load (constant-arrival-rate) of 500 rps total, split evenly between /api/v1/mcp/inspect and /api/v1/mcp/jsonrpc. Its thresholds are http_req_duration p(99)<10 overall and per endpoint, plus http_req_failed < 1%. benchmarks/mock_upstream.py is a stdlib-only JSON-RPC echo server that stands in for a real MCP tool server.
uv run python benchmarks/mock_upstream.py --port 9100 &
AEGIS_MCP_UPSTREAMS='{"bench-mcp":"http://127.0.0.1:9100/mcp"}' \
uv run uvicorn app.main:app --port 8000 & # single worker: one SQLite chain writer
make load # k6 run benchmarks/load_k6.js (RATE=500 DURATION=60s)
make load RATE=1000 DURATION=2m BASE_URL=http://gateway:8000Pass API_KEY (k6 run -e API_KEY=...) when AEGIS_API_KEY is set. k6 exits non-zero when any threshold is breached.
Detection Benchmark
benchmarks/corpus/*.jsonl holds a reproducible, labeled corpus of 348 cases (154 benign, 194 malicious). It is generated deterministically by scripts/build_benchmark_corpus.py. Attack strings and encodings are assembled at runtime, and secret-shaped DLP values are stored as {{SYNTH_*}} macros that the evaluator expands in memory, so no real credential is committed. scripts/evaluate_detection.py runs every case against Aegis-MCP in-process, using a temporary audit ledger and per-case policy and taint isolation. It enforces the CI gate recall >= 0.95, FPR <= 0.02, cases >= 300, plus an intact audit hash chain. The exit code is 0 on pass, 1 on a failed KPI, and 2 on an invalid corpus.
uv run python -m scripts.build_benchmark_corpus # regenerate the corpus
uv run python -m scripts.evaluate_detection --json # machine-readable reportCorpus schema
Every record has id, category, expected_flagged, kind, and three taxonomy tags: owasp_llm_2025, owasp_agentic, and mitre_atlas (N/A for benign). Each kind selects an engine and its own flagging rule:
| Engine | Flagged when |
|
| enforce mode would block, or DLP redacted a category |
|
| a finding scores at least the block threshold (70) |
|
| any step would be blocked (e.g. toxic-flow taint) |
Benign cases are realistic developer traffic. They include SELECT queries, git operations, workspace file reads, Markdown with code blocks, JSON and Kubernetes payloads, UUIDs, SHA-256 digests, timestamps, Luhn-invalid order IDs, and mod-97-invalid IBAN look-alikes. Multi-step sessions in the benign set are missing one leg of the lethal trifecta.
Measured results
The figures below are the evaluator's output for the committed corpus. Latency is per case, measured in-process on a developer workstation, and varies by host.
Metric | Value |
Cases | 348 |
TP / FP / TN / FN | 185 / 0 / 154 / 9 |
Precision | 1.0000 |
Recall | 0.9536 |
F1 | 0.9763 |
False positive rate | 0.0000 |
Latency p50 / p99 | 0.63 ms / 4.07 ms |
Category | Cases | TP | FN | Recall |
| 25 | 24 | 1 | 0.960 |
| 22 | 20 | 2 | 0.909 |
| 17 | 15 | 2 | 0.882 |
| 20 | 20 | 0 | 1.000 |
| 25 | 24 | 1 | 0.960 |
| 22 | 20 | 2 | 0.909 |
| 20 | 20 | 0 | 1.000 |
| 17 | 16 | 1 | 0.941 |
| 26 | 26 | 0 | 1.000 |
| 154 | 154 TN | 0 FP | FPR 0.000 |
Taxonomy coverage (malicious cases)
Taxonomy | Tag | Cases | Recall |
OWASP LLM Top 10 2025 | LLM01:2025 Prompt Injection | 50 | 0.960 |
OWASP LLM Top 10 2025 | LLM02:2025 Sensitive Information Disclosure | 63 | 0.984 |
OWASP LLM Top 10 2025 | LLM03:2025 Supply Chain | 22 | 0.909 |
OWASP LLM Top 10 2025 | LLM05:2025 Improper Output Handling | 22 | 0.909 |
OWASP LLM Top 10 2025 | LLM06:2025 Excessive Agency | 37 | 0.946 |
OWASP Agentic AI Threats | ASI01 Goal Hijack | 50 | 0.960 |
OWASP Agentic AI Threats | ASI02 Tool Misuse | 59 | 0.932 |
OWASP Agentic AI Threats | ASI03 Identity & Privilege Abuse | 46 | 1.000 |
OWASP Agentic AI Threats | ASI04 Supply Chain / Tool Poisoning | 22 | 0.909 |
OWASP Agentic AI Threats | ASI07 Memory & Context Poisoning | 17 | 0.941 |
MITRE ATLAS | AML.T0010 ML Supply Chain Compromise | 22 | 0.909 |
MITRE ATLAS | AML.T0048 External Harms / Exfiltration | 17 | 0.941 |
MITRE ATLAS | AML.T0051 LLM Prompt Injection | 25 | 0.960 |
MITRE ATLAS | AML.T0053 LLM Plugin Compromise | 59 | 0.932 |
MITRE ATLAS | AML.T0054 LLM Jailbreak | 25 | 0.960 |
MITRE ATLAS | AML.T0057 LLM Data Leakage | 46 | 1.000 |
Known detection gaps
The corpus keeps 9 documented false negatives, each labeled known gap in its description. The gate asserts that every miss is one of them:
Prompt injection whose words are separated by newlines or tabs. JSON serialization escapes the control whitespace, so the phrase never reaches the regex in contiguous form.
Command substitution with backticks, and
&&chaining to a downloader.SQL keywords separated by inline comments, and an unbounded
DELETEwithout a tautology. Usesql_mode: read_onlyto cover these.0x-prefixed hex payloads, which are not decoded.An http(s) URL embedded in prose on a non-sink tool. Egress detection only matches values that start with a scheme.
Medium-severity poisoning signals on their own, such as a context-siphoning parameter name or a bare cross-server name collision. These score 60, below the block threshold.
Threat Model, Security Policy & Roadmap
docs/THREAT-MODEL.md: STRIDE threat model, residual risk register and compliance control matrix. Security-relevant changes must keep it up to date.SECURITY.md: supported versions and private vulnerability disclosure. Report vulnerabilities privately as described there.BACKLOG.md: the prioritized engineering backlog.
Available Tools
5 toolsaegis_get_policy_statusARead-onlyIdempotent
Return the active Aegis-MCP runtime security configuration: deployment environment, enforcement mode ('enforce' or 'monitor'), fail-closed state, RFC 8785 canonical policy SHA-256 version, block threshold score, and DLP/taint/rate-limit feature flags. Read-only status check; does not inspect calls or mutate policy.
Inputs: no named parameters.
aegis_inspect_tool_callA
Evaluate a proposed MCP tool invocation against Aegis-MCP's Zero-Trust firewall (prompt injection, path traversal, destructive SQL, shell command injection, obfuscation decoding, RBAC/ABAC policies, session taint tracking, and deterministic DLP redaction) and append an immutable record to the SHA-256 hash-chained audit ledger. Use this before executing untrusted or high-risk MCP tool calls. Do NOT use this for read-only text scrubbing without auditing (use aegis_redact_sensitive_data instead) or for static manifest scanning (use aegis_scan_mcp_manifest instead).
Inputs: tool_name (required), server_name (required), agent_id, arguments, +2 more.
aegis_redact_sensitive_dataARead-onlyIdempotent
Deterministically redact PII and secrets (emails, Luhn-validated credit cards, ISO 7064 mod-97 IBANs, Spanish DNI/NIE, JWTs, PEM private keys, cloud/API tokens, E.164 phone numbers, and high-entropy secrets) from free-form text or a JSON object. Read-only and idempotent; does not write to the audit ledger. Provide at least one of 'text' or 'payload'. Do NOT use this when you need threat scoring or RBAC enforcement (use aegis_inspect_tool_call instead).
Inputs: text, payload.
aegis_scan_mcp_manifestARead-onlyIdempotent
Statically scan an MCP server manifest (server instructions, tools, prompts, and resources) for tool poisoning, hidden instruction tags, concealment directives, Unicode bidi/tag smuggling, context-siphoning parameters, and cross-server shadowing. Read-only and deterministic. Use this when auditing third-party or newly discovered MCP server definitions before trusting them. Do NOT use this for live runtime tool-call arguments (use aegis_inspect_tool_call instead).
Inputs: manifest (required), server_name (required), foreign_tools.
aegis_verify_audit_chainARead-onlyIdempotent
Cryptographically verify the SHA-256 hash chain of the Aegis-MCP SQLite audit ledger across all v1 and full-payload v2 entries. Returns validity status, total entries, legacy v1 count, latest head hash, and the first tampered entry ID if corruption is detected. Read-only; does not alter ledger state.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each of the five tools targets a clearly distinct operation: ledger verification, policy status readout, live call inspection, text redaction, and static manifest scanning. The descriptions explicitly cross-reference each other with 'Do NOT use this for... use X instead' guidance, eliminating any realistic misselection.
All tools follow a uniform 'aegis_verb_noun' snake_case pattern (verify_audit_chain, get_policy_status, inspect_tool_call, redact_sensitive_data, scan_mcp_manifest). The prefix and verb style are consistent and the nouns clearly identify the target resource.
Five tools is well within the ideal 3-15 range for a focused security firewall server. Every tool covers a distinct stage of the trust pipeline (manifest scan, runtime inspect, redact, policy, audit verify) with no filler.
The surface covers the core lifecycle: pre-trust manifest scanning, runtime call evaluation, redaction, policy introspection, and audit-chain verification. Minor gaps exist around policy mutation/configuration and querying or exporting individual audit records beyond chain verification, but these appear intentional for a read-only enforcement layer.
Maintenance
Related MCP Connectors
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
AgentGuard — 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- FlicenseAqualityBmaintenanceNode.js server implementing Model Context Protocol (MCP) for filesystem operations.72141,143,812 npm92,301-
- AlicenseAqualityBmaintenanceThis server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.1208,289 PyPI92,301MIT
- -licenseNot gradedqualityBmaintenanceMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.127,455 npm92,301MIT
- AlicenseNot gradedqualityDmaintenancePolicy-enforcing MCP proxy that blocks dangerous tool calls before they execute. Protects credentials, filesystem, shell, and databases across Claude Desktop, Cursor, Windsurf, and OpenClaw.13 npm41Apache 2.0