# guhansenthil/bhairava-bb architecture

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

- Interactive diagram: https://gitdiagram.com/guhansenthil/bhairava-bb
- Repository: https://github.com/guhansenthil/bhairava-bb

## Overview

BHAIRAVA-BB is an authorized bug-bounty research framework. The main workflow is CLI invocation → scoped pipeline → reconnaissance, endpoint discovery, vulnerability detection, finding processing, evidence and reporting; validation and resumable jobs support review and repeat runs. Asset intelligence and optional AI are documented V6 capabilities. The pipeline and security boundary are visible in excerpts; some V6 and evidence-stage wiring is documented but not shown in sampled implementation, so those links are marked accordingly.

Main entry points: [`bhairava/pipeline/engine.py`](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/pipeline/engine.py) (Pipeline), [`bhairava/core/executor.py`](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/core/executor.py) (Secure executor), [`bhairava/tools/registry.py`](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/tools/registry.py) (Tool registry), [`bhairava/findings/models.py`](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/models.py) (Finding models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Research workflow"]
  node_cli["CLI<br/>[cli.py]"]
  node_pipeline["Pipeline<br/>[engine.py]"]
  node_recon["Recon<br/>[engine.py]"]
  node_discovery["Discovery<br/>[engine.py]"]
  node_detection["Detection<br/>[engine.py]"]
  node_validation["Validation<br/>[engine.py]"]
  node_reports["Report generation<br/>[engine.py]"]
end

subgraph group_safety["Safety and execution"]
  node_scope["Scope guard<br/>[scope_guard.py]"]
  node_executor["Secure executor<br/>[executor.py]"]
  node_rate["Rate limiter<br/>[rate_limiter.py]"]
  node_registry["Tool registry<br/>[registry.py]"]
  node_adapters["Tool adapters"]
end

subgraph group_findings["Findings and evidence"]
  node_findings["Finding models<br/>[models.py]"]
  node_correlation["Finding correlation<br/>[correlation.py]"]
  node_dedupe["Finding deduplication<br/>[dedup.py]"]
  node_evidence["Evidence collection<br/>[collector.py]"]
end

subgraph group_state["Jobs and persistence"]
  node_jobs["Job manager<br/>[manager.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_planning["Execution planning<br/>[planner.py]"]
end

subgraph group_intelligence["Intelligence and AI"]
  node_asset_intel["Asset intelligence<br/>[engine.py]"]
  node_asset_repository[("Asset repository<br/>[repository.py]")]
  node_ai_policy["AI policy<br/>[policy.py]"]
  node_ai_provider["AI provider<br/>[compatible.py]"]
end

node_user(("Researcher"))
node_reviewer(("Human reviewer"))

node_user -->|"invokes"| node_cli
node_cli -->|"starts"| node_pipeline
node_pipeline -->|"loads scope"| node_scope
node_pipeline -->|"configures"| node_executor
node_executor -->|"validates target"| node_scope
node_executor -->|"waits on"| node_rate
node_pipeline -->|"creates"| node_registry
node_registry -->|"registers"| node_adapters
node_pipeline -->|"runs"| node_recon
node_pipeline -->|"runs"| node_discovery
node_pipeline -->|"runs"| node_detection
node_recon -->|"executes tools"| node_executor
node_discovery -->|"executes tools"| node_executor
node_detection -->|"executes tools"| node_executor
node_recon -->|"selects adapters"| node_registry
node_discovery -->|"selects adapters"| node_registry
node_detection -->|"selects adapter"| node_registry
node_pipeline -->|"correlates"| node_correlation
node_pipeline -->|"deduplicates"| node_dedupe
node_detection -->|"creates"| node_findings
node_pipeline -->|"persists findings"| node_findings
node_pipeline -.->|"collects evidence"| node_evidence
node_pipeline -->|"writes report"| node_reports
node_reports -->|"renders"| node_findings
node_cli -->|"offers validation"| node_validation
node_validation -->|"runs validator"| node_executor
node_validation -->|"checks finding"| node_scope
node_validation -->|"updates status"| node_findings
node_pipeline -->|"manages job"| node_jobs
node_jobs -->|"persists job"| node_database
node_pipeline -->|"stores findings"| node_database
node_cli -.->|"offers dry run"| node_planning
node_pipeline -.->|"runs intelligence"| node_asset_intel
node_asset_intel -.->|"persists assets"| node_asset_repository
node_asset_intel -.->|"correlates findings"| node_findings
node_ai_provider -.->|"proposes steps"| node_ai_policy
node_ai_policy -.->|"revalidates through"| node_scope
node_evidence -.->|"supports review"| node_reviewer
node_reports -.->|"presents results"| node_reviewer

click node_cli "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/cli.py"
click node_pipeline "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/pipeline/engine.py"
click node_recon "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/recon/engine.py"
click node_discovery "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/discovery/engine.py"
click node_detection "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/detection/engine.py"
click node_validation "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/validation/engine.py"
click node_reports "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/reporting/engine.py"
click node_scope "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/scope_guard.py"
click node_executor "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/core/executor.py"
click node_rate "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/core/rate_limiter.py"
click node_registry "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/tools/registry.py"
click node_adapters "https://github.com/guhansenthil/bhairava-bb/tree/main/bhairava/tools/adapters"
click node_findings "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/models.py"
click node_correlation "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/correlation.py"
click node_dedupe "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/dedup.py"
click node_evidence "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/evidence/collector.py"
click node_jobs "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/jobs/manager.py"
click node_database "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/storage/database.py"
click node_planning "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/planning/planner.py"
click node_asset_intel "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/intelligence/engine.py"
click node_asset_repository "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/intelligence/repository.py"
click node_ai_policy "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/agent/policy.py"
click node_ai_provider "https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/agent/providers/compatible.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_cli,node_pipeline,node_recon,node_discovery,node_detection,node_validation,node_reports,node_reviewer toneBlue
class node_scope,node_executor,node_rate,node_registry,node_adapters toneAmber
class node_findings,node_correlation,node_dedupe,node_evidence toneMint
class node_jobs,node_database,node_planning toneRose
class node_asset_intel,node_asset_repository,node_ai_policy,node_ai_provider,node_user toneIndigo
```

## Components

### Research workflow

- [CLI](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/cli.py): `bhairava/cli.py`
- [Pipeline](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/pipeline/engine.py): `bhairava/pipeline/engine.py`
- [Recon](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/recon/engine.py): `bhairava/recon/engine.py`
- [Discovery](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/discovery/engine.py): `bhairava/discovery/engine.py`
- [Detection](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/detection/engine.py): `bhairava/detection/engine.py`
- [Validation](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/validation/engine.py): `bhairava/validation/engine.py`
- [Report generation](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/reporting/engine.py): `bhairava/reporting/engine.py`

### Safety and execution

- [Scope guard](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/scope_guard.py): `bhairava/scope_guard.py`
- [Secure executor](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/core/executor.py): `bhairava/core/executor.py`
- [Rate limiter](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/core/rate_limiter.py): `bhairava/core/rate_limiter.py`
- [Tool registry](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/tools/registry.py): `bhairava/tools/registry.py`
- [Tool adapters](https://github.com/guhansenthil/bhairava-bb/tree/main/bhairava/tools/adapters): `bhairava/tools/adapters`

### Findings and evidence

- [Finding models](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/models.py): `bhairava/findings/models.py`
- [Finding correlation](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/correlation.py): `bhairava/findings/correlation.py`
- [Finding deduplication](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/findings/dedup.py): `bhairava/findings/dedup.py`
- [Evidence collection](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/evidence/collector.py): `bhairava/evidence/collector.py`

### Jobs and persistence

- [Job manager](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/jobs/manager.py): `bhairava/jobs/manager.py`
- [SQLite database](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/storage/database.py): `bhairava/storage/database.py`
- [Execution planning](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/planning/planner.py): `bhairava/planning/planner.py`

### Intelligence and AI

- [Asset intelligence](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/intelligence/engine.py): `bhairava/intelligence/engine.py`
- [Asset repository](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/intelligence/repository.py): `bhairava/intelligence/repository.py`
- [AI policy](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/agent/policy.py): `bhairava/agent/policy.py`
- [AI provider](https://github.com/guhansenthil/bhairava-bb/blob/main/bhairava/agent/providers/compatible.py): `bhairava/agent/providers/compatible.py`

### Other components

- **Researcher**
- **Human reviewer**

## Connections

- Researcher → CLI: invokes
- CLI → Pipeline: starts (evidence: `bhairava/cli.py`)
- Pipeline → Scope guard: loads scope (evidence: `bhairava/pipeline/engine.py`)
- Pipeline → Secure executor: configures (evidence: `bhairava/pipeline/engine.py`)
- Secure executor → Scope guard: validates target (evidence: `bhairava/core/executor.py`)
- Secure executor → Rate limiter: waits on (evidence: `bhairava/core/executor.py`)
- Pipeline → Tool registry: creates (evidence: `bhairava/pipeline/engine.py`)
- Tool registry → Tool adapters: registers (evidence: `bhairava/tools/registry.py`)
- Pipeline → Recon: runs (evidence: `bhairava/pipeline/engine.py`)
- Pipeline → Discovery: runs (evidence: `bhairava/pipeline/engine.py`)
- Pipeline → Detection: runs (evidence: `bhairava/pipeline/engine.py`)
- Recon → Secure executor: executes tools (evidence: `bhairava/recon/engine.py`)
- Discovery → Secure executor: executes tools (evidence: `bhairava/discovery/engine.py`)
- Detection → Secure executor: executes tools (evidence: `bhairava/detection/engine.py`)
- Recon → Tool registry: selects adapters (evidence: `bhairava/recon/engine.py`)
- Discovery → Tool registry: selects adapters (evidence: `bhairava/discovery/engine.py`)
- Detection → Tool registry: selects adapter (evidence: `bhairava/detection/engine.py`)
- Pipeline → Finding correlation: correlates (evidence: `bhairava/pipeline/engine.py`)
- Pipeline → Finding deduplication: deduplicates (evidence: `bhairava/pipeline/engine.py`)
- Detection → Finding models: creates (evidence: `bhairava/detection/engine.py`)
- Pipeline → Finding models: persists findings (evidence: `bhairava/pipeline/engine.py`)
- Pipeline → Evidence collection: collects evidence
- Pipeline → Report generation: writes report (evidence: `bhairava/pipeline/engine.py`)
- Report generation → Finding models: renders (evidence: `bhairava/reporting/engine.py`)
- CLI → Validation: offers validation (evidence: `bhairava/cli.py`)
- Validation → Secure executor: runs validator (evidence: `bhairava/validation/engine.py`)
- Validation → Scope guard: checks finding (evidence: `bhairava/validation/engine.py`)
- Validation → Finding models: updates status (evidence: `bhairava/validation/engine.py`)
- Pipeline → Job manager: manages job (evidence: `bhairava/pipeline/engine.py`)
- Job manager → SQLite database: persists job (evidence: `bhairava/jobs/manager.py`)
- Pipeline → SQLite database: stores findings (evidence: `bhairava/pipeline/engine.py`)
- CLI → Execution planning: offers dry run
- Pipeline → Asset intelligence: runs intelligence
- Asset intelligence → Asset repository: persists assets (evidence: `bhairava/intelligence/repository.py`)
- Asset intelligence → Finding models: correlates findings (evidence: `bhairava/intelligence/engine.py`)
- AI provider → AI policy: proposes steps
- AI policy → Scope guard: revalidates through
- Evidence collection → Human reviewer: supports review
- Report generation → Human reviewer: presents results
