Use the kill switch
One field cuts an agent off. Optionally it also stops the agent and revokes its dynamic Vault credentials.
kubectl leash freeze claude-agent -n agentsOr set it yourself:
kubectl -n agents patch agentpolicy claude-agent --type merge -p '{"spec":{"frozen":true}}'What happens
- All egress from the agent pods is denied, DNS included. On Cilium this
overrides every other policy; with the NetworkPolicy fallback, other policies
that allow egress still apply (the policy’s
EgressWidenedcondition says so). - Each linked AgentIdentity’s Vault entity is disabled, so its tokens are rejected.
- The policy reports
FrozenwithfrozenAt, and the operator writes apolicy.freezeaudit line.
Stop the agents too
spec: frozen: true onFreeze: scaleToZero: trueOr kubectl leash freeze claude-agent -n agents --scale-to-zero.
The Deployments and StatefulSets that own the agent pods are scaled to zero.
Their replicas are recorded in status.scaledDown and in a
leash.simplyzee.dev/replicas-before-freeze annotation on each workload.
Unfreezing gives them back, unless someone has already scaled one up by hand.
- Leash re-checks every 30 seconds, so a GitOps sync that scales an agent back up is undone while it’s frozen. Egress stays cut either way.
- Pods without a Deployment or StatefulSet (Jobs, bare pods) keep running,
isolated, and the
Readymessage says how many. - Deleting a frozen policy leaves its workloads at zero. The annotation says what they had.
Revoke dynamic credentials
Disabling the entity stops the agent’s Vault tokens, but database passwords and cloud keys it was already issued stay valid until their lease ends. List their lease prefixes on the AgentIdentity to revoke them on freeze:
spec: vault: secretPaths: [database/creds/claude-agent] revokeOnFreeze: [database/creds/claude-agent]The operator’s Vault token needs extra rights for exactly those prefixes. See Revoking dynamic credentials.
Release it
kubectl leash unfreeze claude-agent -n agents