Architectural Overview
Shannon is engineered to emulate the methodology of a human penetration tester through a sophisticated multi-agent architecture. Its strength lies in combining white-box source code analysis with black-box dynamic exploitation, orchestrated through durable workflows.System Architecture Diagram
Hybrid Testing Approach
Shannon’s power comes from combining two complementary testing methodologies:- White-Box Analysis
- Black-Box Exploitation
Source Code Analysis
Shannon analyzes your application’s source code to understand:- Data Flow Paths: How user input flows through the application
- Dangerous Sinks: Where untrusted data reaches sensitive operations
- Security Controls: Authentication, authorization, and input validation mechanisms
- Technology Stack: Frameworks, libraries, and their known vulnerability patterns
- API Endpoints: All exposed routes and their parameters
src/session-manager.ts:14-108 - Agent definitions and prerequisitesCore Modules
Shannon’s codebase is organized into focused, testable modules:Agent Management
Temporal Orchestration
Workflow Orchestration
Workflow Orchestration
File:
src/temporal/workflows.tsThe main workflow orchestrates all five phases:- Sequential execution for pre-recon and recon
- Parallel execution for 5 vuln/exploit pipelines
- Configurable concurrency limits (1-5 concurrent pipelines)
- Graceful error handling - other pipelines continue if one fails
- Queryable progress via
getProgressquery
Activity Layer
Activity Layer
File:
src/temporal/activities.tsActivities are thin wrappers that:- Provide heartbeat for long-running operations
- Classify errors as retryable vs. non-retryable
- Manage container lifecycle
- Delegate business logic to services
Service Layer
Service Layer
Directory:
src/services/Business logic layer is Temporal-agnostic:agent-execution.ts- Agent lifecycle managementerror-handling.ts- Error classification and retry logiccontainer.ts- Dependency injection containerprompt-manager.ts- Prompt template loading and variable substitutionqueue-validation.ts- Exploitation queue validation
ActivityLogger interface and return Result<T, E> for explicit error handling.AI Execution Engine
File:src/ai/claude-executor.ts
The execution engine handles:
Key Design Patterns
Configuration-Driven
YAML configs with JSON Schema validation for authentication, retry strategies, and testing parameters
Progressive Analysis
Each phase builds on previous results - recon uses pre-recon data, exploits use vuln analysis
SDK-First
Claude Agent SDK handles autonomous analysis - Shannon provides orchestration and validation
Modular Error Handling
Result<T,E> pattern for explicit error propagation, automatic retry with exponential backoffServices Boundary
Activities are thin Temporal wrappers - services own business logic with no Temporal imports
DI Container
Per-workflow dependency injection for testability and isolation
Data Flow
Here’s how data flows through Shannon during a pentest:Pre-Recon
External tools (nmap, subfinder, whatweb) + source code analysis →
code_analysis_deliverable.mdVuln Analysis
5 parallel agents analyze for specific vuln types →
{vulntype}_analysis_deliverable.md + exploitation queueSupporting Systems
Audit System
Directory:src/audit/
Crash-safe append-only logging:
audit-session.ts- Session-level metrics and agent logsworkflow-logger.ts- Human-readable workflow logslog-stream.ts- Shared stream primitive
Prompt Management
Directory:prompts/
Prompt templates with variable substitution:
- Phase-specific prompts:
pre-recon-code.txt,vuln-injection.txt,exploit-auth.txt - Shared partials in
prompts/shared/:_target.txt,_rules.txt,login-instructions.txt - Variable substitution:
{{TARGET_URL}},{{CONFIG_CONTEXT}},{{LOGIN_INSTRUCTIONS}}
Deliverable Management
Tool:save_deliverable MCP tool
Agents save structured deliverables:
- Markdown format with consistent structure
- Git checkpointed after each agent completes
- Validated by agent-specific validators before marking complete
- Used as input for subsequent phases
Next Steps
Workflow Phases
Deep dive into the five phases of execution
Agent System
Learn about agent definitions and parallel execution
Temporal Orchestration
Understand durable workflows and crash recovery
Core Modules
Explore the codebase structure in detail
