Secure Fix Handoff¶
Safe handoff of a security finding to a coding agent for patching.
Pre-conditions¶
- Finding eligible per
security-loop.mdcriteria. - Owner has authorized automated fix handoff for the repo.
- Authorization scope policy allows code changes for this target.
Allowed patch scopes¶
- Files explicitly named in the finding's
Affected component. - Files those depend on, only if cited in the remediation recommendation.
- New tests in the repo's standard test layout.
Anything outside these is rejected and triggers human escalation.
Required tests before merge recommendation¶
- The newly authored regression test reproducing the finding (red without patch).
- The same test green with patch applied.
- The repo's existing test suite green.
- A re-run of the security test plan in the sandbox green or downgraded severity.
Verifier review requirements¶
- The
verifiersubagent confirms the patch: - is within allowed scope,
- reproduces the finding pre-patch,
- resolves the finding post-patch,
- introduces no new high/critical findings.
- The
security-checklistskill runs against the patch diff.
Rollback path¶
If a patch:
- degrades functionality,
- introduces a new finding of equal-or-greater severity,
- causes test regressions,
- causes runtime instability,
then revert the patch on the sandboxed branch, mark the finding partial / iterate, and consult the security-loop iteration cap (default 3).
Coding agent constraints¶
- Operates in the bounded edit loop with verifier and tests required.
- May not access user-only secret store.
- May not exfiltrate target code.
- May not alter audit logs.
- Audit events:
fix_proposed,fix_applied,fix_revertedper attempt.
Approval gate¶
Final merge to a non-sandboxed branch requires explicit human approval. Until then, all work stays in the sandbox branch.