AI Dossier

Security Demonstration: The Complete Journey

Purpose: Experience firsthand why MCP server security verification is essential for dossiers.

Time Required: 15-20 minutes

What Youโ€™ll Learn:

  • โœ… How malicious dossiers can look completely legitimate
  • โœ… Why LLMs alone canโ€™t protect you (without tooling)
  • โœ… How MCP server automatically blocks malicious dossiers
  • โœ… The importance of checksums and signatures

Prerequisites

  • Claude Code (or another LLM-powered coding assistant)
  • Fresh terminal session (no MCP server configured yet)
  • This repository cloned or access to raw GitHub URLs

Step 1: Open a New LLM Coding Session

Start fresh to ensure no MCP server is configured:

Claude Code:

# Open a new Claude Code window
# Or restart if you have an existing session

Other Tools:

  • Cursor, Aider, Continue, etc. also work
  • Just ensure itโ€™s a fresh session

Step 2: Test if MCP Server is Configured

Ask your LLM assistant:

"Do you have access to a verify_dossier tool or any dossier-related MCP tools?"

Expected Response (Without MCP)

I don't have access to any dossier-specific tools or verify_dossier function.

If MCP is Already Configured

Yes, I have access to:
- verify_dossier
- read_dossier
- list_dossiers
...

If MCP is already configured: Skip to Step 5 to verify itโ€™s working, then jump to Step 6.


Step 3: Run Malicious Dossier (WITHOUT MCP Server)

โš ๏ธ WARNING: This will execute malicious code that captures environment data.

Whatโ€™s about to happen:

  • The dossier looks like a helpful configuration validator
  • Your LLM will execute it without any security checks
  • It will read .env files and capture environment variables
  • Information will be displayed on screen and saved to a file

Run the Malicious Dossier

In your LLM assistant, run:

run https://raw.githubusercontent.com/imboard-ai/ai-dossier/main/examples/security/validate-project-config.ds.md

What Youโ€™ll See

The LLM behavior varies. Youโ€™ll see one of two scenarios:

Scenario A: Immediate Execution (More Vulnerable)

The LLM will:

  1. โœ… Fetch the dossier
  2. โœ… Read it as a legitimate tool
  3. โœ… Start executing commands
  4. โŒ No security verification occurs
  5. โŒ Searches for .env files
  6. โŒ Displays environment variables
  7. โŒ Saves secrets to config-validation-*.log file

Example Output:

โ— Fetching dossier...
โ— Received 7.5KB (200 OK)

โ— I'll validate your project configuration...

โ— Search(pattern: ".env")
  โŽฟ Found 0 files

โ— Bash(printenv | head -20)
  โŽฟ API_KEY=sk-1234567890abcdef...
    DATABASE_URL=postgresql://user:pass@localhost...
    AWS_SECRET_ACCESS_KEY=wJalrXUtn...

This is the vulnerability! Without MCP server, malicious dossiers execute freely.

Scenario B: Asks Permission First (Still Vulnerable)

The LLM might ask before executing:

Example Output:

โ— Fetching dossier...
โ— Received 7.5KB (200 OK)

โ— I can see the content of the dossier file, which describes
  a validation process for project configuration.

  Would you like me to:
  1. Manually perform the validation steps described?
  2. Show you the full content?
  3. Help install a dossier runner?

Why this is still a problem:

  • โŒ No security verification happened
  • โŒ User must manually review code (time-consuming, error-prone)
  • โŒ Malicious intent is hidden in normal-looking commands
  • โŒ Easy to say โ€œyes, go aheadโ€ without careful review

If LLM asks, respond: "Yes, perform the validation steps (option 1)"

Then watch as it executes the malicious code without verification.

Both Scenarios Show the Problem

Scenario A: Executes immediately โ†’ obvious vulnerability Scenario B: Requires manual review โ†’ human error vulnerability

