SkillsReviewed · dotslashsimran

Simcraft Security Threat Model

Security Threat Model is a coding-assistant skill for developers reviewing their own applications, but its heuristic scans require manual investigation and local verification. It combines attack-surface mapping, secret detection, STRIDE threat analysis and regression tests, with a worked Python invoice API example.

Researched 16 Nov 2026

In short.

Security Threat Model is a coding-assistant skill for developers finding and fixing risks in their own apps, but it cannot establish that an application is secure. Its strongest feature is the connection between threats, local failing tests, fixes and retained regression tests. Three Python helpers support investigation, while a worked invoice API illustrates ownership checks, SQL handling, file containment and webhook verification. The example retains documented security gaps, and its claimed test outcomes remain unverified by independent execution.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage comprises skills/coding/security-threat-model at revision 58224d131814572224537fb516b8c5d33dd5fa67: SKILL.md, reference.md, three Python helpers and five invoice-example files, plus the repository root LICENSE. Other simcraft resources and repository-wide installation material are outside this scope. The files support source-level analysis only. Installation, command execution, test outcomes, scanner accuracy, assistant compatibility and behavior against real applications remain unverified.

The overview

Identity

The resource is the security-threat-model skill folder in dotslashsimran/simcraft. SKILL.md supplies coding-assistant instructions, reference.md expands the security guidance, and accompanying scripts and examples support the work. Its main output is THREAT_MODEL.md, containing scope, data flows, ranked threats, proofs, fixes and residual risks.

