feat(agents): route high risk through controlled automation
Some checks failed
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Failing after 1m8s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-26 18:52:19 +08:00
parent 717f0edd33
commit e0a86b6254
65 changed files with 733 additions and 516 deletions

View File

@@ -247,8 +247,23 @@ def _risk_level(state: dict[str, Any], plan: dict[str, Any]) -> str:
def _requires_human_approval(risk_level: str, plan: dict[str, Any]) -> bool:
action = json.dumps(plan, ensure_ascii=False).lower()
return risk_level in {"medium", "high", "critical"} or any(
marker in action for marker in ("restart", "scale", "deploy", "write", "terminate")
return risk_level == "critical" or any(
marker in action
for marker in (
"break-glass",
"secret",
"credential",
"authorization header",
"private key",
"drop database",
"truncate",
"delete pvc",
"delete namespace",
"force push",
"ref deletion",
"external attack",
"paid provider",
)
)