Skip to content

Use the kill switch

One field cuts an agent off. Optionally it also stops the agent and revokes its dynamic Vault credentials.

Terminal window
kubectl leash freeze claude-agent -n agents

Or set it yourself:

Terminal window
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 EgressWidened condition says so).
  • Each linked AgentIdentity’s Vault entity is disabled, so its tokens are rejected.
  • The policy reports Frozen with frozenAt, and the operator writes a policy.freeze audit line.

Stop the agents too

spec:
frozen: true
onFreeze:
scaleToZero: true

Or 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 Ready message 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

Terminal window
kubectl leash unfreeze claude-agent -n agents