Try It Out
Run Demo
A full end-to-end attack simulation that demonstrates how Mithril protects Cognee memory from poisoning. Seeds legitimate policies, fires off attacks, and shows which writes are admitted, reviewed, quarantined, or rejected.
What the Demo Does
📋
Phase 1 — Seed Legitimate Memory
Loads 3 verified security policies (Argon2id hashing, cost factor requirements, bcrypt fallback) directly into the verified Cognee dataset to establish the clean baseline the attacks are checked against.
⚡
Phase 2 — Simulate Attacks
Fires 3 poisoning attempts: a direct contradiction via Slack ("use MD5"), a deprecation claim from an unknown agent, and misinformation via email. All should be blocked.
✅
Phase 3 — Legitimate Update
Ingests a genuine policy update from the CISO to prove real updates still pass the trust gate without being blocked.
🔍
Phase 4 — Query Verified Memory
Asks "How should we hash passwords?" — the answer comes only from verified memory. Poisoned claims are excluded.
Running the Demo
1
Prerequisites
Make sure you have the project installed and .env configured with your LLM_API_KEY (needed for contradiction and content-danger scoring via the LLM):
terminal
uv pip install -e ".[dev]"
# macOS / Linux / WSL
cp .env.example .env
# Windows PowerShell
Copy-Item .env.example .env
# Set LLM_API_KEY, LLM_ENDPOINT, and LLM_MODEL in .env2
Run the attack demo
terminal
# Windows, using this repo's Makefile
make demo
# macOS / Linux / WSL
python demo/run_demo.py3
Compare: run without Mithril
See what happens when Cognee has no protection — all poisoned claims are stored and returned:
terminal
# Windows, using this repo's Makefile
make vanilla
# macOS / Linux / WSL
python demo/vanilla_demo.pyExpected Output
The demo prints a colorized, step-by-step report. Exact scores and statuses can vary with the configured LLM, but the flow looks like this:
demo output (abbreviated)
============================================================
MITHRIL — Attack Demo
Protecting Cognee from memory poisoning
============================================================
PHASE 1: Loading legitimate security policies
Directly seeding into Cognee: Passwords must be hashed using Argon2id...
✅ SEEDED
Directly seeding into Cognee: Argon2id requires minimum cost factor...
✅ SEEDED
Directly seeding into Cognee: bcrypt is acceptable as a fallback...
✅ SEEDED
→ 3 pre-verified policies now in Cognee baseline
PHASE 2: Simulating memory poisoning attacks
⚡ Attack 1: Direct contradiction via Slack
🚫 QUARANTINE / ❌ REJECT
Reason: Low trust, contradiction, or dangerous content
⚡ Attack 2: Subtle deprecation claim from unknown agent
🚫 QUARANTINE / ❌ REJECT
Reason: Low-trust source plus contradiction or dangerous content
⚡ Attack 3: Plausible misinformation via email
🚫 QUARANTINE / ❌ REJECT
Reason: Contradicts verified memory
PHASE 4: Querying verified memory
Question: How should we hash passwords?
Mithril Answer: Passwords must be hashed using Argon2id
with a minimum cost factor of 12...
PHASE 5: Audit Summary
Attacks blocked: N / 3
Graph saved → artifacts/mithril_graph.htmlOther Demo Scripts
📂
Ingest Demo
python demo/ingest_demo.py — Bulk-ingest a Slack export JSON through Mithril, demonstrating the batch ingestion pipeline with trust scoring applied to every message.🌱
Seed Data
python demo/seed_data.py — Pre-load a set of verified policies without the full attack sequence. Useful for populating the dashboard with realistic data.