The
generate-architecture prompt models your system from the code and config it can inspect, not from a questionnaire. Run the agent from the repository you want to model so it can read your source.What you’ll use
Before you start
1
Connect the MCP server
Follow Keldyn MCP server to connect your AI tool and sign in to the team that owns the target use case.
2
Open the repository
Start the agent from the repo (or monorepo) you want to model, so it can list and read your files.
3
Have a use case ready
Know which use case the architecture belongs to. If you don’t pass one, the agent will list your use cases and ask you to choose before saving.
1. Generate the model
Invoke thegenerate-architecture prompt. It accepts three optional arguments:
1
Map the system from code
List tracked files (e.g.
git ls-files), then read entrypoints, service boundaries, APIs, data stores, auth, queues, external integrations, and infra/config — restricted to your scope if you set one.2
Use the real schema for enums
Read the
keldyn://threagile-schema resource for allowed property names and enum values (rather than guessing), including production-required root fields like business_criticality.3
Save via the tool
Call
update-use-case-architecture with the architectureData object and your useCaseId, and report back the useCaseName and whether success was true.2. Analyze the architecture
Once a model is saved, runanalyze-use-case-architecture to threat-model it and check it against your frameworks in one pass.
- Security risks (from Threagile) — each with
severity,CWE,STRIDEcategory, and the affected asset. - Compliance failures (failed RCM architecture checks) — each with the
frameworkNameandrcmIdit violates.
proposedEdit: a natural-language remediation the agent can turn into an architecture change.
Analysis requires a saved architecture — run
generate-architecture / update-use-case-architecture first. Issues are capped at 32 per call; when more remain, the result flags truncated with a remainingIssues count so you fix a batch at a time.3. Remediate and re-verify
Architecture hardening is a loop: fix a batch of issues, save, and re-run to confirm they cleared and fetch the next batch.1
Turn proposed edits into model changes
For each issue, convert its
proposedEdit into a concrete change to the architecture object (e.g. add an encryption protocol on a link, introduce a trust boundary, tag a data asset).2
Save the updated model
Call
update-use-case-architecture with the revised architectureData.3
Re-run the analysis
Call
analyze-use-case-architecture again to verify the fixed issues are gone and pull any remaining ones.Keeping the model current
Re-rungenerate-architecture (or targeted update-use-case-architecture edits) after significant changes — new services, data stores, or integrations — so the threat model and compliance checks stay accurate. Pair this with the controls-to-code workflow: an up-to-date architecture is what drives the architecture-based control checks you close there.
Next steps
Resolve architecture risks (CWEs)
Give every Threagile risk from this analysis a documented disposition.
From controls to code
Read your controls, analyze code for evidence, and close gaps with tasks.
Keldyn MCP server
Connect your AI tool and see the full catalog of tools and prompts.
Working with a use case
Explore the Architecture Workspace and track control progress in the app.
Frameworks & controls
See how architecture checks feed control coverage and maturity.