Skip to content
Development
Agent

dfd-and-trust-boundaries

A threat model is only as good as the diagram it sits on. The data-flow diagram (DFD) is the map; trust boundaries are where the dangerous neighborhoods are. Build the diagram first, then hunt threats along the boundaries.

From plugin
skills
954 skills54 agents

Claude Code

$ npx -y skills add vanara-agents/skills --agent claude-code

Agent definition

dfd-and-trust-boundaries.md

Data-Flow Diagrams and Trust Boundaries

A threat model is only as good as the diagram it sits on. The data-flow diagram (DFD) is the map; trust boundaries are where the dangerous neighborhoods are. Build the diagram first, then hunt threats along the boundaries.

The four element types

Every DFD is built from exactly four kinds of element. Keep them distinct β€” the element type determines which STRIDE categories apply (see `stride-method.md`).

| Element | What it is | Notation here | |---|---|---| | **External entity** | An actor outside your control: a user, a browser, a third-party API | `(E1) Browser` | | **Process** | Code that transforms data: a service, a Lambda, a function | `(P2) Auth Service` | | **Data store** | Where data rests: a DB, cache, queue, bucket, file | `(DS3) User DB` | | **Data flow** | Data in motion between two elements | `──1: HTTPS POST──►` |

Number every element and every flow. Threat IDs reference these numbers, which is what makes the model auditable: anyone can check that flow 4 has been considered.

What a trust boundary is

A trust boundary is any line where the level of trust changes β€” where data or control passes from a less-trusted zone into a more-trusted one. Threats concentrate here because this is where an attacker on the outside tries to influence the inside.

Draw a boundary at:

  • **Network edges** β€” Internet β†’ DMZ β†’ internal network.
  • **Privilege changes** β€” unauthenticated β†’ authenticated; user β†’ admin; user-space β†’ kernel.
  • **Ownership changes** β€” your service β†’ a third-party API; first-party β†’ vendor SDK.
  • **Process/host edges** β€” browser β†’ server; container β†’ host; tenant A β†’ tenant B in multi-tenancy.
  • **Data sensitivity changes** β€” public data β†’ PII/PCI/PHI store.

The classic mistake is drawing too few boundaries. A monolith still has a boundary between the unauthenticated request handler and the authenticated business logic.

Text notation

Render the DFD as text so it lives in version control next to the design and diffs cleanly. The convention used across this package:

TRUST BOUNDARY: <less trusted>  β”‚β”‚  <more trusted>

  (E1) Entity ──N: flow label──►││──► (Pn) Process ──M: flow──►││──► (DSn) Store
  Legend: (E)=external entity (P)=process (DS)=data store
          N: numbered data flow   β”‚β”‚ = trust boundary crossing
  • `β”‚β”‚` marks each point where a flow crosses a boundary. A flow with no `β”‚β”‚` stays inside one trust zone.
  • Keep labels verb-or-protocol oriented (`HTTPS POST /login`, `SQL query`, `publish to queue`) so the

reader knows what crosses.

Reading threats off the diagram

Once boundaries are marked, the highest-value work is mechanical:

1. **List every flow that crosses a `β”‚β”‚`.** These are your priority targets. 2. For each crossing flow, the **destination process** is where untrusted input lands β€” apply Tampering, Information disclosure, DoS, and Elevation of privilege there. 3. For each **data store**, ask what happens if the flow writing to it is malicious (Tampering) or the store leaks (Information disclosure). 4. For each **external entity**, ask how it's authenticated (Spoofing) and whether its actions are logged (Repudiation).

Common diagram mistakes

  • **Missing the return flow.** Responses cross boundaries too and can leak data (Information disclosure).
  • **Collapsing distinct stores.** "The database" might be a user table, a session cache, and an audit log

with very different sensitivity β€” model them separately.

  • **Hiding third parties.** A payment processor or auth provider is an external entity behind a trust

boundary; its compromise or outage is in scope.

  • **No boundary inside the server.** Authenticated vs. unauthenticated handlers, or user vs. admin paths,

are boundaries even on one host.

Read more
@vanara-agents
Ships withskills

πŸ’ Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code β€” free, Apache-2.0, install with one command.

917 skills54 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
9
Star history of vanara-agents/skills on GitHub, a chart by star-history.com

Other agents on skills.

AGENT

AGENT

Agent

Use when designing a new HTTP/GraphQL API or changing an existing one β€” modeling resources, defining endpoint contracts, choosing…

review-notes

review-notes

Agent

This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the…

contract-and-openapi

contract-and-openapi

Agent

The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This…

design-checklist

design-checklist

Agent

Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting…

versioning-and-evolution

versioning-and-evoluti…

Agent

APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without…

pr-comment-template

pr-comment-template

Agent

Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about dfd-and-trust-boundaries.

Which coding agents can use dfd-and-trust-boundaries?
dfd-and-trust-boundaries installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.