Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Setting `ZelyoConfig.spec.mode: protect` only flips the remediation engine's str
Only then does the full loop fire:

1. Correlator emits an incident
2. `RemediationPolicy` controller filters open incidents by `spec.severityFilter` and caps PR submissions per reconcile cycle via `spec.maxConcurrentPRs`
2. `RemediationPolicy` controller filters open incidents by `spec.severityFilter` and caps the number of open PRs via `spec.maxConcurrentPRs` — already-open Zelyo PRs on the target repo count against the budget, so new PRs only open when existing ones merge or close
3. Remediation engine asks the LLM for a structured JSON fix plan and scores the risk
4. GitHub engine creates a branch, commits the fix, and opens a PR (skipped globally when `ZelyoConfig.spec.mode: audit`, which leaves the engine in `dry-run`)
5. Human team reviews and merges the PR
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ graph LR
| Mode | Behavior |
| ----------------------------- | --------------------------------------------------------------------------------------- |
| **Audit** *(default)* | Detects, correlates, and alerts. The remediation engine runs in `dry-run` — fix plans are logged but no PRs are opened. |
| **Protect** | Switches the remediation engine to the `gitops-pr` strategy. PRs are opened only when at least one `RemediationPolicy` CR points at a configured `GitOpsRepository`. The policy's `severityFilter` decides which incidents qualify, and `maxConcurrentPRs` caps submissions per reconcile cycle. |
| **Protect** | Switches the remediation engine to the `gitops-pr` strategy. PRs are opened only when at least one `RemediationPolicy` CR points at a configured `GitOpsRepository`. The policy's `severityFilter` decides which incidents qualify, and `maxConcurrentPRs` caps the number of open Zelyo PRs on the target repo. |

> **Note:** `ZelyoConfig.spec.mode: protect` by itself does not produce any PRs — it only authorizes the pipeline. See [Enable GitOps Remediation](docs/quickstart.md#enable-gitops-remediation) for the full `GitOpsRepository` + `RemediationPolicy` setup.

Expand Down
6 changes: 5 additions & 1 deletion api/v1alpha1/remediationpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ type RemediationPolicySpec struct {
// +optional
DryRun bool `json:"dryRun,omitempty"`

// maxConcurrentPRs limits the number of open PRs at any time.
// maxConcurrentPRs limits the number of open Zelyo-generated PRs on
// the target repo at any time. Already-open PRs count against the
// budget, so new PRs only open when existing ones merge or close.
// Current count is surfaced on status.openPRs. Multiple
// RemediationPolicies targeting the same repo share this budget.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=5
// +optional
Expand Down
8 changes: 6 additions & 2 deletions config/crd/bases/zelyo.ai_remediationpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ spec:
type: string
maxConcurrentPRs:
default: 5
description: maxConcurrentPRs limits the number of open PRs at any
time.
description: |-
maxConcurrentPRs limits the number of open Zelyo-generated PRs on
the target repo at any time. Already-open PRs count against the
budget, so new PRs only open when existing ones merge or close.
Current count is surfaced on status.openPRs. Multiple
RemediationPolicies targeting the same repo share this budget.
format: int32
minimum: 1
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ spec:
type: string
maxConcurrentPRs:
default: 5
description: maxConcurrentPRs limits the number of open PRs at any
time.
description: |-
maxConcurrentPRs limits the number of open Zelyo-generated PRs on
the target repo at any time. Already-open PRs count against the
budget, so new PRs only open when existing ones merge or close.
Current count is surfaced on status.openPRs. Multiple
RemediationPolicies targeting the same repo share this budget.
format: int32
minimum: 1
type: integer
Expand Down
2 changes: 1 addition & 1 deletion docs/gitops-onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ metadata:
spec:
gitOpsRepository: production-manifests # must match a GitOpsRepository CR
severityFilter: high # critical | high | medium | low
maxConcurrentPRs: 3 # cap per reconcile cycle (not a global open-PR count)
maxConcurrentPRs: 3 # cap on open Zelyo PRs in the target repo; surfaced on status.openPRs
prTemplate:
titlePrefix: "[Zelyo Operator]"
labels: ["auto-fix", "security"]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Aggregate views, cross-cluster correlation, and centralized policy management ac
| Mode | When | Behavior |
|---|---|---|
| **:material-magnify: Audit Mode** (default) | `ZelyoConfig.spec.mode: audit` | Detects, diagnoses, and sends alerts. The remediation engine runs in `dry-run` — fix plans are logged but no PRs are opened. Zero cluster modifications. |
| **:material-shield-check: Protect Mode** | `ZelyoConfig.spec.mode: protect` **and** at least one `RemediationPolicy` targeting a `GitOpsRepository` | Switches the remediation engine to the `gitops-pr` strategy. The `RemediationPolicy` controller drives PR creation — `severityFilter` gates which incidents qualify, `maxConcurrentPRs` caps submissions per reconcile cycle. |
| **:material-shield-check: Protect Mode** | `ZelyoConfig.spec.mode: protect` **and** at least one `RemediationPolicy` targeting a `GitOpsRepository` | Switches the remediation engine to the `gitops-pr` strategy. The `RemediationPolicy` controller drives PR creation — `severityFilter` gates which incidents qualify, `maxConcurrentPRs` caps the number of open Zelyo PRs on the target repo. |

!!! note
`ZelyoConfig.spec.mode: protect` only flips the engine strategy from `dry-run` to `gitops-pr`. **No PRs are opened until you also create at least one `RemediationPolicy` that points at a `GitOpsRepository`.** See [GitOps Onboarding](gitops-onboarding.md) for the full setup.
Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ All three pieces are required — skipping any one of them means no PRs:
| --- | --- |
| `ZelyoConfig.spec.mode: protect` | Flips the remediation engine from `dry-run` to `gitops-pr`. Without this, plans are logged but never submitted. |
| `GitOpsRepository` | Tells Zelyo which repo, branch, and paths to write fixes into, and provides Git auth. |
| `RemediationPolicy` | The only controller that calls `GeneratePlan` + `ApplyPlan`. `severityFilter` gates which incidents qualify; `maxConcurrentPRs` caps PR submissions per reconcile cycle (not a global limit on open PRs). |
| `RemediationPolicy` | The only controller that calls `GeneratePlan` + `ApplyPlan`. `severityFilter` gates which incidents qualify; `maxConcurrentPRs` caps the number of open Zelyo PRs on the target repo — already-open PRs count against the budget, so new PRs only open when existing ones merge or close. The current count surfaces on `status.openPRs`. |

**0. Switch `ZelyoConfig` to Protect mode** (`ZelyoConfig` is cluster-scoped — no `-n` flag):

Expand Down Expand Up @@ -373,7 +373,7 @@ spec:
labels: ["security", "automated"]
branchPrefix: "zelyo/fix-"
severityFilter: high
maxConcurrentPRs: 3 # per reconcile cycle
maxConcurrentPRs: 3 # caps total open Zelyo PRs on the target repo
dryRun: false
autoMerge: false
```
Expand Down
Loading
Loading