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
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:
@@ -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",
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user