Tools / System Instructions / Threat modeling

AI system diagram threat modeling

Prompts that read an AI system diagram (image, Mermaid, or SVG) and write a threat matrix plus a downloadable markdown report and completed JSON. Track A walks Shostack's Four Questions; each step is filled with the previous step's JSON (the Auspex chain shape). Track B writes layer, persona, and party onto each threat. After either track, run the export pair and save the markdown reply and the JSON reply as files. Templates: prompts.json. How this pack scores against three published threat models.

How to run the chain

  1. Paste the shared rules once, or use each step as a standalone copy block (rules are inlined).
  2. Attach or paste the diagram. Set {{representation_kind}} to image, mermaid, or svg.
  3. Pick a role: experienced-threat-modeler, application-security, llm-caller. Default is experienced-threat-modeler.
  4. Copy one block at a time. The copied text starts with a [chain] line that names this step and the next. The strip below this list remembers the last Copy click.
  5. Run Track A in order from P-norm through P-report. After P-sol, run P-adv and P-controls before STRIDE. After P-qa, run P-report.
  6. Optionally run Track B (P-srf-join, P-srf-layer, P-srf-owner) with an operating model.
  7. After the track you used, run P-export-md then P-export-json. Save the first reply as a .md file and the second as a .json file.
  8. Do not rephrase Shostack's four questions. Do not put mitigations in P-phantom.

On this page

Last copied: none. Next: P-norm (Normalize representation).

Shostack's Four Questions

  1. What are we working on?
  2. What can go wrong?
  3. What are we going to do about it?
  4. Did we do a good job?

Wording is from the Four Question Framework (CC-BY). Use those four sentences as written. State the team view and what we are working on right now.

PHANTOM-B questions (LLM subset)

Ask these eight questions for each chatbot or model-runtime node. STRIDE still applies to every component. Write mitigations in P-act.

Roles

Sources

Lane

Track A elicits threats from the diagram and classifies them. Track B writes one SRF persona and one party onto each threat. If matrix.json says shared, still name one lead. Cite an OWASP, ATLAS, or AI Exchange id only when it exists in that source. After either track, the export pair writes the files a reviewer can keep: a markdown report and the completed JSON.

Q1. What are we working on?

Read the diagram into a solution description. Then state attackers and existing controls. Each step is filled with the prior JSON.

Q2. What can go wrong?

STRIDE on in-scope elements and crossing flows. PHANTOM-B on the LLM subset. Then merge.

Q3. What are we going to do about it?

Map CIA, STRIDE, and PHANTOM-B letters. Then choose mitigate, eliminate, transfer, or accept in P-act, with a validation on mitigate and eliminate.

Q4. Did we do a good job?

Mechanical self-check, then write the readable report. Leave the reviewer line empty.

What Track A has filled

The assistant JSON after P-report is the Track A matrix. Optional Track B is next. Then run the export pair and save those two replies as files. Schema: eval/threat-model/schema.json. Eval path: <system-id>/image.json (or mermaid.json / svg.json).

Track B is optional and reads the same JSON. After the track you used, run the export pair and save the two replies.

Track B (optional): SRF accountability

Off by default. Consumes the Track A JSON plus an operating model. Join published AI Exchange slugs from threats.json instead of re-deriving them.

What Track B has filled

The assistant JSON after P-srf-owner is the Track A matrix with srf on every threat. Same schema; chain_meta.track_b_applied is true. Re-run the export pair on this JSON so the markdown report includes layer, persona, and party.

Track B does not add threats. A threat with no matching slug still needs layer, persona, and party from P-srf-layer and P-srf-owner. Next, run Export the report and JSON on this JSON.

Export the report and JSON

These two prompts run after Track A, and again after Track B if you used it. P-export-md writes the readable report; save that reply as a .md file. P-export-json writes the completed record; save that reply as a .json file. Leave the reviewer line empty.

Evaluation baselines

P-zeroshot and P-identity are the two short baselines scored in eval/threat-model/. Machine scores stay open until the SME sheets in that directory are filled.

Output schema

Full JSON Schema: eval/threat-model/schema.json. Gold diagrams (five systems, three formats) and the scoring scripts are in eval/threat-model/ of the site repository.