The original source location is [https://github.com/dotslashsimran/simcraft/tree/main/skills/coding/security-threat-model]. The represented source revision is 58224d131814572224537fb516b8c5d33dd5fa67.

Assessment

This is a useful starting point for turning an informal security review into specific code changes and repeatable tests. It asks for normal-use controls alongside negative tests, which helps distinguish a successful fix from a broken feature. Recording open risks also makes the resulting document useful after the initial review.

The skill depends on the assistant and developer correctly understanding the application. Its scanners produce investigation leads, and the worked example demonstrates a bounded set of fixes. Neither establishes exhaustive vulnerability coverage or production readiness.

Users

The intended users are developers reviewing applications they own, especially web APIs and applications that handle customer data, payments or LLM tools. Beginners get a concrete example of how a security concern becomes a test and fix. Experienced developers get guidance on tenant isolation, webhook trust, dependency reachability and model-controlled tool access.

Effective use requires access to the source, knowledge of deployment assumptions and a local development or test environment. The instructions exclude proofs against production, shared staging and third-party services.

Capabilities

surface.py searches Python and JavaScript/TypeScript source for routes and patterns involving authorization, injection, file access, outbound requests, web configuration and LLM tools. It can emit JSON or filter rule categories. Its authentication and ownership flags indicate nearby textual patterns rather than verified access controls.

secrets_scan.py checks credential formats, suspicious assignments and high-entropy strings. It supports Git history and built-bundle scanning, masks credential matches and returns exit code 1 when findings exist. dataflow.py converts a YAML or JSON system description into Mermaid, highlights boundary crossings and optionally produces a STRIDE table for completion.

The reference also covers uploads, dependency audits, abuse limits, indirect prompt injection, tool-based data leakage and tenant filtering for retrieved documents. These are review instructions, not automatic detection guarantees.

Using it

Requirements

The helper scripts and invoice example use Python standard-library modules. dataflow.py optionally uses PyYAML when installed and otherwise accepts a limited YAML subset; JSON input is also supported. History scanning requires Git. Dependency checks require the relevant project tooling, such as npm audit or pip-audit.

A minimum Python version and supported coding-assistant versions are not declared. The fixed example uses Path.is_relative_to, so interpreter compatibility needs checking. No particular model, cloud account, GPU or hosted service is specified for the helpers.

Mechanism

The prescribed sequence starts with application scope and deployment assumptions, then combines heuristic scans with manual reading of authentication, data access, identifier-taking routes and outbound operations. The developer describes actors, processes, stores and trust boundaries in dataflow.yaml; the diagram generator renders that description rather than discovering the architecture itself.

STRIDE organizes threats into spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege. Each threat receives likelihood and impact scores from 1 to 3. Scores of 6 or more, plus inexpensive lower-scoring fixes, lead to tests asserting secure behavior, a minimal fix and a rerun with normal-use controls.

For LLM applications, the reference treats retrieved text and tool results as untrusted inputs. It recommends enforcing tool permissions, tenant scope and destination restrictions in code, with regression tests for those controls.

Setup

Obtain the complete skill folder at the identified revision and retain its relative layout. The instructions assume helper paths beneath ~/simcraft/skills/coding/security-threat-model; a different checkout location requires corresponding path changes. Host-specific skill installation steps are not established by the folder.

Prepare a local copy of the application with disposable data and its normal test framework. The invoice tests configure local placeholder payment credentials themselves. Running the fixed example separately requires PAYMENTS_WEBHOOK_SECRET for accepted webhook requests; charge_headers reads PAYMENTS_API_KEY when called. Installation success and runtime compatibility are unverified.

Example

Tinybill is a six-route invoice API with vulnerable and fixed Python implementations, a data-flow description, a threat model and 18 test methods. One test logs in as Alice and requests Bob's invoice. The fixed source includes the owner in the database query and returns 404 when the invoice does not belong to the caller.

Other examples address SQL injection, file traversal, forged webhooks, a deliberately fake hardcoded payment key and error leakage. The fixed webhook checks an HMAC-SHA256 signature over the timestamp and raw body before parsing JSON, uses constant-time comparison and applies a 300-second timestamp tolerance.

The example document claims 13 failures against the vulnerable version and all 18 tests passing against the fixed version. Those are source claims, not independently verified execution results. The test source binds servers to localhost and creates throwaway data folders.

Assessment & evidence

Limitations

The surface scanner uses regular expressions and nearby text, including a 30-line window for JavaScript handlers. It does not establish full data flow or authorization correctness. It excludes various directories and files at least one million bytes in size. The secrets scanner also skips specified file types, directories and files larger than two million bytes; its history mode examines added diff lines. Clean output cannot establish absence of vulnerabilities or secrets.

The fixed invoice example still documents unlimited login attempts, sessions without expiration or logout, and no status-change audit trail. Its webhook timestamp check leaves replay possible within the accepted window because duplicate event IDs are not tracked. The example is therefore unsuitable as a complete security baseline without further work.

Several negative tests check only that sensitive data is absent or that a response is not 200. They do not always require a particular rejection status. The LLM guidance is substantive, but the supplied worked application has no LLM feature or corresponding executable example.

Reasoning

The skill's practical value comes from connecting a concrete access path to observable secure behavior. The invoice ownership fix illustrates this well: restricting the query prevents another user's record from being loaded, while a normal-owner control checks that legitimate access remains possible.

Risk scores require judgment. The worked example assigns forged payment updates impact 2, while SKILL.md broadly assigns money-related harm impact 3. Developers should resolve such differences against their own application's consequences. The numerical score helps order work but does not establish a measured probability of harm.

Alternatives

For a dependency-only question, the reference points to npm audit, pnpm audit, yarn npm audit and pip-audit. These address dependency advisories; the skill adds application-specific reasoning about ownership, trust boundaries and reachable behavior.

A developer can also use the helper scripts and threat-model template directly without loading the assistant instructions. The evidence provides no comparative accuracy, effort or cost measurements against other security-review approaches.

Evidence

The source snapshot contains the skill instructions, reference, all three helpers, both invoice implementations, test definitions, the example data-flow file and its threat model. These support direct inspection of the intended mechanism and example fixes.

The example threat model includes selected before-fix failure excerpts and claimed test totals. Those excerpts do not establish installation success, scanner accuracy, complete security coverage or reproducible runtime outcomes. No independently verified execution results are available.

Access & freshness

Costs

The MIT licence grants software permissions free of charge. That does not establish the total cost of using a coding assistant with the skill. Assistant subscriptions or API charges, review time and project-specific infrastructure costs are unspecified.

No token usage, runtime measurements or resource-sizing figures are supplied. Total operating cost is unknown.

Rights

The repository root carries the MIT License, copyright 2026 Simran Sachdeva. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices remain in copies or substantial portions.

The licence disclaims warranties and liability. The captured files contain no separate licence notice overriding the root notice for this folder. The original notice is available at [https://raw.githubusercontent.com/dotslashsimran/simcraft/58224d131814572224537fb516b8c5d33dd5fa67/LICENSE].

Freshness

The source snapshot was captured on 16 November 2026 at revision 58224d131814572224537fb516b8c5d33dd5fa67. The worked threat model states a last-review date of 7 November 2026. A release number is not established by the captured files.

Changes after that revision are unknown. The skill identifies recheck triggers including new identifier-taking routes, webhook additions, authentication changes, storage moves and new LLM tools.

Actions

Begin by inspecting the invoice example and verifying its documented behavior in an isolated local environment. Check the negative assertions and normal-use controls together, and retain the example's open risks when adapting its code.

For an owned application, define scope and deployment assumptions before drawing the data flow. Investigate scanner leads manually, prioritize cross-user access and trusted inputs, and keep unproven concerns distinct from demonstrated failures. Confirm each fix with a retained regression test and controls for legitimate use.

For an LLM application, explicitly map retrieved content and tool results, then test permissions and destination restrictions in tool code. The supplied invoice example does not establish those protections.

Evidence for this report

LICENSEnotice · checked 2026-11-16
skills/coding/security-threat-model/SKILL.mdselected · checked 2026-11-16