./blog/threat-modelling-maestro-rag-agent

vivek@secops: ~/threat-model
┌─(vivek@secops)-[~/threat-model]
└─$ ./model.sh --target rag-agent --methods manual,maestro

[manual]  trust boundaries .. 3 identified, threat actors .. 3 identified
[manual]  owasp-llm-top10 mapping .. 6 categories applicable
[maestro] automated scan .. 35 threats found, risk 48/100 (medium)
[maestro] validated attack paths .. 35/35, 4 critical
done — manual model called the shape, MAESTRO called the count

Threat-modelling my RAG agent with MAESTRO

A manual trust-boundary model, the OWASP four-layer LLM model, and an automated MAESTRO scan — run against the same target, compared side by side.

Before I attack anything I build a model of it first — scope, trust boundaries, threat actors, the works. For this engagement I ran the same local n8n + Qdrant + Ollama RAG agent through two very different processes: a manual pass using Microsoft-style data-flow diagramming and the OWASP four-layer model for LLM applications, then an automated pass using MAESTRO — Cloud Security Alliance's Multi-Agent Environment, Security, Threat, Risk, and Outcome framework for agentic systems. Same target, same synthetic canary secret standing in for a real crown jewel, two different lenses. This is what each one found, and why I don't trust either one alone.

01 Nov 2026 · ~8 min read · "ACME Dynamics" is a fictional company used for the test data

tl;dr --summary
The manual model told me where to look — three trust boundaries, a content-poisoner actor nobody had written down before, and which OWASP LLM categories actually applied. The MAESTRO automated scan told me how many and how bad — 35 threats, 4 of them critical, every attack path validated against the real asset graph instead of guessed. Run only the automated scan and you get a number with no judgment behind it. Run only the manual model and you get judgment that doesn't scale past a handful of components. The two together are what actually held up once I started attacking the thing for real.
2
Modelling methods used
3
Trust boundaries
35
MAESTRO threats found
4
Critical, validated

the-engagement --scope-and-target

The target was ACME Assistant, an n8n AI Agent workflow answering questions over a handbook indexed in Qdrant, served by a local Ollama llama3.1:8b model — the same shape of stack I've red-teamed before, rebuilt here as a proper sandboxed engagement rather than a weekend experiment. The asset under test was a synthetic canary secret sitting in a "restricted" section of the knowledge base, protected only by system-prompt instructions — deliberately the weakest possible defense, so the model would have something real to find.

Scope first, model second, attacks last — in that order. A threat model built after the attack playbook is just a justification for whatever you already tried.

the-target --architecture

Two independent data paths feed the same vector store — that seam is where most of what follows actually lives.

