安全扫描
OpenClaw
可疑
medium confidence该技能基本实现了描述的功能(通过 TokenRouter 生成图像),但存在不一致和潜在风险的指令(未声明所需的 API key、读取 agent 配置文件、建议用户将密钥粘贴到聊天中),用户安装前需了解。
评估建议
该技能按描述实现了 TokenRouter 图像生成,但安装前请注意三点:
1) 包元数据未声明需要 TokenRouter API key——脚本会查找 PBD_TOKENROUTER_API_KEY 或 --api-key,也会尝试读取 ~/.openclaw/openclaw.json 自动获取 key;
2) 勿按 README 建议把 API key 粘进聊天,这会泄露密钥到聊天记录和 agent;请在 shell 中设置 PBD_TOKENROUTER_API_KEY 或在安全位置配置;
3) 脚本会把图像写入 ~/.openclaw/media/outbound,并将图像字节和 API key 发送至 https://api.tokenrouter.com——仅在你信任 TokenRouter 并接受网络访问时继续。若需更高保障,请作者:
a) 更新技能元数据声明所需环境变量;
b) 移除或明确警告勿在聊天贴 key;
c) 明确说明从 ~/.openclaw/openclaw.json 读取哪些字段。
接受以上注意事项,则功能可用;否则视为潜...详细分析 ▾
ℹ 用途与能力
代码与 SKILL.md 实现了 TokenRouter 图像生成与编辑,并按描述调用了 https://api.tokenrouter.com/v1/chat/completions,符合声明用途。然而,技能元数据未声明任何必需环境变量或主凭证,而 SKILL.md 与脚本均需要 TokenRouter API 密钥(PBD_TOKENROUTER_API_KEY)或 --api-key。声明需求中的遗漏构成不一致。
⚠ 指令范围
运行时指令和脚本会读取 ~/.openclaw/openclaw.json 以自动检测 API key,在 ~/.openclaw/media/outbound 下创建并写入文件,并将图像数据(base64)发送至外部 TokenRouter 端点。SKILL.md 还明确提示用户可把 API key 粘贴到聊天中供 agent 传给脚本——这会鼓励将密钥泄露给 agent,并可能导致密钥被记录/保存在聊天记录中。虽然读取 openclaw.json 并使用 ~/.openclaw 路径与 OpenClaw skill 一致,但 SKILL.md 赋予 agent 从多处(arg/env/config)获取 key 的广泛自由,增加了暴露风险。
✓ 安装机制
This is an instruction-only 技能 with a small 辅助工具 script; there is no 安装 spec and nothing is 下载ed or 安装ed. Risk from 安装 mechanism is low.
⚠ 凭证需求
The script reasonably needs a 令牌路由r API key to call the 服务, but the 技能 metadata does not declare this required 环境 variable. The script also reads ~/.OpenClaw/OpenClaw.json to find APIKey values, which could expose stored 提供者 凭证s if present. 添加itionally, 技能.md recommends pasting the API key into chat — that practice is disproportionate from a secrecy standpoint because it encourages exposing a secret to the 代理 and chat 记录s rather than 设置ting a local env var or 安全 secret storage.
✓ 持久化与权限
always: false and there is no 安装-time modification of other 技能s or 系统-wide 设置tings. The 技能 writes 输出 images to the OpenClaw media folder (expected behavior) and 运行s as-invoked. No elevated persistence or cross-技能 config changes are present.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.0.22026/4/21
- 添加ed a 列出 of 添加itional supported image 模型s (OpenAI and Google) in the 模型 + Image Config section, including explicit 模型 IDs. - Marked `google/gemini-2.5-flash-image` as the default/recommended 模型. - Clarified that users may 请求 a 模型 switch using the 列出ed 令牌路由r-supported 模型s. - No changes to script functionality or interface—documentation only.
● 无害
安装命令
点击复制官方npx clawhub@latest install tokenrouter-images
镜像加速npx clawhub@latest install tokenrouter-images --registry https://cn.longxiaskill.com镜像同步中
技能文档
PBD_TOKENROUTER_API_KEY环境变量- 从当前 agent 的 tokenrouter 提供者配置中自动检测(
~/.openclaw/openclaw.json) ### 若未找到 API key 运行脚本前,先检查 key 是否可用: ``bash test -n "$PBD_TOKENROUTER_API_KEY" && echo "Key found" || echo "No key"`若以上来源均无效,切勿运行脚本,而是引导用户获取 key: 1. 告知用户需要 TokenRouter API key。 - 指引其打开:https://www.tokenrouter.com
- 步骤:
- 注册或登录
- 登录后进入 API Keys 页面
- 创建新 key 并复制
- 用户拿到 key 后,提供两种方式:
- A — 直接给 agent: 用户粘贴 key,agent 通过 --api-key 传给脚本,最快。
- B — 配置环境变量(持久):
- 仅当前会话: export PBD_TOKENROUTER_API_KEY="sk-xxx..."
- zsh 持久: 将 export 行加入 ~/.zshrc 后 source ~/.zshrc
- bash 持久: 将 export 行加入 ~/.bashrc 后 source ~/.bashrc
key 就绪后,继续执行生成命令。 重要: 切勿跳过检查。无有效 key 将报错Error: No API key provided或HTTP 401/403。 ### 可选归因头(可选) ---site-url或PBD_TOKENROUTER_SITE_URL--app-name或PBD_TOKENROUTER_APP_NAME## 模型与图像配置 ---model必填(脚本无默认)默认 / 推荐:google/gemini-2.5-flash-image- 其他支持的图像模型(用户可要求切换):
- openai/gpt-5-image
- openai/gpt-5-image-mini
- google/gemini-3-pro-image-preview
- google/gemini-3.1-flash-image-preview
--aspect-ratio对应image_config.aspect_ratio(如1:1、16:9)--image-size对应image_config.image_size(1K、2K、4K) 注:TokenRouter 文档将aspect_ratio与image_size列为常用图像配置字段。不同提供者/模型可能支持额外字段(如 Sourceful 特性)。请求失败时,移除不支持的选项或换模型。 注:脚本始终发送modalities: ["image", "text"]。纯图像模型(部分 FLUX 变体)可能拒绝;若使用非 Gemini 模型报错,可能因此。当前 CLI 无规避参数。 ## 默认工作流(草稿 → 迭代 → 终稿) 目标:先快速迭代,再花时间在高质量设置。 - 草稿:小尺寸 / 快模型
- --image-size 1K
- 迭代:微调提示并每次换新文件名
- 终稿:大尺寸或更高质量(若模型支持)
- 例:--image-size 4K --aspect-ratio 16:9 ## 预检 + 常见失败 - 预检:
- command -v uv
- API key 检查(关键): 脚本会尝试 --api-key`