# intruder-io/autoswagger architecture

> Architecture diagram of the GitHub repository intruder-io/autoswagger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intruder-io/autoswagger
- Repository: https://github.com/intruder-io/autoswagger

## Overview

Autoswagger is a command-line security scanner that finds API specifications, tests documented endpoints for unauthenticated access, analyzes responses for sensitive or unusually large data, and reports findings. Its runtime is implemented in the single core file autoswagger.py, so the graph separates meaningful responsibilities within that file rather than implying a multi-package architecture. The README documents the full capability set; sampled source confirms endpoint dispatch and spec-fetch behavior, but not every internal call relationship.

Main entry points: [`autoswagger.py`](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py) (Scan coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Spec discovery"]
  node_scanner["Scan coordinator<br/>[autoswagger.py]"]
  node_direct["Direct spec fetch<br/>[autoswagger.py]"]
  node_ui["Swagger UI discovery<br/>[autoswagger.py]"]
  node_bruteforce_discovery["Spec path probing<br/>[autoswagger.py]"]
end

subgraph group_testing["Endpoint testing"]
  node_endpoint_plan["Endpoint planning<br/>[autoswagger.py]"]
  node_parameter_values["Parameter generation<br/>[autoswagger.py]"]
  node_endpoint_tests["Concurrent endpoint tests<br/>[autoswagger.py]"]
  node_rate_limit["Rate limiting<br/>[autoswagger.py]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_response_analysis["Response analysis<br/>[autoswagger.py]"]
  node_presidio["Presidio analyzer"]
  node_secret_checks["Secret detection<br/>[autoswagger.py]"]
  node_large_response["Large response checks<br/>[autoswagger.py]"]
  node_results["Findings and stats<br/>[autoswagger.py]"]
  node_output["Table or JSON output<br/>[autoswagger.py]"]
end

node_operator(("CLI user"))
node_target["Target API"]

node_operator -->|"provides URLs"| node_scanner
node_scanner -->|"tries direct spec"| node_direct
node_scanner -->|"tries UI discovery"| node_ui
node_scanner -->|"falls back to probing"| node_bruteforce_discovery
node_direct -->|"fetches specification"| node_target
node_ui -->|"fetches UI and assets"| node_target
node_bruteforce_discovery -->|"probes spec paths"| node_target
node_scanner -->|"passes loaded spec"| node_endpoint_plan
node_endpoint_plan -->|"builds test inputs"| node_parameter_values
node_endpoint_plan -->|"dispatches endpoint jobs"| node_endpoint_tests
node_endpoint_tests -->|"sends requests"| node_target
node_endpoint_tests -->|"throttles requests"| node_rate_limit
node_endpoint_tests -->|"analyzes responses"| node_response_analysis
node_response_analysis -->|"checks for PII"| node_presidio
node_response_analysis -->|"checks secrets"| node_secret_checks
node_response_analysis -->|"flags large content"| node_large_response
node_response_analysis -->|"records findings"| node_results
node_scanner -->|"aggregates scan results"| node_results
node_results -->|"formats findings"| node_output
node_operator -->|"sets scan options"| node_scanner

click node_scanner "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_direct "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_ui "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_bruteforce_discovery "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_endpoint_plan "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_parameter_values "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_endpoint_tests "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_rate_limit "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_response_analysis "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_secret_checks "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_large_response "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_results "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py"
click node_output "https://github.com/intruder-io/autoswagger/blob/main/autoswagger.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_scanner,node_direct,node_ui,node_bruteforce_discovery,node_operator toneBlue
class node_endpoint_plan,node_parameter_values,node_endpoint_tests,node_rate_limit toneAmber
class node_response_analysis,node_presidio,node_secret_checks,node_large_response,node_results,node_output,node_target toneMint
```

## Components

### Spec discovery

- [Scan coordinator](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Direct spec fetch](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Swagger UI discovery](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Spec path probing](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`

### Endpoint testing

- [Endpoint planning](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Parameter generation](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Concurrent endpoint tests](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Rate limiting](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`

### Analysis and reporting

- [Response analysis](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- **Presidio analyzer**
- [Secret detection](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Large response checks](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Findings and stats](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`
- [Table or JSON output](https://github.com/intruder-io/autoswagger/blob/main/autoswagger.py): `autoswagger.py`

### Other components

- **CLI user**
- **Target API**

## Connections

- CLI user → Scan coordinator: provides URLs (evidence: `README.md`)
- Scan coordinator → Direct spec fetch: tries direct spec (evidence: `README.md`)
- Scan coordinator → Swagger UI discovery: tries UI discovery (evidence: `README.md`)
- Scan coordinator → Spec path probing: falls back to probing (evidence: `README.md`)
- Direct spec fetch → Target API: fetches specification (evidence: `autoswagger.py`)
- Swagger UI discovery → Target API: fetches UI and assets (evidence: `autoswagger.py`)
- Spec path probing → Target API: probes spec paths (evidence: `README.md`)
- Scan coordinator → Endpoint planning: passes loaded spec (evidence: `autoswagger.py`)
- Endpoint planning → Parameter generation: builds test inputs (evidence: `README.md`)
- Endpoint planning → Concurrent endpoint tests: dispatches endpoint jobs (evidence: `autoswagger.py`)
- Concurrent endpoint tests → Target API: sends requests (evidence: `README.md`)
- Concurrent endpoint tests → Rate limiting: throttles requests (evidence: `README.md`)
- Concurrent endpoint tests → Response analysis: analyzes responses (evidence: `README.md`)
- Response analysis → Presidio analyzer: checks for PII (evidence: `README.md`)
- Response analysis → Secret detection: checks secrets (evidence: `README.md`)
- Response analysis → Large response checks: flags large content (evidence: `README.md`)
- Response analysis → Findings and stats: records findings (evidence: `README.md`)
- Scan coordinator → Findings and stats: aggregates scan results (evidence: `autoswagger.py`)
- Findings and stats → Table or JSON output: formats findings (evidence: `README.md`)
- CLI user → Scan coordinator: sets scan options (evidence: `README.md`)