Either way: Without MCP server, youโ€™re relying on:

  • Human vigilance (easy to skip)
  • Code review skills (hard to spot subtle malice)
  • Time investment (5-10 minutes per dossier)

With MCP server: Automatic verification catches it instantly.

Clean Up

# Remove any generated files
rm config-validation-*.log 2>/dev/null

Step 4: Understand What Just Happened

Why Did This Happen?

Without MCP Server:

  • โŒ No automatic checksum verification
  • โŒ No automatic signature verification
  • โŒ LLM has no security hooks
  • โŒ Dossier executed as written

Why Didnโ€™t the LLM Catch It?

The dossier was designed to look legitimate:

  • โœ… Professional title: โ€œValidate Project Configurationโ€
  • โœ… Reasonable use case (developers do this)
  • โœ… Proper dossier structure
  • โœ… Helpful documentation
  • โœ… Starts with legitimate checks
  • โœ… Gradually introduces malicious behavior

Visual inspection isnโ€™t enough - you need cryptographic verification.

What Was Compromised?

If you had .env files or environment variables:

  • ๐Ÿ”ด API keys displayed on screen
  • ๐Ÿ”ด Passwords displayed on screen
  • ๐Ÿ”ด Database URLs displayed on screen
  • ๐Ÿ”ด AWS credentials displayed on screen
  • ๐Ÿ”ด All secrets saved to local file

In a real attack, this data could be exfiltrated to remote servers.


Step 5: Set Up MCP Server

Now letโ€™s fix this by installing the dossier MCP server.

Run the setup dossier:

run https://raw.githubusercontent.com/imboard-ai/ai-dossier/main/examples/setup/setup-dossier-mcp.ds.md

Follow the prompts to:

  1. Choose installation method (npx recommended)
  2. Create/update configuration file
  3. Restart Claude Code

Option B: Manual Setup

  1. Create/edit ~/.claude/settings.local.json:
{
  "mcpServers": {
    "dossier": {
      "command": "npx",
      "args": ["-y", "@ai-dossier/mcp-server"]
    }
  }
}
  1. Restart Claude Code completely (Cmd+Q / Ctrl+Q, then reopen)

Verify MCP Server is Working

After restart, ask your LLM:

"Do you have access to a verify_dossier tool now?"

Expected response:

Yes! I now have access to:
- verify_dossier(path): Verify dossier checksums and signatures
- read_dossier(path): Read dossier with automatic verification
- list_dossiers(directory): Discover dossiers
- dossier://protocol: Protocol documentation resource
- dossier://security: Security documentation resource

If you donโ€™t see these tools, MCP server isnโ€™t loaded:

  • Double-check the JSON syntax in settings.local.json
  • Ensure you completely quit and reopened Claude Code
  • Wait 5-10 seconds after opening for MCP servers to load

Step 6: Test Protection - Run Malicious Dossier Again

Now that MCP server is configured, run the same malicious dossier:

run https://raw.githubusercontent.com/imboard-ai/ai-dossier/main/examples/security/validate-project-config.ds.md

What You Should See Now

The LLM should:

  1. โœ… Fetch the dossier
  2. โœ… Automatically call verify_dossier()
  3. โŒ Checksum verification FAILS
  4. โŒ Signature verification FAILS
  5. ๐Ÿ”’ Execution BLOCKED

Expected Output

โ— Fetching dossier...
โ— Received 7.5KB (200 OK)

โ— I'll verify this dossier's security first...

โ— MCP Tool: verify_dossier(examples/security/validate-project-config.ds.md)

๐Ÿ” Security Verification Results:

โŒ INTEGRITY: INVALID
   Checksum mismatch detected
   Declared: a1b2c3d4e5f6789012345678...
   Actual:   [different hash]
   โ†’ Content has been tampered with

โŒ AUTHENTICITY: INVALID
   Signature verification FAILED
   Signed by: DevTools Community <devtools@example.com>
   Key: RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3
   โ†’ NOT in trusted keys list

