agentleFS
po4ykapo4yka/llm-wiki-skills/skills/llm-wiki-threat-model/SKILL.md

llm-wiki-threat-model

Skill3 starsChanged 5 months agoMITView on GitHub

Build a formal security architecture threat model for an LLM-Wiki system. Use when the user asks for STRIDE, LINDDUN, PASTA, data-flow diagrams, trust boundaries, attack-surface mapping, abuse cases, risk matrices, red-team scenarios, or control baselines; route existing-config safety reviews to llm-wiki-security-review.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use references/docs/19-security-threat-model.md as the reference architecture and control baseline.

    line 18
  2. Distinctive:

    Use STRIDE for system threats:

    line 76
  3. Distinctive:

    Use LINDDUN-style checks for privacy:

    line 87
  4. Distinctive:

    read-only MCP/API by default.

    line 119
  5. Distinctive:

    Do not print secrets, PII or sensitive source contents verbatim.

    line 195
  6. Distinctive:

    Do not recommend unauthenticated remote MCP/API.

    line 196
  7. Distinctive:

    Do not rely on prompt wording as the only mitigation for prompt injection.

    line 197
  8. Distinctive:

    Do not let convenience override review-gated durable writes.

    line 198
  9. Distinctive:

    Do not recommend cloud parsing, cloud embeddings, tracing or eval on sensitive data without explicit policy approval.

    line 199
  10. Very specific:

    Do not mark a system production-ready if production retrieval includes draft/rejected/quarantined content.

    line 200

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

LLM-Wiki Threat Model

Goal

Produce a threat model for an LLM-Wiki system that maps trust boundaries, attack surfaces, prioritized threats, controls, CI gates, red-team scenarios and incident response.

Use references/docs/19-security-threat-model.md as the reference architecture and control baseline.

When to use

  • The user asks for a STRIDE, LINDDUN, PASTA, or data-flow-diagram threat model of an LLM-Wiki system.
  • The user wants trust boundaries, attack-surface mapping, abuse cases, or a risk/severity matrix for ingestion, retrieval, MCP/API, or write paths.
  • The user is designing or hardening a new LLM-Wiki deployment (local-first, hosted, MCP/API server) and needs a control baseline and red-team scenarios before build-out.
  • The user asks for an incident-response plan or security scorecard tied to a threat model, not an ad-hoc config review.
  • Route requests to review an existing config or deployment for known weaknesses to llm-wiki-security-review instead; use this skill for building the formal model from scratch.

Inputs

  • Implementation family: local-first, desktop app, repo-docs, Obsidian, team wiki, hosted product, MCP/API server.
  • Data flows: capture, ingestion, raw storage, wiki compilation, indexing, retrieval, generation, MCP/API, writes, exports, observability.
  • Data classes: public, internal, sensitive, regulated, unknown.
  • Deployment: local stdio, localhost HTTP, remote MCP/API, CI, cloud models, cloud parsers, hosted search/vector DB.
  • Existing controls: CODEOWNERS, branch protection, scanners, auth, review queue, audit logs, redaction, eval/red-team.
  • Desired output: high-level model, detailed matrix, remediation plan, repo file changes or CI templates.

Procedure

1. Inventory components and data flows

Map:

sources -> ingestion/parsing -> raw store -> wiki pages -> indexes -> retrieval -> agent -> MCP/API tools -> proposals/PRs -> exports/traces

For each component, record:

component: ""
inputs: []
outputs: []
trusted: true|false
contains_sensitive_data: true|false
writes_durable_state: true|false
network_exposed: true|false
existing_controls: []
missing_controls: []

2. Mark trust boundaries

At minimum mark:

  • external source -> parser;
  • parser output -> raw store;
  • raw store -> index;
  • index -> model context;
  • model output -> proposal/write/export;
  • MCP/API -> tools and downstream systems;
  • wiki/export -> public or cross-team consumers;
  • CI runner -> repository writes or secrets.

3. Classify threats

Use STRIDE for system threats:

CategoryLLM-Wiki focus
Spoofingfake source identity, fake MCP server, forged reviewer.
Tamperingpoisoned source, forged citation, modified index/wiki page.
Repudiationmissing audit trail for generated proposal or approval.
Information disclosuresecrets/PII in retrieval, traces, exports.
Denial of servicehuge documents, graph explosion, expensive red-team jobs.
Elevation of privilegeprompt injection triggers admin tool or bypasses review.

Use LINDDUN-style checks for privacy:

  • linkability;
  • identifiability;
  • detectability of sensitive source existence;
  • disclosure;
  • unawareness of capture/indexing;
  • non-compliance with retention/export policy.

4. Prioritize LLM-Wiki-specific risks

Always assess:

ThreatDefault severity
Indirect prompt injection causing data exfiltration or unsafe tool useCritical
Corpus poisoning or durable wiki corruptionHigh
Parser exploitation during ingestionCritical when untrusted files are parsed
Secret/PII leakage through wiki, index, trace or exportHigh/Critical
Unauthenticated or overbroad MCP/APIHigh/Critical
Agent direct writes to durable knowledgeHigh
Cross-tenant or sensitivity-filter failureCritical
Supply-chain compromise in parser, scanner, MCP server or GitHub ActionHigh
Public export or trace oversharingMedium/High

5. Define control baseline

Minimum viable baseline:

  • parser sandboxing;
  • secret and PII scans;
  • reviewed-only production retrieval;
  • read-only MCP/API by default;
  • proposal-only agent writes;
  • CODEOWNERS and branch protection;
  • required CI checks;
  • export allowlist and redaction report;
  • audit logs for sensitive reads, proposals and admin tools.

Recommended production baseline:

  • signed/attributable commits;
  • append-only audit logs;
  • prompt/RAG/MCP red-team suite;
  • canary secrets and synthetic PII in isolated fixtures;
  • incident response playbook;
  • regular reindex/restore from known-good snapshots;
  • explicit exception register.

6. Build a security test plan

Include tests for:

  • hidden webpage prompt injection;
  • malicious PDF/email/parser fixture;
  • poisoned draft page excluded from production retrieval;
  • public-source attempt to trigger private MCP data read;
  • direct write/delete tool rejection;
  • admin tools disabled by default;
  • cross-tenant retrieval denial;
  • export blocked by sensitive page;
  • public trace/log oversharing;
  • GitHub workflow/action pinning and minimal permissions.

7. Recommend repo artifacts

Depending on the user's repo, propose or add:

  • references/docs/19-security-threat-model.md;
  • references/templates/security-scorecard.yaml;
  • references/templates/mcp-security-profile.yaml;
  • references/templates/promptfoo-llm-wiki-redteam.yaml;
  • references/templates/llm-wiki-security.github-actions.yml;
  • references/policies/redaction-retention-policy.md;
  • references/policies/review-incident-response.md;
  • .github/CODEOWNERS updates;
  • CI workflow or pre-commit hooks.

Output

## Threat model summary

## Scope and assumptions

## Component inventory

## Data-flow diagram

## Trust boundaries

## Threat matrix

## Priority risks

## Control baseline

## CI and red-team plan

## Incident response

## Security scorecard

## Recommended repo changes

Safety gates

  • Do not print secrets, PII or sensitive source contents verbatim.
  • Do not recommend unauthenticated remote MCP/API.
  • Do not rely on prompt wording as the only mitigation for prompt injection.
  • Do not let convenience override review-gated durable writes.
  • Do not recommend cloud parsing, cloud embeddings, tracing or eval on sensitive data without explicit policy approval.
  • Do not mark a system production-ready if production retrieval includes draft/rejected/quarantined content.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.