Threat modeling with AI
AI threat modeling to a STRIDE table
Describe the system in plain text and uplink-red-team-pro at https://api.pentestllm.ai/v1 returns a STRIDE table for each element, an attack tree for each goal worth protecting, and test cases to run inside the agreed scope. The output is a draft for the review meeting, and the decisions in it stay yours.
curl https://api.pentestllm.ai/v1/chat/completions \ -H "Authorization: Bearer sk-ptl-live-…" \ -H "Content-Type: application/json" \ -d '{ "model": "auto/security", "messages": [{"role": "user", "content": "Rank these scanner findings by severity and say what to verify first."}] }'The four questions behind a threat model
When an authorized evaluation has already tested the LLM application, evaluation report review maps recorded results back to evidence before the team updates this threat model.
OWASP’s threat modeling cheat sheet frames the work around four questions from the Threat Modeling Manifesto: what are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job. A model is useful on the second and third. It reads a description faster than a workshop can, applies all six STRIDE categories to every element without getting bored, and suggests responses. The first and fourth questions need the people who built the system, which is why the output is a draft to review, not a verdict.
Write the system down in this shape
A model reasons best over the same parts a data flow diagram shows: external entities, processes, data stores, data flows and trust boundaries. If you have a diagram, transcribe it into this template; if you have nothing, filling it in is half the value. Keep live secrets and real customer data out of the description, because element names, flows and controls are enough for a good table.
SYSTEM: <name, one sentence on what it does>EXTERNAL ENTITIES: <users, partner systems, third-party services>PROCESSES: <each service or function, language/framework if known>DATA STORES: <databases, buckets, queues, caches; what each holds>DATA FLOWS: <A -> B: what moves, protocol, how it is authenticated>TRUST BOUNDARIES: <where privilege or ownership changes>EXISTING CONTROLS: <auth method, encryption, logging, WAF, rate limits>OUT OF SCOPE: <anything the engagement excludes>The prompt
Ask for a STRIDE table with one row per threat, columns for ID, element, category, threat, property violated, existing control, proposed response (mitigate, eliminate, transfer or accept) and a test case. Then ask it to pick the three goals an attacker would value most and write an attack tree for each as a nested list marking branches OR or AND, and for every test case to give the precondition, the check in plain words, the expected secure result and which in-scope element it touches, skipping anything out of scope. Tell it not to include exploit code or payloads.
What a good STRIDE row looks like
- T1 API, invoice read
- Elevation of privilege: a missing tenant filter lets tenant A read tenant B’s invoice. Mitigate by enforcing tenant id in the data layer; test with A’s token against a B-owned id and expect a denial.
- T2 Pre-signed URL
- Information disclosure: long-lived upload or read URLs leak through logs or email. Mitigate with short expiry and no URLs in logs; test the expiry and search log samples for signed URLs.
- T3 Parser worker
- Denial of service: an oversized or malformed file stalls the queue. Mitigate with size and page limits and timeouts; test by uploading a large benign file in staging and confirm the job times out cleanly.
- T4 Admin console
- Repudiation: admin actions are not logged per user. Mitigate with a per-user audit log; test by making an admin change in staging and confirming the log names who did it.
Push back on rows that name a category without naming the element and the flow. OWASP’s cheat sheet maps each category to the property it breaks: spoofing to authentication, tampering to integrity, repudiation to accounting, information disclosure to confidentiality, denial of service to availability, elevation of privilege to authorization. Ask the model to fill the property-violated column; a row it cannot fill is often a row that does not belong.
Attack trees and the test plan
The cheat sheet suggests attack trees when a team cares about a high-value goal or a multi-step attack, and a text tree is easy to diff and review. Each leaf should point at a STRIDE row or become a new one, and leaves that need social engineering or a third party usually fall outside a technical scope, so mark them rather than test them. The test-case column is what makes this worth doing before an engagement: copy each one into the test plan, tie it to the authorised targets in your rules of engagement, and keep the IDs so findings trace back. For live adversary work that grows out of the same model see AI red teaming, and for a discussion-based rehearsal see tabletop exercises.
Send it
Save the request as a JSON body (the system message plus the filled prompt) and post it with curl. If the description contains credentials or customer emails, turn on redaction at the secrets_pii level (the header is in the curl below), which swaps them for placeholders before the request leaves; an architecture document in PDF can go in as a file part on the same request. Use this only for systems you own or are authorized in writing to test.
curl https://api.pentestllm.ai/v1/chat/completions \ -H "Authorization: Bearer $PTL_KEY" \ -H "Content-Type: application/json" \ -H "x-redact: secrets_pii" \ -d @tm-request.json16 security builds, priced per token
USD per million tokens, live on 2026-11-27; auto/security bills at the build that answers.
Detected refusals and invalid non-streamed JSON qualify for automatic refunds within the daily cap. Verify your receipt.
| Wire formats | |||||
|---|---|---|---|---|---|
| Qwen3.8 27B Cybersecurity | Security | $0.40 | $2.40 | 262K | |
| Uncensored Qwen3.8 27b Cybersecurity | Security | $0.40 | $2.40 | 262K | |
| Gemma 4 26B A4B Cybersecurity | Security | $0.4224 | $1.3376 | 262K | |
| Gemma 4 26B A4B Cybersecurity (Uncensored) | Security | $0.48 | $1.52 | 262K | |
| GLM-5.3 Flash Cybersecurity | Security | $0.4935 | $1.645 | 1049K | |
| GLM-5.3 Flash Cybersecurity (Uncensored) | Security | $0.5093 | $1.6975 | 1049K | |
| Red Team (Flash) | Security | $0.90 | $3.00 | 1000K | |
| Red Team (Pro) | Security | $1.50 | $6.00 | – | |
| OrcaCyber MiniMax M3.1 Flash | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber MiniMax M3.1 Flash (Uncensored) | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber Qwen3.8 Flash Next (Uncensored) | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber Qwen3.8 Flash Next | Security | $2.00 | $4.00 | 262K | |
| Uncensored Qwen3.8 Flash Next Cybersecurity | Security | $2.00 | $4.00 | 262K | |
| Cyber Frontier | Security | $5.25 | $15.75 | 1049K | |
| OrcaCyber Zero 1.5 | Security | $7.50 | $18.75 | 999K | |
| OrcaCyber Zero 1.5 (Uncensored) | Security | $7.50 | $18.75 | 999K |
Questions
Can AI do STRIDE threat modeling on its own?
It can do the systematic part: apply six categories to every element and draft responses and tests. It cannot tell you what the system really does when the description is wrong or stale, so review the output with the team that owns the system, which is OWASP’s fourth question.
What should I leave out of the description?
Live secrets, real customer data and anything outside the engagement. Element names, flows and controls are enough for a good table. If a document must go in as is, send it with redaction turned on.
Should I ask for STRIDE or attack trees?
Both, for different jobs. STRIDE covers a technical design element by element, and attack trees follow one valuable goal across elements. Asking for both lets each tree leaf point back to a table row.
Is a threat-modeling model an offensive tool?
No. It drafts a design-review artifact for authorized assessments: categories, responses and test cases, with no exploit code. The tests it proposes run only against the in-scope elements a client has agreed to.