Skip to main content
Running Threagile analysis on an architecture surfaces a list of security risks — each tagged with a CWE, a STRIDE category, a severity, and the affected asset. “Resolving” that list doesn’t just mean making the count go down; it means every risk ends up with a documented disposition — fixed in code/architecture, formally accepted, or marked out of scope — and, for anything you didn’t fix, a record of who decided and why. This guide walks through that loop with an AI agent connected to the Keldyn MCP server.
Every MCP tool call runs as you, scoped to the team you selected at sign-in. Recording a disposition or editing the architecture writes to your live Keldyn workspace — review the agent’s proposed dispositions (especially justifications) before it saves them.

What you’ll use

update-risk-tracking writes to the same audit-trail table that Pulse alerts, Review Packs, Portfolio dashboards, and the web app all read to know a risk is tracked. It’s also kept in sync with the risk_tracking block inside the architecture model itself, so tracking a risk either way (via this tool, or by editing risk_tracking directly through update-use-case-architecture) shows up consistently everywhere.

Before you start

1

Connect the MCP server

Follow Keldyn MCP server to connect Claude Code, Cursor, or another MCP client, and sign in to the team that owns the use case.
2

Have an architecture saved

Risk resolution needs a Threagile model to analyze. If the use case doesn’t have one yet, run through Generate an architecture from your codebase first.
3

Open your repository

Run the agent from the repository behind the use case so it can search for real implementation evidence (auth middleware, encryption config, rate limiting, etc.) before dispositioning anything.

The three outcomes for a risk

Every Threagile risk should land in exactly one of these buckets before you’re done:
accepted and false-positive dispositions must include a justification that says who decided and why — that’s what makes the disposition defensible in a review or audit later. Don’t accept or dismiss a risk just to make the count drop.

1. Pull the open risks

Run analyze-use-case-architecture scoped to security so RCM compliance findings don’t crowd out the Threagile risks:
If a use case has a lot of both RCM findings and Threagile risks, high-severity RCM findings can otherwise fill an entire unfiltered batch before any Threagile risk shows up. source=security avoids that — use it whenever you’re specifically working the CWE list.
The result’s summary.truncated and summary.remainingIssues tell you if more risks remain; call the tool again with offset set to the previous offset plus the number of risks returned to get the next page.

2. Investigate before you disposition

For each risk, have the agent check the codebase for concrete evidence before deciding fixed / accepted / out of scope — don’t let it guess.
For a large batch, ask the agent to explore in parallel — e.g. one pass over auth/authorization code, one over network/encryption config, one over data validation — and report file paths plus short excerpts per risk. This is much faster than investigating risks one at a time.

3. Disposition each risk

Fix it (→ mitigated)

If the risk is genuinely open, use the risk’s proposedEdit to make a real change — either in application code, or as an architecture-model edit (e.g. adding an authentication method, an encrypted communication link, or a trust boundary) — then save the model if it changed and re-run the analysis to confirm the risk cleared.
If the fix is purely in application code (not the architecture model itself — e.g. you added parameterized queries, so a SQL-injection risk is already mitigated in practice even though the model doesn’t change), record it directly:

Accept it (→ accepted)

Mark it out of scope (→ false-positive)

update-risk-tracking accepts:
Keep justifications specific and file-referenced where possible — “accepted because the datastore is only reachable from the API service account and authorization is enforced in the application layer (see src/services/...)” is defensible months later; “not a big deal” is not.

4. Verify nothing is left unmarked

Re-run analyze-use-case-architecture with source=security until it reports zero remaining risks, or until every risk returned already carries a non-unchecked status (Threagile reflects tracked risks in the status field of each returned risk, e.g. Accepted / Mitigated).
A risk that’s fully fixed in the architecture model (e.g. you added the missing authentication) simply stops appearing in the analysis — Threagile no longer finds it. A risk that’s accepted or false-positive still appears (the underlying condition is still true), but its status reflects the disposition, and the web app’s CWE views hide it from the “open issues” list once it’s tracked.

Putting it together

A single prompt can drive the whole loop end to end; the agent will pause for your approval before writing anything back to Keldyn:
Acceptance criteria worth holding the agent to: every CWE ends up marked fixed, accepted, or out of scope; every accepted/out-of-scope disposition names who decided and why; and a fresh analysis run leaves nothing unmarked.

Next steps

Generate an architecture from your codebase

Infer and save the Threagile model this workflow analyzes.

From controls to code

Run the equivalent close-the-gap loop for RCM compliance controls.

Keldyn MCP server

Connect your AI tool and see the full catalog of tools and built-in prompts.

Working with a use case

See tracked risks and mitigation coverage in the Architecture Workspace.