给 Grok Bot 接入 TypeSafe Jev 路由 skill:先 shadow 一周再放行,保留 kill switch
作者教程:用 6 段可复制指令让 Grok Bot 装 TypeSafe SDK、写 router 模块和 skill,先 shadow 模式只记日志一周,再切 active,并保留两个 kill switch
- 给谁
- 已在用 Grok Bot 跑例行任务、常遇到重复重试或重复调研,想加一层「下一步该不该做」判断的进阶用户(需会看 Python 和日志)
- 你会得到
- 得到一个 jev-usage-router skill:在开浏览器、调研、重试和再开 Bot 前先问 Jev,五选一返回 proceed / reuse_cache / stop_retry / research_capped / ask_human,并把每次决策写进 decisions.jsonl。作者未给出量化节省数字,要求读者用自己的流量对比 shadow 周与 active 周
- 你需要
- Grok Bot · TypeSafe Jev(typesafe-sdk)
硬约束
TypeSafe 控制台建 API key → 用掩码密钥流程放进云电脑环境变量 → 装 SDK 跑冒烟 → 让 Bot 写 router.py(只发四个字段给 Jev)→ 建 skill → shadow 模式跑一周读分歧 → 切 active,保留「bypass jev」与 enabled:false 两个 kill switch。
他们做了什么
作者发现 Grok Bot 常重复同样的失败重试,于是把 TypeSafe 的 System One 模型 Jev 接成一个路由 skill,在昂贵步骤前先做五选一判断,并公开了全部指令。
效果如何
作者称这是自己做过最好的 Agent,但文中没有给出节省的具体数字,明确说「用你自己的流量去量,别信任何人的数字,包括我的」。
值得知道
每个账号一台云电脑,key 对所有 Bot 可见;每个 routine 只留 20 条运行记录;用量并非无限,路由只能减少昂贵动作。Jev 按输入 token 计费(TypeSafe 文档),需自备 API key。
步骤
建 API key
在 TypeSafe 控制台创建 API key。作者要求:不要放进聊天、仓库或任何你打算分享的 skill。
用掩码流程把 key 放上云电脑
把下面这段发给 Grok Bot,走掩码密钥请求流程,key 不经过聊天。注意(原文):每个账号只有一台云电脑,你跑的每个 Bot 都能看到同样的文件、会话和登录,放上去的 key 对所有 Bot 可读。
搭建指导 · 来源原文。交给协助搭建的 Agent;不是节点运行指令。
I need to give you an API credential for TypeSafe. Use the masked secret request flow, not chat. The value must land as the environment variable TYPESAFE_API_KEY on your computer, and it must not appear in any file, log, skill or repo you create. Confirm back only that the variable is set and readable, never its value.
装 SDK 并冒烟测试
让 Bot 安装 typesafe-sdk 并写 /work/jev/smoke.py 发一次 Choice。输出里要看到三样:你自己列表中的一个值、概率分布、一个置信度数字;缺任何一样,说明 SDK 连的不是它。
搭建指导 · 来源原文。交给协助搭建的 Agent;不是节点运行指令。
On your computer, run: pip install typesafe-sdk Then write /work/jev/smoke.py that opens TypeSafeClient(model="jev-latest") and sends one system_one call with a single Choice question. State: "goal: file a support ticket. task: routing. last error: none x0". Criteria: billing, technical, sales. Run it and show me the raw response object: the choice, the probabilities and the confidence. If TYPESAFE_API_KEY is missing, stop and tell me, do not hardcode anything.
写 router 模块
让 Bot 按规格写 /work/jev/router.py:只把 goal、task_type、last_error、repeats 四个字段作为 state 发给 Jev(不发提示词、仓库或对话),五个选项写死,每次调用追加到 decisions.jsonl,行为读 config.json,默认关闭;运行前先给你看文件。原文附 Python 调用片段可对照。
搭建指导 · 来源原文。交给协助搭建的 Agent;不是节点运行指令。
Build a router module at /work/jev/router.py with one function: route(goal: str, task_type: str, last_error: str, repeats: int) -> dict It sends exactly those four fields to Jev as the state, with one Choice question named "action" and these criteria: proceed nothing suggests the next step will fail reuse_cache a fresh artifact for this already exists stop_retry the same approach failed the same way research_capped enough sources are already gathered ask_human the step sends, publishes, pays or deletes Return the choice, the confidence and the probabilities. Append every call to /work/jev/decisions.jsonl with a timestamp, the four inputs and the full response. Read behaviour from /work/jev/config.json with two keys: "enabled" and "mode" ("shadow" or "active"). Default to enabled false. No prompt text in the state beyond those four fields. Show me the file before you run it.搭建指导 · 来源原文。交给协助搭建的 Agent;不是节点运行指令。
from typesafe_sdk import Choice, TypeSafeClient with TypeSafeClient(model="jev-latest") as client: # reads TYPESAFE_API_KEY r = client.system_one( state=f"goal: {goal}\ntask: {task_type}\nlast error: {err} x{repeats}", questions={ "action": Choice( instructions="What should the agent do next", criteria={ "proceed": "Nothing suggests the next step will fail", "reuse_cache": "A fresh artifact for this already exists", "stop_retry": "The same approach failed the same way", "research_capped": "Enough sources are already gathered", "ask_human": "The step sends, publishes, pays or deletes", }, ) }, ) print(r.choices["action"].choice, r.choices["action"].confidence)建 skill「jev-usage-router」
触发点:任何浏览器会话、调研、失败重试之前,以及再开一个 Bot 之前;按返回的五种动作执行,ask_human 无论置信度多高都不能被覆盖。作者提醒:skill 的权威副本放在你自己的版本库,Grok Bot 每个 routine 只保留最近 20 条运行记录。
运行提示词 · 来源原文。使用前确认粘贴位置、输入变量及输出格式。
Create a skill called jev-usage-router. Trigger: before any browser session, any research pass, any retry of a failed step, and before spawning an extra bot. Steps: call route() from /work/jev/router.py with the current goal, the task type, the text of the last error and how many times it repeated. Then honour the action: proceed continue as planned reuse_cache use the existing artifact, skip the work stop_retry abandon this approach and report why research_capped stop at 5 sources and write up what you have ask_human pause and ask me, do not proceed on your own Approval boundary: ask_human is never overridden, whatever the confidence. Output: one line per decision in the run report.
shadow 模式跑一周
设 {"enabled": true, "mode": "shadow"}:每个触发点都调用并记日志,但照原样做事;每天把调用数、动作分布、平均置信度和分歧写入 report.md。作者理由:便宜的判断器也会错,例如 stop_retry 可能拦掉第四次本可成功的尝试;少于一周样本太小。
运行提示词 · 来源原文。使用前确认粘贴位置、输入变量及输出格式。
Set /work/jev/config.json to {"enabled": true, "mode": "shadow"}. In shadow mode, call the router at every trigger and log the decision, then ignore it and do what you would have done anyway. Change nothing about how you work. At the end of each day, append to /work/jev/report.md: how many calls, the action split, the mean confidence, and every case where the logged action disagreed with what you actually did.切 active,保留 kill switch
读完日志再切 active:开始执行决策,但 ask_human 仍暂停等你;两个 kill switch 始终可用(任一消息里写「bypass jev」,或 config 设 enabled:false),决策日志照旧写。作者建议先只路由那一个总在同样失败上重试的 routine。
运行提示词 · 来源原文。使用前确认粘贴位置、输入变量及输出格式。
Set mode to "active". From now on, honour the action instead of logging it. Two kill switches stay available to me at all times: 1. "bypass jev" in any message, which ignores the router for that run 2. {"enabled": false} in config.json, which disables it entirely ask_human still pauses for me. Keep writing decisions.jsonl exactly as before.
可复制提示词
运行提示词 · 来源原文。使用前确认粘贴位置、输入变量及输出格式。
这一段是提示词,页面不会在这里插入广告。
Create a skill called jev-usage-router. Trigger: before any browser session, any research pass, any retry of a failed step, and before spawning an extra bot. Steps: call route() from /work/jev/router.py with the current goal, the task type, the text of the last error and how many times it repeated. Then honour the action: proceed continue as planned reuse_cache use the existing artifact, skip the work stop_retry abandon this approach and report why research_capped stop at 5 sources and write up what you have ask_human pause and ask me, do not proceed on your own Approval boundary: ask_human is never overridden, whatever the confidence. Output: one line per decision in the run report.
作者文章第 5 步 skill 原文(英文,未翻译、未改标点)。中文大意:建 jev-usage-router skill,在浏览器会话、调研、重试、再开 Bot 前调用 route(),按 proceed/reuse_cache/stop_retry/research_capped/ask_human 执行;ask_human 永不被覆盖;每个决策在运行报告里写一行。
来源
How To Wire Jev Into Grok Bot: The Best Agent I've Built · 0x_rody(rody) · X · 2026-10-20T14:57:31.000Z
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。