Command replay (a class of call, not one reported incident)
Stop an agent trying to delete a Kubernetes namespace
What happens
kubectl delete of the production namespace. The call below tries to delete a Kubernetes namespace. The agent sends it through its Bash tool, and it involves Kubernetes.
The call
kubectl delete namespace production
Tool: Bash. The replay uses placeholder tokens and hosts only.
Fix it without us
Namespaces are cluster-scoped, so do not bind the agent to a ClusterRole that allows delete on namespaces (check the ClusterRoleBindings too), or give it a kubeconfig for a development cluster only. Check the result with kubectl auth can-i delete namespaces --as=system:serviceaccount:NAMESPACE:NAME.
What KYA does
Replay result: Stopped. In the replay test, the local hook denies the call and names the rule.
Rule k8s-delete-ns, first stopped in version 0.33.0.
The hook is local and advisory. It fails open: if kya breaks or times out, the call goes ahead.
Install
For Claude Code, the host this replay ran on:
/plugin marketplace add The-Pixel-Boys/shield-kya
/plugin install kya@shield-kya
For any host:
npm i -g @shield-agent/kya@latest && kya start