Skip to content

kubectl leash

A kubectl plugin for the everyday Leash jobs: see what agents are doing, stop one now, and answer a held tool call.

Install

With Krew (once it’s in the Krew index):

Terminal window
kubectl krew install leash

Until then, install straight from the manifest in this repo:

Terminal window
kubectl krew install --manifest-url=https://raw.githubusercontent.com/simplyzee/leash/main/hack/krew/leash.yaml

From a release (Linux, macOS, Windows; amd64 and arm64):

Terminal window
VERSION=v0.2.0
OS=$(uname -s | tr A-Z a-z); ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
curl -sL "https://github.com/simplyzee/leash/releases/download/${VERSION}/kubectl-leash_${VERSION}_${OS}_${ARCH}.tar.gz" | tar -xz kubectl-leash
sudo mv kubectl-leash /usr/local/bin/
kubectl leash version

Or with Go: go install github.com/simplyzee/leash/cmd/kubectl-leash@latest.

Checksums are in kubectl-leash_<version>_checksums.txt on the release.

Commands

Terminal window
$ kubectl leash status -n agents
NAME PHASE BACKEND TOKENS TODAY AGENTS APPROVALS NOTES
claude-agent Enforced cilium 500k / 2M (25%) 3 1 pending
codex Frozen cilium - 0 - frozen since 2026-11-28 11:00Z
$ kubectl leash runs -n agents --policy claude-agent
POD POLICY PHASE TOKENS MODEL CALLS TOOL CALLS DENIED APPROVED LAST ACTIVITY LAST DENIAL
claude-agent-7d9f8b6c4d-x2lqp claude-agent Running 48.2k 37 12 2 1/1 30s ago github/delete_repo: tool "delete_repo" is denied…
$ kubectl leash approvals -n agents
NAME POD TOOL ARGUMENTS WAITING STATE
merge-pull-request-x7k2p claude-agent-7d9f8b6c4d-x2lqp github/merge_pull_request {"pr":42} 1m ago expires in 4m
$ kubectl leash approve merge-pull-request-x7k2p -n agents
Approved github/merge_pull_request for claude-agent-7d9f8b6c4d-x2lqp (merge-pull-request-x7k2p)
$ kubectl leash deny merge-pull-request-x7k2p -n agents --reason "not on a Friday"
$ kubectl leash freeze claude-agent -n agents
AgentPolicy claude-agent is Frozen: all egress from its agents is denied (cilium network policy).
AgentIdentity claude-agent is Frozen: its Vault entity is disabled, so tokens it already issued are rejected.
$ kubectl leash unfreeze claude-agent -n agents
Command What it does
status Every AgentPolicy: phase, network backend, today’s tokens against the budget, running agents, pending approvals, and anything wrong (frozen, budget spent, degraded rules).
runs [--policy P] AgentRuns, most recently active first.
approvals [--all] Tool calls waiting for a human. --all includes decided and expired ones.
approve NAME, deny NAME Decide a held call. --reason is recorded on the ToolApproval and, for a denial, returned to the agent. A decision is final.
freeze POLICY, unfreeze POLICY Flip the kill switch and wait until the operator reports Frozen or Enforced (--wait=false to return at once, --timeout 60s).

Every command takes the usual -n/--namespace, --context and --kubeconfig; status, runs and approvals also take -A/--all-namespaces.

Permissions

The plugin uses your kubeconfig, so normal RBAC applies:

  • read-only (status, runs, approvals): get and list on agentpolicies, agentruns and toolapprovals
  • approve and deny: patch on toolapprovals
  • freeze and unfreeze: patch on agentpolicies

Kubernetes RBAC can’t limit patch to one field, so whoever can freeze a policy can also edit its allowlist.