coras_create_diagram
Create CORAS risk and threat diagrams from text or structured specs, auto-layout elements in canonical order, and generate .dgx files ready for the Threat Modelling Tool.
Instructions
Build a CORAS diagram file (.dgx) from a description and lay it out automatically, then show you how the editor draws it. Give either a structured 'spec' or 'text' in the CORAS notation. Elements are placed in the canonical left-to-right order (stakeholder, threat, vulnerability, threat scenario, unwanted incident, risk, asset), sized to fit their labels, and relationship types are inferred from the elements they join. The resulting file opens in the Threat Modelling Tool as if it had been drawn by hand.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Where to write the .dgx file. | |
| spec | No | The model: one or more diagrams that may share elements. | |
| text | No | The diagram in the CORAS text notation (see coras_reference). Use this or 'spec'. | |
| scale | No | Preview scale, default 1.5. | |
| layout | No | 'auto' (default) positions everything; 'manual' uses only the x/y you supply. | |
| dry_run | No | Validate and lay out without writing anything. | |
| preview | No | Render the result and return it as an image (default true). This also proves the editor can open the file. | |
| direction | No | Flow direction; 'right' is the CORAS norm. | |
| overwrite | No | Replace an existing file (default true). |