pensar benchmark command runs automated security benchmarks across different branches of a repository, comparing vulnerability counts and security posture between code versions.
Synopsis
Description
Benchmark mode performs automated pentests on specified branches of a repository, allowing you to:- Compare security posture across branches
- Track vulnerability trends over development cycles
- Validate that security fixes reduce vulnerabilities
- Test multiple code versions efficiently
Arguments
Path to the git repository to benchmark.Must be a valid git repository with at least one branch.
Specific branches to benchmark (optional).If not specified, uses
--all-branches behavior or defaults to current branch.Options
Test all branches in the repository.Useful for comprehensive security audits across entire codebase history.
Limit the number of branches to test.Tests only the first N branches (by git branch listing order).
Skip the first N branches.Useful for paginating through large branch lists.
AI model to use for benchmarking.Higher-capability models may find more vulnerabilities but cost more.
Examples
Basic Branch Comparison
Compare security posture between two branches:Example Output
Example Output
Test All Branches (Limited)
Benchmark the 3 most recent branches:Feature Branch Validation
Test if a security fix reduces vulnerabilities:CI/CD Integration
Run benchmark in continuous integration:.github/workflows/benchmark.yml
How It Works
Repository Preparation
Pensar clones or accesses the specified repository and validates it’s a git repo.
Branch Iteration
For each specified branch:
- Checks out the branch
- Runs whitebox pentest on the codebase
- Stores findings separately per branch
Results Comparison
After all branches are tested, generates a comparison report showing:
- Vulnerability counts per severity
- New vulnerabilities introduced
- Vulnerabilities fixed
- Trend analysis
Use Cases
- Development Cycle
- Security Fix Validation
- Code Review
- Historical Analysis
Track security improvements across development:Monitor if new features introduce vulnerabilities.
Limitations
Requires whitebox access
Requires whitebox access
Benchmark mode needs full source code access. It cannot run on blackbox targets without source.
Time intensive
Time intensive
Each branch takes 5-15 minutes to test depending on codebase size. Benchmarking 10 branches may take 1-2 hours.
Branch state matters
Branch state matters
Tests the code as it exists on each branch at the time of testing. Does not account for runtime environment differences.
Determinism not guaranteed
Determinism not guaranteed
AI-based testing may find different vulnerabilities on repeated runs of the same branch. Use consistent models for comparability.
Troubleshooting
'Not a git repository' error
'Not a git repository' error
Ensure the path points to a valid git repository:Initialize git if needed:
Branch not found
Branch not found
Verify branch exists:Fetch remote branches if needed:
Benchmark taking too long
Benchmark taking too long
Use Or test specific branches only:
--limit to reduce branches:Next Steps
Whitebox Testing
Learn more about source code security analysis
CI/CD Integration
Automate benchmarks in your pipeline
Pentest Command
Run standard pentests instead of benchmarks
API Reference
Use the benchmark API programmatically

