Architecture Overview
RAPTOR uses a modular architecture with a unified entry point:Benefits
Single Entry Point
Users only need
python3 raptor.py <mode>Consistent Interface
All modes follow the same pattern
Easy Discovery
All modes shown in
--helpSimple Extension
Add engines without changing user workflow
Adding a New Scanner
Follow these steps to add a custom security scanner:Step 1: Create Package Structure
Create a new package inpackages/ with your scanner implementation:
Step 2: Implement CLI Interface
Createagent.py with a standard argparse CLI:
Step 3: Add Mode Handler
Openraptor.py and add a new mode handler function:
Step 4: Register Your Mode
In themain() function of raptor.py, add your mode to mode_handlers:
Step 5: Update Help Text
Update the help epilog inmain() to include your new mode:
Step 6: Test Integration
Complete Example: Dependency Scanner
Here’s a full example of adding a dependency vulnerability scanner:Create packages/dependency-scan/agent.py
Add to raptor.py
Usage
Creating Custom Agents
RAPTOR supports specialized agents for complex workflows:Agent Structure
Example: API Security Agent
Developing Skills
Skills are reusable expertise modules that can be loaded on-demand.Skill Structure
Example: API Authentication Skill
Secure JWT Implementation
Decision Framework
INSECURE if ANY:- No authentication required
- Weak token generation (predictable)
- No expiration (tokens valid forever)
- No signature verification
- Transmitted over HTTP
- Strong token generation (crypto random)
- Short expiration (< 24 hours)
- Proper signature verification
- HTTPS only
- Token validation on every request
Using Core Utilities
Output Conventions
1
Save to RAPTOR output directory
2
Use structured formats
JSON, SARIF, or other machine-readable formats
3
Include timestamps
4
Log to audit trail
Testing Your Extension
Unit Tests
Create tests intest/:
Integration Tests
Verify Output Format
Contributing
When contributing new scanners or features:Pull Request Checklist
- Scanner implementation in
packages/your-scanner/ - Mode handler in
raptor.py - Updated help text in
raptor.py - Documentation in
docs/(if complex) - Example usage in README.md
- Tests in
test/(if applicable) - Dependencies listed in
requirements.txt - Error handling implemented
- Output follows conventions
- Logging uses
get_logger()
Documentation Requirements
README Section
Add usage example to main README.md
Help Text
Clear description in
raptor.py --helpDocstrings
Document all public functions
Examples
Provide real-world usage examples
Code Review Guidelines
- Consistent style: Follow existing code patterns
- Error handling: Handle edge cases gracefully
- Documentation: Clear docstrings and comments
- Testing: Include basic tests
- Dependencies: Minimize external dependencies
Getting Help
Existing Scanners
Check
packages/ for examplesArchitecture Docs
Review
docs/ARCHITECTURE.mdGitHub Issues
Ask questions on GitHub
raptor.py Source
Study the routing pattern
Summary
Adding new capabilities to RAPTOR:- Create
packages/my-scanner/agent.py - Add
mode_my_scanner()function toraptor.py - Register in
mode_handlersdictionary - Update help text
- Test integration
Next Steps
Python CLI
Learn command-line usage patterns
Creating Personas
Develop custom expert personas
API Reference
Core API documentation
Configuration
Configuration options