Batch Processing
AegisShield includes a batch processing mode (main-batch.py) designed for research purposes, enabling automated generation of multiple threat models without manual UI interaction.
Overview
Batch processing was developed to support the empirical validation of AegisShield’s effectiveness by generating 540 threat models across 15 case studies (30 batches per case study).The
main-batch.py script is included for research transparency and reproducibility. General users typically use the interactive UI (main.py) instead.Automated
No manual interaction required
Parallel Processing
Configurable worker threads
Reproducible
Consistent results for validation
Use Cases
Research Validation
Research Validation
Generate multiple threat models for the same application to assess:
- Consistency across runs
- Coverage of threat categories
- Quality of MITRE ATT&CK mappings
- Comparison with expert-developed models
Comparative Analysis
Comparative Analysis
Compare threat models across:
- Different application types
- Various industry sectors
- Technology stack variations
- Complexity levels
Data Collection
Data Collection
Systematically collect threat modeling data for:
- Statistical analysis
- Machine learning training
- Threat pattern identification
- Security metrics development
Regression Testing
Regression Testing
Validate that code changes don’t affect:
- Threat generation quality
- MITRE ATT&CK mapping accuracy
- Integration with threat intelligence sources
Batch Input Structure
Batch inputs are JSON files in thebatch_inputs/ directory:
Case-Study-1-schema.json structure
Identifier for the case study
Detailed application description
Application type (must match step2_technology.py options)
Industry sector (must match step2_technology.py options)
Technology stack with specific versions
Number of threat models to generate
Directory for output files
Batch Output Structure
Generated outputs are JSON files with comprehensive results:Case-Study-1-results.json structure
Configuration
Batch processing supports configuration:main-batch.py configuration
Running Batch Processing
Command-Line Options
Usage
Error Handling
Batch processing includes comprehensive error handling:Error handling patterns
Common Errors
Common Errors
Rate Limit Errors:
- Wait 60 seconds between retries
- Reduce worker count
- Upgrade OpenAI API tier
- Check input JSON schema
- Ensure all required fields present
- Verify technology names match options
- Increase timeout in configuration
- Simplify application description
- Check network connectivity
Analysis Examples
Analyze batch results:Threat coverage analysis
MITRE technique frequency
Research Methodology
For AegisShield’s validation study:- 15 Case Studies from diverse domains (finance, healthcare, IoT, etc.)
- 30 Batches per case study for statistical significance
- 540 Total Threat Models generated
- Comparative Analysis against expert-developed models
- Quality Metrics: STRIDE coverage, MITRE mapping accuracy, threat relevance
Performance Optimization
Parallel Workers
Use 3-5 workers for optimal throughput without hitting rate limits.
Batch Size
Process 5-10 case studies at a time. Don’t try to process all 15 simultaneously.
Intermediate Saves
Enable
save_intermediate to avoid losing progress on failures.Rate Limiting
Add 2-3 second delays between batches to respect API limits.
Related Resources
- Case Studies - Details on the 15 validation case studies
- Research Methodology - Complete research context
- Configuration - API key and environment setup