Grok BotWorkPlanningAI score · 72/100X

Wire TypeSafe Jev into Grok Bot as a router skill: shadow for a week, then go active with a kill switch

Author’s tutorial: six copy-paste instructions get Grok Bot to install the TypeSafe SDK, build a router module and a skill, log-only shadow mode for a week, then active mode with two kill switches

ExperiencedStepsPromptWorkflow
Who
Grok Bot users running routines that keep retrying the same failure or over-researching, who can read Python and logs
You get
A jev-usage-router skill that asks Jev before browser sessions, research passes, retries and extra bots, returns one of proceed / reuse_cache / stop_retry / research_capped / ask_human, and logs each decision to decisions.jsonl. The author gives no savings numbers and tells readers to compare a shadow week with an active week on their own traffic
You need
Grok Bot · TypeSafe Jev(typesafe-sdk)

Constraints

Create a TypeSafe API key → put it on the cloud computer via the masked secret flow → install the SDK and smoke-test → have the bot write router.py (only four fields go to Jev) → create the skill → run shadow mode for a week and read the disagreements → switch to active, keeping “bypass jev” and enabled:false as kill switches.

What they did

Seeing Grok Bot retry the same failures, the author wired TypeSafe’s System One model Jev in as a router skill that makes a five-way call before expensive steps, and published every instruction.

How it went

The author calls it the best agent he has built but gives no concrete savings, saying to measure on your own traffic rather than trust anyone’s number, including his.

Worth knowing

One cloud computer per account, so the key is visible to every bot; 20 run records per routine; usage is still capped and the router only reduces expensive moves. Jev is billed per input token (TypeSafe docs) and needs your own API key.

Steps

  1. Create the API key

    Create an API key in the TypeSafe dashboard. The author: keep it out of chat, out of the repo and out of any skill you plan to share.

  2. Masked flow onto the computer

    Send the block below to Grok Bot so the key goes through the masked secret request flow, not chat. Note from the article: there is one cloud computer per account and every bot sees the same files, sessions and logins, so the key is readable by all of them.

    Setup guidance · Source text。Give to a setup assistant; not a node execution prompt.

    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.
  3. Install the SDK and smoke-test

    Have the bot install typesafe-sdk and write /work/jev/smoke.py with one Choice call. Look for a value from your own list, a probability spread and a confidence number; if any is missing, the SDK is talking to something else.

    Setup guidance · Source text。Give to a setup assistant; not a node execution prompt.

    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.
  4. Build the router

    Have the bot write /work/jev/router.py to spec: only goal, task_type, last_error and repeats go to Jev as state (no prompt, repo or conversation), five fixed options, every call appended to decisions.jsonl, behaviour read from config.json, disabled by default, and the file shown to you before running. The article’s Python call snippet is included for reference.

    Setup guidance · Source text。Give to a setup assistant; not a node execution prompt.

    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.

    Setup guidance · Source text。Give to a setup assistant; not a node execution prompt.

    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)
  5. Add the jev-usage-router skill

    Triggers: before any browser session, research pass, retry of a failed step, and before spawning an extra bot; honour the five actions, and ask_human is never overridden whatever the confidence. Keep the authoritative copy in your own source control — Grok Bot keeps only the 20 most recent run records per routine.

    Execution prompt · Source text。Confirm the destination, input variables and output format before use.

    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.
  6. Run shadow mode for a week

    Set {"enabled": true, "mode": "shadow"}: call and log at every trigger but act as before; append daily calls, action split, mean confidence and disagreements to report.md. The author’s reason: a cheap judge can be wrong — stop_retry might block a fourth attempt that would have worked — and less than a week is too small a sample.

    Execution prompt · Source text。Confirm the destination, input variables and output format before use.

    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.
  7. Go active, keep the kill switch

    After reading the log, switch to active: actions are honoured, ask_human still pauses for you, both kill switches stay available (“bypass jev” in any message, or enabled:false in config), and logging continues. Start with the one routine that keeps failing the same way.

    Execution prompt · Source text。Confirm the destination, input variables and output format before use.

    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.

Prompt you can copy

Execution prompt · Source text。Confirm the destination, input variables and output format before use.

This block is the prompt. Ads are never placed here.

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.

Verbatim skill block from step 5 of the author’s article (English original).

Source

How To Wire Jev Into Grok Bot: The Best Agent I've Built · 0x_rody(rody) · X · 2026-10-20T14:57:31.000Z

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related