Install PatchPilot and automate your DevSecOps workflow in three simple steps.
Choose your preferred installation method
Install PatchPilot as a GitHub App for seamless integration with your repositories. No configuration files needed - just click and authorize.
## Installation Steps: 1. Click "Install GitHub App" button above 2. Select repositories to monitor (or choose "All repositories") 3. Authorize PatchPilot to access your repos 4. Done! PatchPilot will start monitoring for vulnerabilities ## What happens next? - PatchPilot scans your codebase within 5 minutes - You'll receive a summary of detected vulnerabilities - AI-generated patches appear as pull requests automatically
For advanced users who prefer command-line tools or need local development integration.
# Install via npm npm install -g @patchpilot/cli # Or via pip pip install patchpilot # Verify installation patchpilot --version # Initialize in your project patchpilot init # Run manual scan patchpilot scan ./src # Generate patches for detected vulnerabilities patchpilot patch --auto
Run PatchPilot in a container for isolated environments or CI/CD pipelines.
# Pull the official image
docker pull patchpilot/scanner:latest
# Run vulnerability scan
docker run -v $(pwd):/code patchpilot/scanner scan /code
# Run with custom config
docker run -v $(pwd):/code -v ./config.yml:/config.yml \
patchpilot/scanner scan /code --config /config.yml
# Docker Compose example
version: '3.8'
services:
patchpilot:
image: patchpilot/scanner:latest
volumes:
- ./src:/code
environment:
- PATCHPILOT_TOKEN=${PATCHPILOT_TOKEN}
command: scan /code --watch
Customize PatchPilot for your project needs
.patchpilot.yml file in your repository root:# .patchpilot.yml - Full configuration example
# Vulnerability scanning settings
scan:
# File patterns to include/exclude
include:
- "src/**/*.js"
- "src/**/*.py"
- "lib/**/*.go"
exclude:
- "node_modules/**"
- "**/*.test.js"
- "dist/**"
# Scan schedule (cron format)
schedule: "0 2 * * *" # Daily at 2 AM
# Minimum severity to report (LOW, MEDIUM, HIGH, CRITICAL)
min_severity: "MEDIUM"
# Patch generation settings
patch:
# Auto-generate patches for vulnerabilities
auto_generate: true
# Create PR automatically
auto_pr: true
# PR settings
pr_labels:
- "security"
- "automated-patch"
pr_reviewers:
- "security-team"
pr_branch_prefix: "patchpilot/"
# Patch strategies (ordered by preference)
strategies:
- "parameterized-query"
- "input-validation"
- "escape-output"
- "framework-builtin"
# Test generation settings
testing:
# Auto-generate tests
enabled: true
# Test types to generate
types:
- "unit"
- "integration"
- "security"
# Test framework (auto-detect if not specified)
framework: "jest" # Options: jest, pytest, go-test, etc.
# Minimum coverage requirement
min_coverage: 80
# Impact analysis settings
impact:
# Analyze dependencies and affected modules
enabled: true
# Maximum blast radius to auto-approve
max_affected_files: 5
# Rollback settings
rollback:
# Create automatic snapshots before patches
snapshots: true
# Retention period for snapshots (days)
retention_days: 30
# Canary deployment settings
canary:
enabled: true
percentage: 10
duration_minutes: 30
# Notification settings
notifications:
# Slack webhook
slack:
webhook_url: "${SLACK_WEBHOOK_URL}"
channel: "#security-alerts"
# Email notifications
email:
recipients:
- "security@example.com"
severity_threshold: "HIGH"
# Discord webhook
discord:
webhook_url: "${DISCORD_WEBHOOK_URL}"
# Integration settings
integrations:
# CI/CD integration
ci:
block_on_high_severity: true
fail_threshold: "CRITICAL"
# Issue tracker integration
jira:
enabled: true
project_key: "SEC"
auto_create_tickets: true
Common use cases and workflows
# Scan specific directory patchpilot scan ./src # Scan with output file patchpilot scan . -o report.json # Scan only for OWASP Top 10 patchpilot scan . --owasp-only
# Generate patch for specific CVE patchpilot patch CVE-2024-12345 # Generate with test suite patchpilot patch CVE-2024-12345 \ --with-tests # Preview patch without applying patchpilot patch --dry-run
# Run generated tests patchpilot test # Run with coverage report patchpilot test --coverage # Run specific test types patchpilot test --unit --security
# Analyze patch impact patchpilot analyze ./patch.diff # Get dependency graph patchpilot analyze --dependencies # Calculate blast radius patchpilot analyze --blast-radius
# List available snapshots patchpilot rollback list # Rollback to snapshot patchpilot rollback restore abc123 # Create manual snapshot patchpilot snapshot create
# GitHub Actions
- uses: patchpilot/action@v2
with:
auto-patch: true
pr-labels: 'security'
# GitLab CI
patchpilot-scan:
script: patchpilot scan .
# .github/workflows/patchpilot.yml
name: PatchPilot Security Scan
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
schedule:
- cron: '0 2 * * *' # Daily at 2 AM
jobs:
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run PatchPilot Scan
uses: patchpilot/action@v2
with:
token: ${{ secrets.PATCHPILOT_TOKEN }}
auto-patch: true
auto-pr: true
min-severity: 'MEDIUM'
- name: Upload Security Report
uses: actions/upload-artifact@v3
with:
name: security-report
path: patchpilot-report.json
# .gitlab-ci.yml
patchpilot-scan:
image: patchpilot/scanner:latest
stage: security
script:
- patchpilot scan . --output report.json
artifacts:
reports:
security: report.json
only:
- main
- merge_requests
patchpilot-patch:
image: patchpilot/scanner:latest
stage: patch
script:
- patchpilot patch --auto --with-tests
when: manual
only:
- main
Integrate PatchPilot programmatically
/api/v1/scan
Trigger a vulnerability scan for a repository
curl -X POST https://api.patchpilot.tech/v1/scan \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"repository": "owner/repo",
"branch": "main",
"min_severity": "MEDIUM"
}'
/api/v1/vulnerabilities
List all detected vulnerabilities for a repository
curl -X GET https://api.patchpilot.tech/v1/vulnerabilities \ -H "Authorization: Bearer YOUR_API_KEY" \ -G -d "repository=owner/repo" -d "status=open"
/api/v1/patch
Generate a patch for a specific vulnerability
curl -X POST https://api.patchpilot.tech/v1/patch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vulnerability_id": "vuln_abc123",
"strategy": "auto",
"create_pr": true,
"with_tests": true
}'