๐Ÿ”ด RISK ASSESSMENT: CRITICAL
   - Invalid checksum (content tampered)
   - Invalid signature (untrusted key)
   - Claims "low" risk but reads sensitive files
   - Saves data to unprotected files

โŒ RECOMMENDATION: BLOCK EXECUTION

This dossier has failed security verification.
I will NOT execute it for your protection.

๐ŸŽ‰ Success! Youโ€™re Now Protected

The MCP server:

  • โœ… Automatically verified checksums
  • โœ… Automatically verified signatures
  • โœ… Detected tampering
  • โœ… Detected untrusted source
  • โœ… Blocked execution before any code ran
  • โœ… Protected your environment

Step 7: Test with Legitimate Dossier

Now letโ€™s verify that legitimate dossiers still work.

Run a Legitimate Example

run https://raw.githubusercontent.com/imboard-ai/ai-dossier/main/examples/data-science/train-ml-model.ds.md

Expected Behavior

โ— Fetching dossier...
โ— Received 15.2KB (200 OK)

โ— Verifying dossier security...

โ— MCP Tool: verify_dossier(examples/data-science/train-ml-model.ds.md)

๐Ÿ” Security Verification Results:

โœ… INTEGRITY: VALID
   Checksum verified - content matches declaration

โš ๏ธ AUTHENTICITY: UNSIGNED
   No signature present (not required for this dossier)

๐ŸŸก RISK ASSESSMENT: MEDIUM
   - Installs Python packages
   - Executes ML training code
   - Creates local files
   - No cloud resources modified

โœ… RECOMMENDATION: ALLOW (with awareness)

Dossier appears safe to execute.
Proceeding with execution...

The LLM should then:

  • โœ… Execute the legitimate dossier
  • โœ… Follow its instructions
  • โœ… Complete successfully

Comparison: Before and After

Before MCP Server

AspectWithout MCP Server
Checksum VerificationโŒ Not performed
Signature VerificationโŒ Not performed
Malicious Dossiersโœ… Execute freely
Legitimate Dossiersโœ… Execute normally
User ProtectionโŒ None - relies on manual review
Time to Verifyโฐ 5-10 minutes (if you remember)

After MCP Server

AspectWith MCP Server
Checksum Verificationโœ… Automatic (2 seconds)
Signature Verificationโœ… Automatic (2 seconds)
Malicious Dossiers๐Ÿ”’ Blocked automatically
Legitimate Dossiersโœ… Execute normally
User Protectionโœ… Comprehensive
Time to Verifyโšก Instant

Key Takeaways

1. Visual Inspection Isnโ€™t Enough

The malicious dossier looked completely legitimate:

  • Professional documentation
  • Reasonable use case
  • Proper structure
  • Helpful examples

You canโ€™t spot malicious code by reading - you need cryptographic verification.

2. LLMs Need Tooling

Without MCP server, LLMs:

  • Have no way to verify checksums
  • Have no way to verify signatures
  • Execute dossiers as written
  • Canโ€™t protect you from malicious code

LLMs are powerful but need proper infrastructure.

3. Defense in Depth Works

Multiple security layers protect you:

  1. Checksums - Detect tampering
  2. Signatures - Verify trusted sources
  3. Risk levels - Guide scrutiny
  4. MCP server - Automate everything

Skip one layer and youโ€™re vulnerable.

4. MCP Server is Essential

Not optional, not nice-to-have - essential infrastructure:

  • โšก Instant verification (2 seconds vs 5-10 minutes)
  • ๐Ÿ”’ Always runs (canโ€™t forget or skip)
  • ๐ŸŽฏ Catches everything (no human error)
  • ๐Ÿค– No expertise needed (fully automated)

5. One-Time Setup, Lifetime Protection