docs/*.md ingestion attack surface Ollama nomic-embed-text Qdrant acme_handbook incl. "restricted" section (canary) Internal Staff chat_interface n8n AI Agent orchestrator + retrieve-as-tool retrieve Ollama llama3.1:8b (chat) Response to user no output-layer filter Entry needs no chat access at all — only the ingestion path, which anyone with write access can reach
Fig. 1 — Two independent entry points (chat and document ingestion) both write into the same Qdrant store, which the agent treats as a single trusted context once retrieval happens.

manual-model --trust-boundaries-and-actors

The part automated scanners don't do for you: naming who's on the other side of each boundary, and why.

Trust boundaries

Threat actors

why-this-matters
The content-poisoner actor is the whole reason indirect prompt injection ends up the highest-severity finding later. You don't find that actor by fuzzing the chat box — you find it by asking "who else can reach this system, and through what" before you touch the keyboard.

OWASP Top 10 for LLM Applications — category mapping

CategoryApplies?Status
LLM01Prompt Injection (direct)Yes
LLM01Prompt Injection (indirect)Yes — confirmed exploitable
LLM02Sensitive Information DisclosureYes — confirmed
LLM05Improper Output HandlingPartial — no output-layer filter
LLM06Excessive AgencyWorth monitoring
LLM08Vector and Embedding WeaknessesYes — confirmed

manual-model --owasp-four-layer-view

A second manual lens, orthogonal to trust boundaries: which architectural layer does each risk actually live in?

1 · Model Is the model itself safe and robust? llama3.1:8b 2 · Implementation RAG, guardrails, filters, access control Qdrant + prompt rules no deterministic filter 3 · System APIs, infra, supply chain, sandbox n8n workflow engine 4 · Runtime Users, agents, tools, social engineering chat users, poisoner
Fig. 2 — The OWASP GenAI Security Project's four-layer model for LLM applications, applied to ACME Assistant's own components.

This view earns its keep when a finding doesn't fit neatly in a single OWASP LLM category: the missing output-layer filter is an Implementation-layer gap regardless of which category eventually catches it, and naming the layer makes it obvious which team owns the fix.

automated-model --maestro

MAESTRO — Multi-Agent Environment, Security, Threat, Risk, and Outcome — is Cloud Security Alliance's threat-modelling framework purpose-built for agentic AI systems, rather than a generic app-security checklist retrofitted onto one. I ran the same engagement's asset graph through an automated MAESTRO scan to see what a structured, repeatable process would surface that a one-off manual pass might miss.

48
Medium risk — composite score 48 / 100
35 potential threats found for ACME Dynamics · 35/35 attack paths validated against the real asset graph
4
Critical
14
High
14
Medium
3
Low

The number that mattered most wasn't the risk score — it was 35/35 validated. Every path the scanner reported was reconstructed hop-by-hop from the actual modelled data flows between real assets, not a generic "this category of system is usually vulnerable to X" guess. That's the property that made the output worth triaging instead of skimming.

Top validated attack paths

Execution of Insecure Workflow Actions
1 verified hop · Internal Staff → n8n Workflow Engine
Critical
Internal Staff
human · internal
ENTRY
→ chat_interface (untrusted) →
n8n Workflow Engine
orchestrator · internal
TARGET
Prompt Hijacking for System Instruction Bypass
3 verified hops · Internal Staff → Local LLM Inference
Critical
Internal Staff
human · internal
ENTRY
→
n8n Workflow Engine
orchestrator · internal
→
Chat Agent
agent · internal
→ rpc →
Local LLM Inference
model · internal
TARGET

Both paths start from the same entry point and both land on "critical" — but they're different findings with different fixes. One is about what the workflow engine lets an authenticated step do; the other is about how far a single hijacked instruction travels through the agent → model call chain before anything checks it. A risk score alone collapses that distinction; the hop-by-hop path doesn't.

MITRE ATLAS — the same idea, for ML-specific tactics

Alongside MAESTRO, I cross-checked the finding set against MITRE ATLAS (Adversarial Threat Landscape for Artificial-Intelligence Systems) — a knowledge base of adversary tactics and techniques against AI/ML systems, built as a deliberate structural mirror of MITRE ATT&CK: the same tactic columns (reconnaissance, initial access, persistence, exfiltration, impact…), populated with AI-specific techniques like prompt injection, model inversion, and data poisoning instead of traditional-infrastructure ones. Content poisoning against the Qdrant store maps cleanly onto ATLAS's data-poisoning tactic, which is exactly the finding MAESTRO's automated scan and the manual trust-boundary model both independently pointed at — three different methods converging on one root cause is a stronger signal than any one of them alone.

manual-vs-maestro --what-each-approach-is-actually-good-for

Manual modelling

Trust boundaries + OWASP layers

  • Surfaces actors a scanner won't guess — the content-poisoner never touches the chat interface, so nothing that only models "user → bot" traffic finds it.
  • Carries judgment about severity — knowing why a boundary matters, not just that one exists.
  • Doesn't scale — fine for a six-node architecture, painful for a real multi-agent production system with dozens of tools and services.
MAESTRO automated

Asset-graph driven scan

  • Exhaustive and repeatable — 35 paths checked the same way every run, not whatever the analyst happened to think of that day.
  • Validates, doesn't guess — every reported path is a real verified hop between modelled assets.
  • Only as good as the asset graph you feed it — it can't invent a trust boundary or actor you never modelled in the first place.

Neither replaces the other. The manual pass decides what belongs in the asset graph and why a given boundary is dangerous; the automated pass then checks that graph exhaustively instead of relying on one analyst's afternoon. Skip the manual step and MAESTRO scores a graph that's missing the content-poisoner actor entirely. Skip MAESTRO and you're back to hoping you thought of everything.

where-the-model-pointed --what-testing-later-confirmed

The point of a threat model is that it should predict where the real findings land. This one did.

Indirect prompt injection via poisoned document

High severity, LLM01 + LLM08 — exactly the content-poisoner / ingestion-boundary path both the manual model and MAESTRO flagged before a single attack was run.

Sensitive-information disclosure via refusal metadata

Medium severity, LLM02 — the agent named a restricted item's existence and format while still withholding its value, living squarely in the Implementation-layer gap Fig. 2 called out.

Security posture relying on incidental factors

High severity, systemic — retrieval topK and sampling temperature, not architecture, were doing the defensive work. A finding no automated scan surfaces, because it's about configuration drift, not a known attack pattern.

That last one is the real argument for doing both: it only showed up from manually re-running the same query and noticing the answer changed shape between runs. No threat-modelling framework, manual or automated, predicts "your defense is an accident of a config default" — that one needed hands on the keyboard after the model was built, not instead of it.

next-round --automating-the-playbook

The manual tiers and the MAESTRO scan told me where to aim. The next pass runs that playbook automatically, on a schedule, instead of by hand in a terminal. Four tools I'm shortlisting for it:

CLI + library

Promptfoo

Open-source eval and red-team harness for LLM apps. Define test cases as config and it fires a library of adversarial prompts — jailbreaks, injections, PII probes — at your endpoint, then grades the output automatically. Closest thing to a CI test suite for prompt safety, and it slots into a pipeline the same way a unit-test runner would.

promptfoo.dev →
Microsoft · Python

PyRIT

The Python Risk Identification Tool for generative AI, built by Microsoft's own AI Red Team. Where most harnesses fire a static prompt list, PyRIT orchestrates multi-turn adversarial conversations — including crescendo-style gradual escalation — and scores each response against the target, closer to tier 8 of the manual playbook than tier 0.

github.com/microsoft/PyRIT →
Eval framework

DeepEval

An open-source LLM evaluation framework that runs as pytest-style unit tests. Started as a quality tool — RAG faithfulness, answer relevancy, hallucination — and has grown a real red-teaming surface alongside it: safety metrics for bias, toxicity, and PII leakage sit in the same test file as the quality checks.

github.com/confident-ai/deepeval →
NVIDIA

Garak

A generative-AI vulnerability scanner with a large, actively maintained probe library — prompt injection, jailbreaks, data leakage, hallucination, encoding tricks. It shines against a model you can query directly and repeatedly, so it's most at home scanning local or self-hosted models rather than a rate-limited hosted API.

github.com/NVIDIA/garak →

None of these replace the manual tiers — Tier 8's crescendo and Tier 11's indirect injection still need a human deciding what "innocuous-looking" means for this specific agent. What they replace is re-typing the same 40-odd payloads by hand every time the system prompt changes. More on how this shortlist performs once I've actually wired one up against ACME Assistant.

sources --further-reading

Related on this site: Red-teaming my own RAG agent · Working through the OWASP LLM Top 10 · Prompt injection, from first principles