Agent command classifier

Before a coding agent runs a shell command, decide: allow it, ask the human, or block it.

The command

git add -A && git commit -m 'fix typo' && git push --force origin main

Decision

block

Risk

high

Reason

Force-push to main rewrites history; task only asked for commit.

Elapsed–

Cost$0.0001

Recorded run, replayed faster than it ran.

$0.0001this recorded run's cost

  • 1 command≈ $0.0001

Forking copies the step into your dashboard. You change the input, press Run, and each call is billed to your balance.

Build it yourself

Each step is one request to the Hyperouter API with your key. A later step reads an earlier one's output through {{steps.<id>…}}, and your inputs through {{vars.<name>}}. Models: deepseek/deepseek-v4.1-flash.

The request
  1. Classify the command

    POST /v1/chat/completionsdeepseek/deepseek-v4.1-flashText · ≤ 300 tokens

    {
      "model": "deepseek/deepseek-v4.1-flash",
      "messages": [
        {
          "role": "system",
          "content": "You are the safety classifier in front of a coding agent's shell. Given the human's task and one command the agent wants to run, decide: allow (read-only, or a normal step of the task that is easy to undo), ask (goes beyond the task, touches a remote system, or is hard to undo), block (destroys data, leaks secrets, or cannot be undone and the task never asked for it). Answer with one JSON object whose values are all strings: decision (allow, ask or block), risk (low, medium or high), reason (at most 12 words)."
        },
        {
          "role": "user",
          "content": "Task: {{vars.task}}\n\nCommand: {{vars.command}}"
        }
      ],
      "response_format": {
        "type": "json_object"
      },
      "reasoning_effort": "none",
      "max_tokens": 300
    }
Run the whole pipeline from code
SYSTEM="You are the safety classifier in front of a coding agent's shell. Given the human's task and one command the agent wants to run, decide: allow (read-only, or a normal step of the task that is easy to undo), ask (goes beyond the task, touches a remote system, or is hard to undo), block (destroys data, leaks secrets, or cannot be undone and the task never asked for it). Answer with one JSON object whose values are all strings: decision (allow, ask or block), risk (low, medium or high), reason (at most 12 words)."
TASK='Fix the typo in README.md and commit it.'
COMMAND="git add -A && git commit -m 'fix typo' && git push --force origin main"

jq -n --arg s "$SYSTEM" --arg u "Task: $TASK

Command: $COMMAND" \
  '{model:"deepseek/deepseek-v4.1-flash", max_tokens:300, reasoning_effort:"none", response_format:{type:"json_object"}, messages:[{role:"system",content:$s},{role:"user",content:$u}]}' |
curl -s https://api.hyperouter.app/v1/chat/completions -H "Authorization: Bearer $HYPEROUTER_API_KEY" -H 'Content-Type: application/json' -d @- |
jq -r '.choices[0].message.content'

Run Agent command classifier on your account

Before a coding agent runs a shell command, decide: allow it, ask the human, or block it. Fork it, change the input, and run it from the dashboard: ≈ $0.0001 per run at the default settings.