# infantesromeroadrian/strands-agentguard architecture

> Architecture diagram of the GitHub repository infantesromeroadrian/strands-agentguard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/infantesromeroadrian/strands-agentguard
- Repository: https://github.com/infantesromeroadrian/strands-agentguard

## Overview

Strands AgentGuard is a defensive harness for assessing Strands agents and MCP tool surfaces with reproducible scenarios and evidence-backed reports. The main workflow is CLI invocation, target/scenario setup, trial execution through a mediated world, trace-based evaluation, and report generation. A separate inventory workflow discovers registered MCP servers and fingerprints their tools. The graph preserves the documented real Ollama target and security-control scenarios; unsampled implementation details are represented only where the tree or README supports them.

Main entry points: [`src/strands_agentguard/assessment/runner.py`](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/runner.py) (Assessment Runner), [`src/strands_agentguard/cli.py`](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/cli.py) (CLI), [`src/strands_agentguard/inventory.py`](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/inventory.py) (Inventory Discovery), [`src/strands_agentguard/doctor.py`](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/doctor.py) (Health Checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assessment["Scenario Assessment"]
  node_runner["Assessment Runner<br/>[runner.py]"]
  node_catalog["Scenario Catalog<br/>[catalog.py]"]
  node_payloads["Payload Sets<br/>[payloads.py]"]
  node_worlds["Scenario Worlds<br/>[worlds.py]"]
  node_world["Trial World<br/>[model.py]"]
  node_agent["Reference Agent<br/>[agents.py]"]
  node_evaluator["Trace Evaluator<br/>[evaluate.py]"]
  node_reports["Assessment Reports<br/>[runner.py]"]
end

subgraph group_targets["Targets And Controls"]
  node_target_setup["Target Setup<br/>[targets.py]"]
  node_synthetic_target["Deterministic Target<br/>[deterministic.py]"]
  node_identity["Fixture Identity<br/>[identity.py]"]
  node_strands_target["Strands Ollama Target<br/>[strands_target.py]"]
end

subgraph group_inventory["MCP Inventory"]
  node_inventory["Inventory Discovery<br/>[inventory.py]"]
  node_servers["Server Configuration<br/>[servers.py]"]
  node_observed["Observed Inventory<br/>[observed.py]"]
  node_synthetic_mcp["Synthetic MCP Server<br/>[synthetic_mcp.py]"]
  node_local_tools["Synthetic Tools<br/>[local_tools.py]"]
end

subgraph group_contracts["Contracts And Validation"]
  node_contracts["Data Contracts<br/>[contracts.py]"]
  node_doctor["Health Checks<br/>[doctor.py]"]
end

node_owner(("Agent Owner"))
node_cli["CLI<br/>[cli.py]"]
node_ollama(("Ollama Service"))

node_owner -->|"runs commands"| node_cli
node_cli -->|"starts assessment"| node_runner
node_cli -->|"selects target"| node_target_setup
node_cli -->|"requests inventory"| node_inventory
node_cli -->|"runs checks"| node_doctor
node_runner -->|"loads scenarios"| node_catalog
node_runner -->|"selects payloads"| node_payloads
node_runner -->|"builds situations"| node_worlds
node_runner -->|"mediates trials"| node_world
node_runner -->|"runs agent"| node_agent
node_runner -->|"evaluates traces"| node_evaluator
node_runner -->|"writes reports"| node_reports
node_target_setup -->|"validates fixture"| node_identity
node_target_setup -->|"selects reference"| node_agent
node_world -->|"exposes tools"| node_agent
node_world -->|"records trace"| node_evaluator
node_runner -->|"executes supported cases"| node_synthetic_target
node_cli -->|"configures real target"| node_strands_target
node_strands_target -->|"routes tool calls"| node_world
node_strands_target -.->|"queries model"| node_ollama
node_owner -->|"registers servers"| node_servers
node_inventory -->|"loads allowlist"| node_servers
node_inventory -->|"discovers tools"| node_synthetic_mcp
node_synthetic_mcp -->|"exposes tools"| node_local_tools
node_cli -->|"uses inventory output"| node_observed
node_observed -->|"summarizes surface"| node_inventory
node_runner -->|"validates result data"| node_contracts
node_inventory -->|"uses data contracts"| node_contracts
node_doctor -->|"checks schemas"| node_contracts
node_doctor -->|"checks discovery"| node_inventory
node_doctor -->|"checks target"| node_synthetic_target

click node_cli "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/cli.py"
click node_runner "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/runner.py"
click node_catalog "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/catalog.py"
click node_payloads "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/payloads.py"
click node_worlds "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/worlds.py"
click node_world "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/model.py"
click node_agent "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/agents.py"
click node_evaluator "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/evaluate.py"
click node_reports "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/runner.py"
click node_target_setup "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/targets.py"
click node_synthetic_target "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/targets/deterministic.py"
click node_identity "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/targets/identity.py"
click node_strands_target "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/strands_target.py"
click node_inventory "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/inventory.py"
click node_servers "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/servers.py"
click node_observed "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/observed.py"
click node_synthetic_mcp "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/synthetic_mcp.py"
click node_local_tools "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/local_tools.py"
click node_contracts "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/contracts.py"
click node_doctor "https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/doctor.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_catalog,node_payloads,node_worlds,node_world,node_agent,node_evaluator,node_reports toneBlue
class node_target_setup,node_synthetic_target,node_identity,node_strands_target toneAmber
class node_inventory,node_servers,node_observed,node_synthetic_mcp,node_local_tools toneMint
class node_contracts,node_doctor toneRose
class node_owner,node_ollama toneIndigo
class node_cli toneTeal
```

## Components

### Scenario Assessment

- [Assessment Runner](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/runner.py): `src/strands_agentguard/assessment/runner.py`
- [Scenario Catalog](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/catalog.py): `src/strands_agentguard/assessment/catalog.py`
- [Payload Sets](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/payloads.py): `src/strands_agentguard/assessment/payloads.py`
- [Scenario Worlds](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/worlds.py): `src/strands_agentguard/assessment/worlds.py`
- [Trial World](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/model.py): `src/strands_agentguard/assessment/model.py`
- [Reference Agent](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/agents.py): `src/strands_agentguard/assessment/agents.py`
- [Trace Evaluator](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/evaluate.py): `src/strands_agentguard/assessment/evaluate.py`
- [Assessment Reports](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/runner.py): `src/strands_agentguard/assessment/runner.py`

### Targets And Controls

- [Target Setup](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/targets.py): `src/strands_agentguard/assessment/targets.py`
- [Deterministic Target](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/targets/deterministic.py): `src/strands_agentguard/targets/deterministic.py`
- [Fixture Identity](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/targets/identity.py): `src/strands_agentguard/targets/identity.py`
- [Strands Ollama Target](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/assessment/strands_target.py): `src/strands_agentguard/assessment/strands_target.py`

### MCP Inventory

- [Inventory Discovery](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/inventory.py): `src/strands_agentguard/inventory.py`
- [Server Configuration](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/servers.py): `src/strands_agentguard/servers.py`
- [Observed Inventory](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/observed.py): `src/strands_agentguard/observed.py`
- [Synthetic MCP Server](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/synthetic_mcp.py): `src/strands_agentguard/synthetic_mcp.py`
- [Synthetic Tools](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/local_tools.py): `src/strands_agentguard/local_tools.py`

### Contracts And Validation

- [Data Contracts](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/contracts.py): `src/strands_agentguard/contracts.py`
- [Health Checks](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/doctor.py): `src/strands_agentguard/doctor.py`

### Other components

- **Agent Owner**
- [CLI](https://github.com/infantesromeroadrian/strands-agentguard/blob/main/src/strands_agentguard/cli.py): `src/strands_agentguard/cli.py`
- **Ollama Service**

## Connections

- Agent Owner → CLI: runs commands (evidence: `README.md`)
- CLI → Assessment Runner: starts assessment (evidence: `src/strands_agentguard/cli.py`)
- CLI → Target Setup: selects target (evidence: `src/strands_agentguard/cli.py`)
- CLI → Inventory Discovery: requests inventory (evidence: `src/strands_agentguard/cli.py`)
- CLI → Health Checks: runs checks (evidence: `src/strands_agentguard/cli.py`)
- Assessment Runner → Scenario Catalog: loads scenarios (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Payload Sets: selects payloads (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Scenario Worlds: builds situations (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Trial World: mediates trials (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Reference Agent: runs agent (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Trace Evaluator: evaluates traces (evidence: `src/strands_agentguard/assessment/runner.py`)
- Assessment Runner → Assessment Reports: writes reports (evidence: `src/strands_agentguard/assessment/runner.py`)
- Target Setup → Fixture Identity: validates fixture (evidence: `src/strands_agentguard/assessment/targets.py`)
- Target Setup → Reference Agent: selects reference (evidence: `src/strands_agentguard/assessment/targets.py`)
- Trial World → Reference Agent: exposes tools (evidence: `src/strands_agentguard/assessment/agents.py`)
- Trial World → Trace Evaluator: records trace (evidence: `src/strands_agentguard/assessment/model.py`)
- Assessment Runner → Deterministic Target: executes supported cases (evidence: `README.md`)
- CLI → Strands Ollama Target: configures real target (evidence: `src/strands_agentguard/cli.py`)
- Strands Ollama Target → Trial World: routes tool calls (evidence: `src/strands_agentguard/assessment/strands_target.py`)
- Strands Ollama Target → Ollama Service: queries model (evidence: `README.md`)
- Agent Owner → Server Configuration: registers servers (evidence: `README.md`)
- Inventory Discovery → Server Configuration: loads allowlist (evidence: `README.md`)
- Inventory Discovery → Synthetic MCP Server: discovers tools (evidence: `src/strands_agentguard/inventory.py`)
- Synthetic MCP Server → Synthetic Tools: exposes tools (evidence: `src/strands_agentguard/synthetic_mcp.py`)
- CLI → Observed Inventory: uses inventory output (evidence: `src/strands_agentguard/cli.py`)
- Observed Inventory → Inventory Discovery: summarizes surface (evidence: `src/strands_agentguard/observed.py`)
- Assessment Runner → Data Contracts: validates result data (evidence: `src/strands_agentguard/assessment/runner.py`)
- Inventory Discovery → Data Contracts: uses data contracts (evidence: `src/strands_agentguard/inventory.py`)
- Health Checks → Data Contracts: checks schemas (evidence: `src/strands_agentguard/doctor.py`)
- Health Checks → Inventory Discovery: checks discovery (evidence: `src/strands_agentguard/doctor.py`)
- Health Checks → Deterministic Target: checks target (evidence: `src/strands_agentguard/doctor.py`)
