DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Kubectl Guard — DeepSeek Harness 插件(DSH Plugin)
← Plugins
K

dsh-kubectl-guard

Kubectl Guard

一个 dsh 策略插件,根据 kubeconfig 上下文控制 kubectl 写入操作:在本地集群之外硬性拒绝不可逆动词,其余操作进行询问。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:gengwg/dsh-kubectl-guard#68a3a2edc01448a66444a9e10ab987fd63ae38d0
README兼容性版本

兼容性与来源证明

Kubectl Guard 以 dsh-kubectl-guard 发布,当前版本为 0.2.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/9/13

版本

0.2.1stable
2026/9/13
0.2.0stable
2026/9/7
0.1.2stable
2026/9/6

相关插件

正在加载相关插件…

最新版
0.2.1
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 1
周下载
0
最近提交
2026/9/16
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

README

dsh-kubectl-guard

A DeepSeek Harness policy plugin that gates kubectl by kubeconfig context.

Irreversible verbs against a non-local cluster are denied outright. Recoverable writes ask first. Reads and local clusters are untouched.

It registers no tools of its own — it inspects the command argument of shell tool calls, so it covers whatever the agent runs.

Install

Requires pnpm, which dsh plugin shells out to.

From npm:

dsh plugin --profile web add dsh-kubectl-guard

From source, if you want to hack on it:

git clone https://github.com/gengwg/dsh-kubectl-guard
cd dsh-kubectl-guard
dsh plugin --profile web add "$PWD"

Either way, activation is automatic: the package declares dsh.bundle, so dsh plugin add joins it to the profile's bundle stack. Restart dsh to load it.

Upgrading from 0.1.x, which installed as a plain dependency: delete the manual insert entry from ~/.dsh/profiles/<profile>/cordis.patch.yml. Bundle and user patch layers both apply, so leaving it in loads the guard twice.

Examples

Nothing to invoke. Ask the agent to do its normal work; the guard sits in the tool pipeline and inspects the shell command before it runs.

Blocked, with the cluster name replaced by a per-session pseudonym:

> delete the stuck nginx pod

Error: kubectl-guard: 'delete' is irreversible and ctx#4be1f92a is not a local
cluster. Denied.

Asked, so you approve it in the UI before it runs:

> roll out the new deployment

kubectl-guard: 'apply' writes to ctx#4be1f92a, which is not a local cluster.
[approve] [deny]

Untouched, because reads are not gated:

> what pods are failing in kube-system?

kubectl get pods -n kube-system --field-selector=status.phase!=Running
NAME         READY   STATUS             RESTARTS
api-7d9f8c   0/1     CrashLoopBackOff   14

Untouched, because the context is local:

> wipe the test namespace on my kind cluster

kubectl --context kind-dev delete ns test
namespace "test" deleted

Dry runs are reads, so they pass and give the agent a way to show you a change before asking for it:

kubectl apply --dry-run=server -f deploy.yaml     # allowed
kubectl apply -f deploy.yaml                      # asks

Turn the guard off for one session without editing config:

dsh web --patch <(echo '- id: kubectl-guard
  disabled: true')

Behavior

CommandNon-local contextLocal context
get, describe, logs, topallowallow
auth can-iallowallow
auth reconcileaskallow
config use-context, other mutating config subcommandsaskask
apply, patch, scale, execaskallow
delete, drain, evictdenyallow
scale --replicas=0denyallow
apply --prunedenyallow
replace --forcedenyallow
apply --dry-run=serverallowallow

A context is local only if it matches localContexts. Everything else, including a kubeconfig that cannot be read, is treated as production.

The context is resolved the way the shell would resolve it: an explicit --context wins, then --kubeconfig, then a KUBECONFIG= assignment written inline on the same command line, then the ambient environment. That last case matters -- without it, KUBECONFIG=/path/to/prod kubectl delete ... would be judged against whatever your shell happened to point at.

Config

config:
  localContexts: [minikube, 'kind-*', docker-desktop]
  binaries: [kubectl, k]
  guardedTools: [bash, pwsh]
  showContextNames: false

showContextNames is off by default: blocked-command messages go to the model, and therefore to the LLM provider. With it off the model sees a stable per-session pseudonym like ctx#4be1f92a instead of your cluster's name.

Failing closed

A gate that can be talked around is worse than none. Anything unparseable — sh -c, command substitution, an unterminated quote — is treated as a mutation: denied if the text contains an irreversible verb, asked otherwise. An unknown verb asks rather than allows.

What this is not

This gates a cooperative agent, not an adversary. It reads the command string the agent asked to run, so anything that hides the binary name from that string defeats it by construction -- $KUBECTL delete ... with the name only in the environment, a shell alias resolved at runtime, a base64 round-trip.

Indirection that still contains the literal name is caught: K=kubectl; $K delete pod foo is denied, because any $ expansion alongside a mention of a guarded binary makes the command opaque, and opaque plus an irreversible verb is a denial. But treat the guard as a seatbelt against a confused agent, not a sandbox against a hostile one. If you need the stronger property, take the credential away rather than filtering the command.

Limitations

  • Only kubectl. helm, argocd and flux are not covered; the verb table is data, so adding them is an edit to src/verbs.js.
  • Pass-through wrappers (sudo, time, nice, ...) are seen through, but only until a bare-token wrapper argument: timeout 30 kubectl delete ... is not gated, because 30 ends the wrapper chain.
  • current-context is read with a line-anchored regex, not a YAML parser. Unreadable or unmatched means production, so the failure direction is safe.
  • The pseudonym salt is per-process: ids are stable within a session, not across restarts.
  • Guards are synchronous, so the deny path does no I/O beyond a cached readFileSync.

Test

npm test

MIT.

相关插件

继续浏览 security-access 分类下经过校验的插件。

Doctor@linxin666/dsh-doctorDSH 配置档案的事务性救援模式,配备受监督的启动器、隔离的恢复容器、确定性修复、健康监控以及本地 Web 恢复控制台Mobiledsh-mobileDeepSeek Harness 移动端适配与安全访问插件,支持局域网、远程连接、Android App 和手机浏览器。DSCODE@toddzheng024/dscode-bundle完整的 DeepSeek 编码代理,支持持久化 shell、Ultra 协作和自动权限审查。Auto Reviewdsh-auto-review针对 DeepSeek Harness 审批请求的第二模型 AI 自动审查:只读审查子代理在审批应答链上决定允许或拒绝,并采用故障关闭回退机制和完整的会话日志审计。