Automate regression-tested security patch PRs

Wire confirmed security findings to durable remediation automations on POST /v1/auto/automations backed by zen6-coder and human review gates.

Shrink mean-time-to-remediate from weeks to minutes without sacrificing human merge control. Pair confirmed reproducers with zen6-coder inside a review-gated automation.

Architecture & contract

The automation checks out an isolated branch, verifies the reproducer fails on base, authors the smallest fix, runs the full test suite plus POST /v1/security/scans, and pauses at review for security sign-off.

Primary endpoint: POST /v1/auto/automations · Status: shipped · Level: specialist

Run it across all four surfaces

hanzo auto automations create --data '{
  "name": "SecOps minimal patcher",
  "instructions": "Confirm failing security test, write minimal fix, run full test suite and secret scan, open draft PR.",
  "model": "zen6-coder",
  "permissions": "ask"
}'
import { Configuration, AutoApi } from 'hanzoai';

const auto = new AutoApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await auto.postAutoAutomations({
  name: 'SecOps minimal patcher',
  instructions: 'Confirm failing security test, write minimal fix, run full test suite and secret scan, open draft PR.',
  model: 'zen6-coder',
  permissions: 'ask',
});
console.log(data);
import os
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AutoApi

api = AutoApi(ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"])))
print(api.post_auto_automations({
    "name": "SecOps minimal patcher",
    "instructions": "Confirm failing security test, write minimal fix, run full test suite and secret scan, open draft PR.",
    "model": "zen6-coder",
    "permissions": "ask",
}))
curl -s -X POST https://api.hanzo.ai/v1/auto/automations \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "SecOps minimal patcher",
    "instructions": "Confirm failing security test, write minimal fix, run full test suite and secret scan, open draft PR.",
    "model": "zen6-coder",
    "permissions": "ask"
  }' | jq '.'
curl -s -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "auto",
      "arguments": {"op": "get_auto_automations", "input": {}}
    }
  }'

Verify the outcome

  • Trigger a test run and verify it holds for review instead of pushing directly to main.

Production guardrails

  • Require an explicit passing regression test AND security team sign-off before merging any auth or crypto patch.

Next steps & Hanzo University

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.
Last updated Nov 25, 2026