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):
kubectl krew install leashUntil then, install straight from the manifest in this repo:
kubectl krew install --manifest-url=https://raw.githubusercontent.com/simplyzee/leash/main/hack/krew/leash.yamlFrom a release (Linux, macOS, Windows; amd64 and arm64):
VERSION=v0.2.0OS=$(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-leashsudo mv kubectl-leash /usr/local/bin/kubectl leash versionOr with Go: go install github.com/simplyzee/leash/cmd/kubectl-leash@latest.
Checksums are in kubectl-leash_<version>_checksums.txt on the release.
Commands
$ kubectl leash status -n agentsNAME PHASE BACKEND TOKENS TODAY AGENTS APPROVALS NOTESclaude-agent Enforced cilium 500k / 2M (25%) 3 1 pendingcodex Frozen cilium - 0 - frozen since 2026-11-28 11:00Z
$ kubectl leash runs -n agents --policy claude-agentPOD POLICY PHASE TOKENS MODEL CALLS TOOL CALLS DENIED APPROVED LAST ACTIVITY LAST DENIALclaude-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 agentsNAME POD TOOL ARGUMENTS WAITING STATEmerge-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 agentsApproved 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 agentsAgentPolicy 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):getandlistonagentpolicies,agentrunsandtoolapprovals approveanddeny:patchontoolapprovalsfreezeandunfreeze:patchonagentpolicies
Kubernetes RBAC can’t limit patch to one field, so whoever can freeze a policy
can also edit its allowlist.