Skip to content

Human-in-the-Loop Approvals (WaitingApproval)

Any MaintenancePolicy route that opens a Pull or Merge Request can set requireApproval: true to pause for operator sign-off before anything is pushed to the Git forge.

spec:
policy:
approvalTimeout: 24h
routes:
- name: open-rightsizing-pr
when: "output.action == 'patch'"
action: OpenPR
requireApproval: true
draft: true
labels:
- type/maintenance

spec.policy.approvalTimeout defaults to 24h. A background sweeper (--approval-sweep-interval, default 1m) expires overdue checkpoints automatically.

Checkpoint Lifecycle and Pre-Pause Sandbox Teardown

Section titled “Checkpoint Lifecycle and Pre-Pause Sandbox Teardown”
  1. Investigate, Edit, and Validate: Faber executes the ReAct loop, runs offline Tier 1 validation commands inside the ephemeral sandbox, and extracts the unified diff and changed file set operator-side in BeforeSandboxClose.
  2. Pre-Pause Sandbox Teardown: The SandboxClaim is deleted immediately before pausing. A paused WaitingApproval run holds zero sandbox pods and zero sandbox memory.
  3. Hard Diff Gates and Verifier: The controller evaluates hard diff policy gates (allowlist, denylist, file/line limits, secret scanner, protected workload rules) and runs the optional independent verifier model before requesting approval.
  4. Zstd Checkpoint Persistence: The verified output JSON, file changes, unified diff, validation results, artifact IDs, matched routes, and exact token/USD usage are saved as a zstd-compressed RunCheckpoint in the backing store (SQLite or PostgreSQL).
  5. Notification and Pause: The RemediationRun enters phase WaitingApproval, emits an approval.requested audit event and SSE event, and dispatches configured notifications (Matrix, webhook, Slack, Discord, or Apprise) with a deep link to https://faber.example.com/runs/<run-id>.

Operators can act on a WaitingApproval checkpoint from four interfaces:

Open the run detail page (https://faber.example.com/runs/<run-id>), inspect the syntax-highlighted unified diff, validation log, and verifier verdict, enter an optional comment, and click Approve or Reject.

Terminal window
faberctl runs list --phase WaitingApproval
faberctl runs diff <run-id>
faberctl runs approve <run-id> --actor jan --comment "verified memory bounds"
faberctl runs reject <run-id> --actor jan --comment "too aggressive on ingress pod"
Terminal window
curl -X POST https://faber.example.com/api/v1/runs/<run-id>/approve \
-H "Authorization: Bearer $FABER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"comment":"looks good"}'
curl -X POST https://faber.example.com/api/v1/runs/<run-id>/reject \
-H "Authorization: Bearer $FABER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"comment":"skip this workload"}'

Patching the RemediationRun CR directly also wakes the reconciler (via remediationRunEventPredicate passing approval-decision annotation updates):

Terminal window
kubectl -n faber annotate remediationrun <name> \
faberops.dev/approval-decision=approved \
faberops.dev/approval-actor=jan \
faberops.dev/approval-comment="approved via kubectl"

When native authentication is enabled (--auth-mode=oidc or --auth-mode=k8s) or trusted reverse-proxy headers are configured (auth.trustedProxy.*), the HTTP API ignores any caller-supplied actor field in the JSON body and stamps decidedBy unconditionally from the verified principal subject. Every decision is written to the immutable audit log (approval.decided) with the verified actor, timestamp, outcome, and comment.

For per-policy ownership ACLs (OwnerACLConfig), separation of duties (requireDistinctApprover), multi-approver quorums (minApprovals), and opt-in ValidatingAdmissionPolicy enforcement on kubectl annotate, see Ownership ACLs, Multi-Approval Quorums, and Verified Identity.

  • Approved: RemediationRunReconciler loads the checkpoint before settle/LLM/sandbox logic, re-runs the hard diff policy gates as defense-in-depth, commits the verified diff to the configured forge, opens or updates the PR/MR, and marks the run Succeeded with zero extra LLM turns and zero sandbox claims.
  • Rejected: The run transitions to Skipped (approval rejected) and stores the operator’s comment as a Layer 3 lesson so subsequent runs on the same target avoid repeating the rejected proposal.
  • Expired: Once expiresAt passes, the approval sweeper transitions the checkpoint to Expired and closes out the run cleanly without opening a PR.