Skip to content

[Feature] Security Policy Engine for Custom Compliance Enforcement #140

Description

@KolaSailaja

Summary

Add a Security Policy Engine that allows users to define custom security rules and compliance thresholds which PatchPilot evaluates automatically after each scan.

Motivation

Currently PatchPilot reports findings, severities, and remediation suggestions, but organizations often have internal security policies that determine whether a build, release, or repository should be considered compliant.

For example, one organization may allow up to five High severity findings, while another may block deployment if even a single Critical finding exists. Users currently have to manually review scan results and determine compliance, which is time-consuming and error-prone.

A built-in Security Policy Engine would allow teams to codify these requirements and automatically evaluate scan results against them, making PatchPilot more suitable for real-world security workflows and compliance programs.

Proposed solution

Introduce support for user-defined security policies that can be uploaded or configured through PatchPilot.

Example policy:

block_if:
  critical > 0

warn_if:
  high > 5

allow_if:
  medium < 20

Backend

  • Add policy parsing and validation service.
  • Evaluate findings against configured rules after each scan.
  • Generate policy evaluation results.
  • Include policy status in Evidence Packs.

Frontend

  • Add a Policy Management section.
  • Allow users to upload, edit, and validate policy files.
  • Display policy evaluation status after scans.

Output

Example:

{
  "policy_status": "FAILED",
  "reason": "Critical findings exceed allowed threshold",
  "violations": [
    {
      "rule": "critical > 0",
      "actual": 2
    }
  ]
}

Evidence Pack Integration

Add:

policy-evaluation.json
policy-summary.txt

to exported compliance evidence bundles.

ML tier (if applicable)

  • Tier 1 — Triage (severity ranking, deduplication, false positive classification)
  • Tier 2 — Predictive (fix success prediction, exploit scoring, pattern clustering)
  • Tier 3 — Autonomous (LLM patch generation, self-healing pipeline)
  • Not ML-related

Alternatives considered

  1. Hard-code severity thresholds globally.

    • Rejected because different organizations have different security requirements.
  2. Perform compliance checks outside PatchPilot.

    • Rejected because users would still need to manually interpret scan results and maintain separate tooling.
  3. Support only pass/fail severity checks.

    • Rejected because future policy rules may require more flexibility and customization.

Acceptance criteria

  • Users can define and upload custom security policy files.
  • PatchPilot evaluates scan findings against policy rules automatically.
  • Scan results display PASS/FAIL policy status with rule violation details.
  • Evidence Packs include policy evaluation artifacts and summaries.

Additional context

This feature would move PatchPilot closer to enterprise security platforms by enabling policy-driven security governance and compliance enforcement. It also lays the foundation for future integrations with CI/CD quality gates and organization-wide compliance controls.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions