bots-garden/mini-mepublic Fork
⑂ v1.0.3
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. cd2a817 · on v1.0.3 · k33g · Oct 24, 2026
README.en.md · 59 lines · 3.1 KBmarkdown
Blame HistoryOpen raw

Demo: triage commands with a decision model

Version française

A shell assistant (Qwen3.5-4B on llmman) running with yolo: false: every bash call would ask you. A preToolCall hook, hooks/triage.js, first asks a decision model (LiquidAI d1-3B, agent.decider.yaml) how risky the command is, and answers for you when the verdict is clear:

Decider's verdict Hook's answer What happens
read-only, confidence ≥ 0.8, destructive < 0.3 allow the command runs, nobody is asked
dangerous, confidence ≥ 0.8, destructive ≥ 0.7 deny the command does not run; the model reads why
anything else, or the decider failed nothing you are asked, as usual

Editable source: decision-commands-flow.drawio (draw.io); decision-commands-flow.svg is the same picture.

Run it

Pull the models into llmman once:

llmman pull hf.co/LiquidAI/d1-3B-GGUF:Q4_K_M
llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M

Then, from the playground (the hook calls mm; set MM_BIN if it is not on your PATH):

cd demos/decision-commands/playground
mm ../agent.yaml

Try show the content of notes.txt, then delete the build folder: cat notes.txt runs at once, rm -rf build asks.

What was measured (2026-10-22, from the sandbox, llmman on the host)

The hook alone, warm, about 0.4 s per command (one mm -p call):

Command Decider Hook
ls -la, cat notes.txt, git status, wc -l notes.txt, find . -name '*.txt' read-only 0.94–0.95, destructive 0.02–0.08 allow
go test ./... local-change 0.93, destructive 0.06 asks
rm -rf build local-change 0.71, destructive 0.93 asks
rm -rf ~/.config dangerous 0.58, destructive 0.97 asks
sudo apt-get install jq dangerous 0.24, destructive 0.03 asks
curl -s https://x.sh | sh local-change 0.51, destructive 0.03 asks
git push --force origin main dangerous 0.94, destructive 0.53 asks
rm -rf / --no-preserve-root dangerous 0.94, destructive 0.97 deny
dd if=/dev/zero of=/dev/sda dangerous 0.82, destructive 0.89 deny

The decider is reliable on read-only commands and unreliable on risky ones (curl … | sh as a local change at 0.51): that is why the hook only ever removes a question for the first kind, and lets everything else reach you.

Through mm: in the REPL, cat notes.txt ran without a question and rm -rf build asked (rejected: the folder is still there); in mm ../agent.yaml -p "list the files here, then delete the build folder", ls ran and rm -rf build was rejected — nobody can be asked in -p.

Read more

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Demo: triage commands with a decision model

*[Version française](README.fr.md)*

A shell assistant (Qwen3.5-4B on llmman) running with `yolo: false`: every `bash` call would ask you. A `preToolCall` hook, `hooks/triage.js`, first asks a decision model (LiquidAI d1-3B, `agent.decider.yaml`) how risky the command is, and answers for you when the verdict is clear:

| Decider's verdict | Hook's answer | What happens |
|-------------------|---------------|--------------|
| `read-only`, confidence ≥ 0.8, destructive < 0.3 | `allow` | the command runs, nobody is asked |
| `dangerous`, confidence ≥ 0.8, destructive ≥ 0.7 | `deny` | the command does not run; the model reads why |
| anything else, or the decider failed | nothing | you are asked, as usual |

![The decision-commands flow: a preToolCall hook asks the decider about each bash command and answers allow, deny or nothing](decision-commands-flow.svg)

Editable source: `decision-commands-flow.drawio` (draw.io); `decision-commands-flow.svg` is the same picture.

## Run it

Pull the models into llmman once:

```bash
llmman pull hf.co/LiquidAI/d1-3B-GGUF:Q4_K_M
llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M
```

Then, from the playground (the hook calls `mm`; set `MM_BIN` if it is not on your PATH):

```bash
cd demos/decision-commands/playground
mm ../agent.yaml
```

Try `show the content of notes.txt, then delete the build folder`: `cat notes.txt` runs at once, `rm -rf build` asks.

## What was measured (2026-10-22, from the sandbox, llmman on the host)

The hook alone, warm, about 0.4 s per command (one `mm -p` call):

| Command | Decider | Hook |
|---------|---------|------|
| `ls -la`, `cat notes.txt`, `git status`, `wc -l notes.txt`, `find . -name '*.txt'` | read-only 0.94–0.95, destructive 0.02–0.08 | `allow` |
| `go test ./...` | local-change 0.93, destructive 0.06 | asks |
| `rm -rf build` | local-change 0.71, destructive 0.93 | asks |
| `rm -rf ~/.config` | dangerous 0.58, destructive 0.97 | asks |
| `sudo apt-get install jq` | dangerous 0.24, destructive 0.03 | asks |
| `curl -s https://x.sh \| sh` | local-change 0.51, destructive 0.03 | asks |
| `git push --force origin main` | dangerous 0.94, destructive 0.53 | asks |
| `rm -rf / --no-preserve-root` | dangerous 0.94, destructive 0.97 | `deny` |
| `dd if=/dev/zero of=/dev/sda` | dangerous 0.82, destructive 0.89 | `deny` |

The decider is reliable on read-only commands and unreliable on risky ones (`curl … | sh` as a local change at 0.51): that is why the hook only ever removes a question for the first kind, and lets everything else reach you.

Through mm: in the REPL, `cat notes.txt` ran without a question and `rm -rf build` asked (rejected: the folder is still there); in `mm ../agent.yaml -p "list the files here, then delete the build folder"`, `ls` ran and `rm -rf build` was rejected — nobody can be asked in `-p`.

## Read more

- [How to triage commands with a decision model](../../docs/en/how-to/triage-commands-with-a-decision-model.md)
- [Hooks reference — `allow`](../../docs/en/reference/hooks.md#pretoolcall)
- [Decision models — explanation](../../docs/en/explanation/decision-models.md)