SSH Guard
Help the user install and enable the ssh-guard plugin from this repository.
Channel Compatibility
| Channel | Status |
|---|
| Telegram | ✅ Supported |
| Feishu |
✅ Supported |
| Mattermost | ✅ Supported |
| Weixin | ❌ Not Supported |
| Others | 🔍 Unverified |
Workflow
- 1. Confirm the target OpenClaw environment and config file location.
- Ask which approval language the user wants:
- Chinese:
index.zh-CN.ts
- English:
index.en.ts
- 3. Default to English if the user does not specify a language.
- Ensure the plugin directory is reachable from
plugins.load.paths. - Ensure
plugins.entries["ssh-guard"].enabled is true. - Check the current top-level
session.dmScope value first. - If it is already
per-channel-peer or per-account-channel-peer, keep it and skip the selection step. - Otherwise, tell the user
session.dmScope: "main" is not supported for this plugin in DM flows. - Ask the user to choose one of these top-level
session.dmScope values:
-
per-channel-peer
-
per-account-channel-peer
- 10. Explain the two choices as OpenClaw session-routing behavior first:
-
per-channel-peer: DM session key is
agent:<agentId>:<channel>:direct:<peerId>, so the same person gets a different DM session in each channel
-
per-account-channel-peer: DM session key is
agent:<agentId>:<channel>:<accountId>:direct:<peerId>, so DM sessions are separated by channel, receiving account, and person
- 11. Then explain the plugin recommendation separately:
- default to
per-channel-peer
- use
per-account-channel-peer when one channel has multiple accounts and they should not share DM session state
- 12. If the user has no preference, default to
per-channel-peer. - Explain whether the user should:
- point OpenClaw directly at this repository directory, or
- copy/symlink the files into an existing extensions directory
- 14. Remind the user to restart or reload OpenClaw after changing plugin config.
Language Selection
Use these entry files:
- -
index.zh-CN.ts: Chinese approval prompts and approval keywords - INLINECODE21 : English approval prompts and approval keywords
- INLINECODE22 : default entry and currently points to INLINECODE23
If the user wants Chinese prompts, either:
- - change the plugin entry to load
index.zh-CN.ts, or - change
index.ts to export INLINECODE26
If the user wants English prompts, keep the current default or point the entry to index.en.ts.
Installation Rules
- - Prefer using this repository as the single source of truth for the plugin.
- Do not describe the plugin as a generic policy skill first; it is primarily a publishable OpenClaw plugin repository.
- When updating
openclaw.json, make minimal changes:
- add top-level
session.dmScope if missing
- add the plugin directory to
plugins.load.paths if missing
- add
ssh-guard to
plugins.entries if missing
- set
enabled to
true unless the user explicitly wants it disabled
- - Use absolute paths in config examples.
- Preserve existing plugin entries and load paths.
- Do not offer
main as a valid choice for this plugin's DM setup flow. - Present
per-channel-peer and per-account-channel-peer as the recommended DM setup choices for this plugin. - If
session.dmScope is already per-channel-peer or per-account-channel-peer, do not ask the user to change it. - Explain that group sessions are unaffected because OpenClaw already routes groups as
agent:<agentId>:<channel>:group:<groupId>.
Default Config Shape
Show config updates in this form:
CODEBLOCK0
Repo Positioning
When the user asks what this repository is for, explain:
- - this repository is mainly for publishing and reusing the
ssh-guard plugin - the plugin blocks commands whose command text contains
ssh until the user explicitly approves them - the repository also includes language-specific entry files so deployments can choose Chinese or English approval prompts
- the plugin requires isolated top-level
session.dmScope for DM use, and should not be installed with INLINECODE45
Notes
- - Prefer direct, actionable installation guidance over re-explaining the internal approval state machine.
- If the user asks to install the plugin into another repo, update that repo’s config to reference this repository cleanly.
- If language preference is unknown and no surrounding context suggests otherwise, choose English by default and mention that Chinese is available.
📦 Repository: https://github.com/yanbo92/ssh-guard
SSH Guard
帮助用户安装并启用本仓库中的 ssh-guard 插件。
渠道兼容性
✅ 支持 |
| Mattermost | ✅ 支持 |
| 微信 | ❌ 不支持 |
| 其他 | 🔍 未验证 |
工作流程
- 1. 确认目标 OpenClaw 环境和配置文件位置。
- 询问用户所需的审批语言:
- 中文:index.zh-CN.ts
- 英文:index.en.ts
- 3. 如果用户未指定语言,默认使用英文。
- 确保插件目录位于 plugins.load.paths 可访问范围内。
- 确保 plugins.entries[ssh-guard].enabled 为 true。
- 首先检查当前顶层 session.dmScope 的值。
- 如果已经是 per-channel-peer 或 per-account-channel-peer,则保留该值并跳过选择步骤。
- 否则,告知用户该插件在私信流程中不支持 session.dmScope: main。
- 要求用户从以下顶层 session.dmScope 值中选择一个:
- per-channel-peer
- per-account-channel-peer
- 10. 首先解释这两个选项作为 OpenClaw 会话路由行为:
- per-channel-peer:私信会话键为 agent:
::direct:,因此同一个人在不同渠道中会获得不同的私信会话
- per-account-channel-peer:私信会话键为 agent::::direct:,因此私信会话按渠道、接收账户和人员分离
- 11. 然后单独说明插件推荐:
- 默认推荐 per-channel-peer
- 当一个渠道有多个账户且它们不应共享私信会话状态时,使用 per-account-channel-peer
- 12. 如果用户没有偏好,默认使用 per-channel-peer。
- 说明用户应该:
- 直接将 OpenClaw 指向本仓库目录,或
- 将文件复制/符号链接到现有的扩展目录中
- 14. 提醒用户在更改插件配置后重启或重新加载 OpenClaw。
语言选择
使用以下入口文件:
- - index.zh-CN.ts:中文审批提示和审批关键词
- index.en.ts:英文审批提示和审批关键词
- index.ts:默认入口,当前指向 index.en.ts
如果用户需要中文提示,可以:
- - 更改插件入口以加载 index.zh-CN.ts,或
- 更改 index.ts 以导出 index.zh-CN.ts
如果用户需要英文提示,则保留当前默认设置或将入口指向 index.en.ts。
安装规则
- - 优先使用本仓库作为该插件的唯一真实来源。
- 不要首先将该插件描述为通用策略技能;它主要是一个可发布的 OpenClaw 插件仓库。
- 更新 openclaw.json 时,进行最小化更改:
- 如果缺少顶层 session.dmScope,则添加
- 如果缺少插件目录,则添加到 plugins.load.paths
- 如果缺少 ssh-guard,则添加到 plugins.entries
- 将 enabled 设置为 true,除非用户明确要求禁用它
- - 在配置示例中使用绝对路径。
- 保留现有的插件条目和加载路径。
- 不要提供 main 作为该插件私信设置流程的有效选项。
- 将 per-channel-peer 和 per-account-channel-peer 作为该插件推荐的私信设置选项。
- 如果 session.dmScope 已经是 per-channel-peer 或 per-account-channel-peer,则不要要求用户更改。
- 说明群组会话不受影响,因为 OpenClaw 已经将群组路由为 agent:::group:。
默认配置格式
以以下形式展示配置更新:
json
session: {
dmScope: per-channel-peer
},
plugins: {
load: {
paths: [
/absolute/path/to/ssh-guard
]
},
entries: {
ssh-guard: {
enabled: true
}
}
}
仓库定位
当用户询问本仓库的用途时,说明:
- - 本仓库主要用于发布和复用 ssh-guard 插件
- 该插件会拦截命令文本中包含 ssh 的命令,直到用户明确批准
- 仓库还包含特定语言的入口文件,以便部署时可以选择中文或英文审批提示
- 该插件需要隔离的顶层 session.dmScope 用于私信使用,不应与 session.dmScope: main 一起安装
注意事项
- - 优先提供直接、可操作的安装指导,而不是重新解释内部审批状态机。
- 如果用户要求将插件安装到其他仓库,则更新该仓库的配置以干净地引用本仓库。
- 如果语言偏好未知且没有其他上下文提示,默认选择英文,并说明中文也可用。
📦 仓库地址:https://github.com/yanbo92/ssh-guard