๐ก๏ธ AI Failure Observatory
Behavioral safety, vulnerability probing, and product-risk auditing for Generative AI & Large Language Models.
A lightweight, local-first platform and Model Context Protocol (MCP) Server designed to detect, track, stress-test, and report on 6 critical LLM behavioral failure modes before deploying models into mission-critical production workflows.
Built with Zero External Core Dependencies using Python's standard library (http.server, urllib.request, json, sqlite3/file persistence) with optional FastMCP connectivity for autonomous AI safety agents.
๐ธ Visual Showcase
๐ Real-Time Risk Index & Incident Observatory Dashboard
Monitors aggregate system risk, incident distributions across 6 failure modes, and severity breakdowns.
โก Live Adversarial Vulnerability Probing & Red-Teaming Studio
Direct multi-provider model stress-testing (Gemini, Claude, OpenAI, Offline) with automated heuristics.
๐ฌ Reproducible Failure Benchmark Evaluations
Systematic verification suite running automated hallucination, context loss, and drift detection tests.
๐๏ธ Architecture Overview
flowchart TD
subgraph PresentationLayer["๐ฅ๏ธ Presentation & Client Interfaces"]
WebUI["Single-Page Dashboard (index.html)"]
Bilingual["TR โท EN Internationalization Engine"]
ReportExport["Markdown / JSON Audit Exporter"]
end
subgraph DualAccessLayer["โก Dual-Mode Core Interfaces"]
HTTPServer["Web Dashboard (server.py on Port 5089+)"]
MCPServer["Model Context Protocol Server (mcp_server.py)"]
end
subgraph AnalysisEngine["๐ง Behavioral Safety Analyzers"]
FailureAnalyzer["src/failure_analyzer.py
(Heuristic & Pattern Detection)"]
RiskEngine["analysis/risk_analysis.py
(Composite Risk Index Calculation)"]
EvalRunner["experiments/reproducible_evals/run_all_evals.py
(Automated Benchmarks)"]
end
subgraph ModelLayer["๐ค Multi-Provider LLM Gateway"]
HeuristicSim["Built-in Heuristic Simulator (Offline)"]
Gemini["Google Gemini (2.0 Flash / 1.5 Pro)"]
OpenAI["OpenAI (GPT-4o / o3-mini)"]
Claude["Anthropic Claude (3.5 Sonnet)"]
end
subgraph AIAssistants["๐ค AI Safety Agents"]
ClaudeDesktop["Claude Desktop"]
CursorIDE["Cursor IDE"]
Antigravity["Google Antigravity"]
end
PresentationLayer <--> HTTPServer
MCPServer <==> AIAssistants
DualAccessLayer <--> AnalysisEngine
AnalysisEngine <--> ModelLayer
AnalysisEngine <--> StorageLayer["๐พ Persistent Incident Storage (data/incidents.json)"]
๐ Model Context Protocol (MCP) Server
AI Failure Observatory acts as an autonomous AI Safety & Red-Teaming Inspector over MCP. AI assistants in Claude Desktop, Cursor, VS Code, or Antigravity can audit generated text for safety violations, evaluate prompts for vulnerabilities, query formal risk taxonomies, and execute benchmark evaluations without opening a browser.
๐ ๏ธ Exposed MCP Tools
| MCP Tool | Parameters | Description |
|---|---|---|
audit_prompt_response |
prompt, response, model |
Audits an LLM prompt-response pair for all 6 failure modes (hallucinations, fake confidence, manipulation, drift, context loss, reasoning collapse). |
get_failure_taxonomy |
failure_type (optional) |
Returns formal taxonomy definitions, severity ratings (1-10), product risk implications, and concrete mitigations. |
get_risk_report |
None | Generates the real-time AI product risk scorecard, incident distributions, and high-priority vulnerability areas. |
log_safety_incident |
model_name, prompt, response, failure_type, severity... |
Records a confirmed model failure into the persistent incident database for compliance auditing. |
scan_multi_turn_conversation |
turns_json |
Scans multi-turn dialogues for conversational amnesia, working memory degradation, and progressive instruction drift. |
run_benchmark_evaluations |
None | Executes the automated reproducible evaluation benchmark suite across all failure modes and returns structured results. |
๐ Claude Desktop & Cursor Setup
Add the following to your claude_desktop_config.json or Cursor MCP settings:
{
"mcpServers": {
"ai-failure-observatory": {
"command": "uvx",
"args": ["ai-failure-observatory"]
}
}
}
๐ก Example AI Prompts with MCP
Once connected, ask your AI assistant:
- "Audit this model response for invented citations or academic hallucination."
- "What are the product mitigations for fake confidence and calibration errors according to the failure taxonomy?"
- "Scan this 5-turn conversation transcript for context loss and negative instruction drift."
- "Run the benchmark evaluation suite and give me the pass/fail score across all failure modes."
๐ฌ Formal AI Failure Taxonomy
The platform models failures across two primary axes defined in taxonomy/ai_failure_taxonomy.md:
| Category | Failure Mode | Severity | Detection Heuristics | Product Risk Impact |
|---|---|---|---|---|
| Output Unreliability | hallucinations |
HIGH (9/10) | Invented academic citations, fake ISBN/DOIs, fabricated biographies. | Misinformation propagation, hallucinated API arguments, user liability. |
| Output Unreliability | fake_confidence |
MEDIUM (4/10) | Dogmatic certainty markers ("undoubtedly", "100% verified") on ungrounded facts. | Unwarranted user reliance, failure to seek human verification. |
| Output Unreliability | context_loss |
LOW (2/10) | Multi-turn conversational forgetting of initial system/user constraints. | Broken agentic workflows, repetitive loops, context degradation. |
| Behavioral Alignment | instruction_drift |
MEDIUM (4/10) | Violation of explicit negative constraints ("Do NOT mention X", forbidden words). | Brand compliance violations, prompt boundary breaches. |
| Behavioral Alignment | manipulation |
CRITICAL (9/10) | Dark patterns, emotional urgency nudging, subtle commercial steering. | Consumer deception, predatory persuasion, regulatory scrutiny. |
| Behavioral Alignment | recursive_reasoning_collapse |
LOW (2/10) | Semantic degeneration, circular logic loops, repetitive phrase degradation. | Infinite reasoning loops, high token consumption, compute waste. |
๐ ๏ธ Quick Start
1. Zero-Install Execution via uvx
# Launch the Web Dashboard (Port 5089)
uvx ai-failure-observatory --web
# Launch MCP Stdio Server (for AI agents)
uvx ai-failure-observatory
2. Standard Installation via pip
pip install ai-failure-observatory
ai-failure-observatory --web
3. Local Development & Testing
git clone https://github.com/adacreativeco/ai-failure-observatory.git
cd ai-failure-observatory
python server.py
Open http://localhost:5089 in your browser.
# Run automated tests
python -m unittest discover tests
# Run benchmark suite
python experiments/reproducible_evals/run_all_evals.py
๐ Project Structure
ai-failure-observatory/
โโโ server.py # Zero-dependency HTTP server & REST API
โโโ mcp_server.py # Model Context Protocol (MCP) server entry point
โโโ index.html # Dark-glassmorphic SPA dashboard
โโโ pyproject.toml # Standard Python packaging metadata
โโโ requirements.txt # Optional dependencies
โโโ analysis/
โ โโโ risk_analysis.py # Composite risk calculation & report generator
โ โโโ reports/ # Generated compliance reports (JSON/Markdown)
โโโ src/
โ โโโ failure_analyzer.py # 6 Core behavioral heuristic analyzers
โ โโโ mcp_tools.py # MCP safety inspection & auditing tools
โ โโโ llm_client.py # Multi-provider LLM connector (Gemini, Claude, OpenAI)
โ โโโ storage.py # JSON incident storage engine
โ โโโ utils.py # Formatter & helper utilities
โโโ taxonomy/
โ โโโ ai_failure_taxonomy.md # Formal failure mode taxonomy
โ โโโ taxonomy_utils.py # Taxonomy parser and validator
โโโ experiments/
โ โโโ reproducible_evals/ # Automated reproducible benchmark tests
โ โ โโโ run_all_evals.py # Master test runner
โ โ โโโ test_hallucination_citation.py
โ โ โโโ test_fake_confidence.py
โ โ โโโ test_context_loss.py
โ โ โโโ test_instruction_drift.py
โ โ โโโ test_manipulation.py
โ โ โโโ test_recursive_collapse.py
โ โโโ synthetic/ # Synthetic test data generators
โโโ tests/
โโโ test_observatory.py # Core observatory unit test suite
โโโ test_mcp.py # MCP tools & server test suite (21 tests total)
๐ License
Distributed under the Apache 2.0 License. See LICENSE for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_failure_observatory-1.0.0.tar.gz.
File metadata
- Download URL: ai_failure_observatory-1.0.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22e94ce691e94a9fa2be4429d16a0bb67188543d995de931ef4a50dd78e3f7d4
|
|
| MD5 |
3502e1c49c233b4decfe0277d92f4bd8
|
|
| BLAKE2b-256 |
c516f3c1be13b1437ff29a691b5335c515ffccc486283c37586893b7102a2f35
|
File details
Details for the file ai_failure_observatory-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ai_failure_observatory-1.0.0-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
421fcfa3cc84a591c81e79ed0157c1fa4d03524ce8d51ad8327ac8c703d0bb3a
|
|
| MD5 |
a2b1d9737deb3f8dc6fa5cb286f996d4
|
|
| BLAKE2b-256 |
5c119530cea5d223669e1d8351dc848033ab16e84d3e7112c931a774dbcfbff1
|