好文集ChatGPT Plus¥119

How To Wire Jev Into Grok Bot: The Best Agent I've Built

文章目录

Grok Bot gives every user one cloud computer and lets bots run shell on it. Most people point it at tasks and watch it retry the same failure.

You add one router skill, leave it logging for a week before it can act, and keep a kill switch.

Wire it right and the retries stop before they cost you anything.

Here's the full setup 👇

Before we dive in, I publish the full guides on my Substack: https://zodchiii.substack.com/ 🧠

文章配图

What Jev returns as an answer

Jev is TypeSafe's System One model. It answers with a typed value instead of prose, and it ships three primitives:

  • Choice picks one option from a list you define, and returns choice, probabilities and confidence

  • Score rates the state against a rubric

  • Noul answers whether a statement is true, as a number from 0 to 1

Because the answer comes back as a value, you can log it, diff two weeks of decisions against each other and replay them over yesterday's traffic.

The call looks like this:

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)

The router picks one of those five and has no way to answer anything else.

Step 1: get the API key

Open your TypeSafe dashboard and create an API key. Keep it out of chat, out of the repo and out of any skill you plan to share.

Step 2: get the key onto the computer

Use the masked secret request flow. The key never goes through chat.

One thing to know before you add it: your Grok Bot cloud computer is a single machine per account, and every bot you run on it sees the same files, sessions and logins. The key you put there is readable by all of them.

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.

Step 3: install the SDK and smoke test it

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.

You are looking for three things in the output: a value from your own list, a probability spread, and a confidence number. If any of those is absent, the SDK is talking to something else.

Step 4: build the router

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.

文章配图

Those four fields are the whole state Jev sees. It never gets your prompt, your repo or your conversation, so the call stays small and the log stays readable.

文章配图

Step 5: add the skill

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.

Keep the authoritative copy of that skill in your own source control. Grok Bot keeps only the 20 most recent run records per routine, so push anything you care about into your own storage as it happens.

Step 6: run it in shadow for a week

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.

Shadow mode exists because a cheap judge can be wrong. Read the log for the disagreements. If stop_retry fires on an approach that would have worked on the fourth attempt, you want to know that before it is allowed to act.

A week of real traffic is enough to read. Anything shorter and the sample is too small to tell you much.

文章配图

Step 7: go active, but keep the kill switch

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.

Keep logging after you flip. The log is how you tell a router that saves you money from one that quietly stops work it should have finished.

What to route first

Start with the one routine that keeps retrying, and leave the rest of your setup alone.

The routines worth routing first have one thing in common: the agent does not know what it already knows. It re-opens a browser for a file sitting on disk, reads a fourteenth source when five answered the question, or tries the same approach a third time because nothing told it the second one failed for the same reason.

Pick one, run it in shadow, and read the log before you expand.

What it costs

A Jev call carries four short fields, so it stays small. Each one buys you the option to skip an expensive step: a browser session, a research pass, an extra bot, a retry.

Measure it on your own traffic rather than taking anyone's number, including mine. Log the decision, log the step you skipped, and compare a shadow week against an active week.

Some limits to remember about

  • One computer per account. Every bot you run sees the same files and logins, so keep anything you would not hand to all of them off that machine.

  • Twenty run records per routine. Push anything you care about into your own storage.

  • Usage is still not unlimited. The router reduces expensive moves, and it does not remove the ceiling.

So what do you end up with?

Grok Bot does the thinking and the work, Jev answers with one of five actions, and you keep the final say on anything that cannot be undone.

Start with the routine that keeps failing the same way, run it in shadow for a week, then flip it.

Thanks for reading!

Full guides and the rest of the series: https://zodchiii.substack.com/

全文完
查看原文

沿着这个主题继续读

从一篇文章,找到相关的教程、经验和阅读路径。

JevJev 入门与使用方法,从任务表达、结果评价到 Codex 和 Claude Code 接入。Grok BotGrok Bot 开通、环境配置与多 Bot 协作,从入门到搭建自己的 Agent 团队。