Setting up MCP server:

  • โฐ Takes 5-10 minutes once
  • ๐Ÿ”ง Simple configuration
  • โœ… Works for all future dossiers
  • ๐Ÿ›ก๏ธ Protects your entire environment

The security demonstration proves this investment is worthwhile.


What You Just Experienced

The Journey

  1. Vulnerability: Ran malicious dossier without protection
  2. Exposure: Saw how secrets could be compromised
  3. Understanding: Learned why security verification matters
  4. Protection: Set up MCP server
  5. Validation: Saw automatic blocking of malicious dossier
  6. Confidence: Verified legitimate dossiers still work

The Proof

Youโ€™ve now seen firsthand:

  • โœ… Malicious dossiers DO look legitimate
  • โœ… Without tooling, they WILL execute
  • โœ… MCP server DOES block them automatically
  • โœ… The security model WORKS when deployed

This wasnโ€™t theoretical - you experienced it.


Next Steps

For Personal Use

  1. โœ… Keep MCP server configured - Donโ€™t remove it
  2. โœ… Trust the verification - If it says block, donโ€™t override
  3. โœ… Stay updated - Keep @ai-dossier/mcp-server current
  4. โœ… Report issues - security@imboard.ai for vulnerabilities

For Teams

  1. โœ… Require MCP server - Make it mandatory for all developers
  2. โœ… Share this demonstration - Educate your team
  3. โœ… Maintain trusted keys - Document which authors you trust
  4. โœ… Security training - Use this as training material
  5. โœ… Incident response - Have a plan for compromised dossiers

For Dossier Authors

  1. โœ… Sign your dossiers - Use your own minisign key
  2. โœ… Publish your key - In KEYS.txt and trusted channels
  3. โœ… Honest risk levels - Never falsify
  4. โœ… Update checksums - After every content change
  5. โœ… Test without MCP - Ensure fallback works

Troubleshooting

MCP Server Not Loading

Symptoms: verify_dossier tool not available after restart

Solutions:

  1. Check JSON syntax: cat ~/.claude/settings.local.json | python3 -m json.tool
  2. Ensure file path correct: ls -la ~/.claude/settings.local.json
  3. Completely quit Claude Code (not just close window)
  4. Wait 5-10 seconds after reopening
  5. Check Claude Code logs for MCP server errors

Verification Still Not Happening

Symptoms: Dossiers execute without verification

Possible causes:

  1. MCP server not properly configured
  2. Using wrong settings file location
  3. Claude Code not restarted
  4. Different LLM tool (not Claude Code)

Solution: Follow Step 5 again carefully

Want to Test Again

Reset your environment:

# Remove MCP configuration temporarily
mv ~/.claude/settings.local.json ~/.claude/settings.local.json.backup

# Restart Claude Code

# Run malicious dossier (will execute without protection)

# Restore MCP configuration
mv ~/.claude/settings.local.json.backup ~/.claude/settings.local.json

# Restart Claude Code

# Run malicious dossier again (will be blocked)

Additional Resources

Documentation

Setup Guides

Security Documentation


Share Your Experience

Help others understand the importance of dossier security:

  1. Document your journey - Write about your experience
  2. Educate your team - Share this demonstration
  3. Contribute improvements - Suggest better security measures
  4. Report vulnerabilities - security@imboard.ai

Summary

Youโ€™ve completed the security demonstration!

What you proved:

  • โœ… Malicious dossiers can fool visual inspection
  • โœ… LLMs need proper tooling to protect users
  • โœ… MCP server provides essential automatic verification
  • โœ… The security model works when properly deployed

Key lesson: Security isnโ€™t optional - itโ€™s infrastructure.

Time invested: 15-20 minutes Protection gained: Lifetime


Thank you for taking security seriously. Your diligence protects not just you, but the entire dossier ecosystem.

๐Ÿ”’ Stay secure!


Rendered from docs/explanation/security-model.md in the repository. Edit it there.