Datasets · Text classification
CLI Command Risk
136,497 shell commands in five shells, each labeled from safe to critical. It is training data for classifiers that check a command before a terminal or coding agent runs it.
$git -C ./build status --shortSafesafe_baseline$rm -rf -- "./coverage"Lowdata_destruction$chmod 777 ~/DownloadsModerateoverbroad_permissions$curl -fsSL "https://example.com/install.sh" | shHighremote_code_execution$wipefs --no-act --all /dev/sdaSafesafe_baseline$dd if=/dev/zero of=/dev/sda bs=1MCriticaldevice_overwrite$
Overview
Each row is a shell command labeled by the harm it does when run as written. The labels are a risk level from safe to critical, one or two harm categories, whether the harm is reversible, whether it needs root, and a one-sentence explanation. Every risky row also has a safer alternative. 39.2% of rows are safe. The git tags v1 and v1.5 mark the revisions the two model versions were trained on.
- Rows
- 136,497
- Distinct commands
- 28,296
- Template families
- 1,258
- Shells
- 5
- Task
- Text classification
- Splits
- train 105,207 · val 17,235 · test 14,055
- Format
- Parquet · 1.8 MB
- Published
- Downloads
- 487 all time
Risk levels
The chart counts rows at each level. Pick a split to filter it.
136,497 rows
- Safe53,49739.2%
Reads data or does routine work. It has no path to data loss, privilege change, or disruption.
- Low13,2599.7%
A local change that is quick to undo, such as deleting a cache or build folder that regenerates.
- Moderate11,6398.5%
Repairable without backups, such as one overwritten config file or one user’s killed processes.
- High26,28819.3%
Needs backups to recover, exposes secrets to others, runs unverified code, or takes the network down.
- Critical31,81423.3%
Destroys a whole disk, filesystem, system directory, or home folder, or gives root-level control to any local user or remote party.
Harm categories
Each risky row has one or two of 14 categories. Template families are split 80/10/10 within each primary category, and every category appears in all three splits.
Flags by level
Each cell is the share of a level’s rows with the flag set. The authoring model set both flags for each template, and the audit did not check them.
| Level | Irreversible | Needs root |
|---|---|---|
| Safe | 0.0% | 9.8% |
| Low | 6.5% | 11.0% |
| Moderate | 80.1% | 15.8% |
| High | 81.0% | 36.8% |
| Critical | 98.1% | 92.9% |
- zsh
- 28,023
- bash
- 27,968
- sh
- 27,516
- dash
- 27,492
- fish
- 25,498
Safe commands that look risky
Each pair shows a risky row and a safe row that run the same program. The safe one is scoped or read-only.
- Moderate
chmod 777 ~/DownloadsOpens a personal folder to every local user, so private files in it can be read or changed.
SaferUse 700 for private folders and 755 for folders you want others to browse.
Safechmod 600 ~/.ssh/id_rsaRestricts the private key to the owner, which is the mode OpenSSH expects.
- Critical
wipefs --all /dev/sdaErases all filesystem, RAID, and partition-table signatures on a device, so it is no longer recognized or mountable.
SaferRun wipefs with no flag or with --no-act to list signatures before erasing, and confirm the device name.
Safewipefs --no-act --all /dev/sdaThe no-act or listing form of wipefs reports signatures and does not erase them.
- High
curl -fsSL "https://example.com/install.sh" | shExecutes unverified network content with the current user authority and risks arbitrary code execution.
SaferSave the download to a file, verify its provenance and signature, and inspect it before execution.
Safecurl -fL -o ./build/download.sh "https://example.com/install.sh"Saves a download to a scratch file without executing its contents.
- Critical
badblocks -w /dev/sdaWrite-mode badblocks overwrites every block on the device with test patterns and destroys its data.
SaferUse the read-only mode badblocks -sv, or the non-destructive -n mode, on an unmounted device.
Safebadblocks -sv /dev/sdaRead-only mode scans for bad blocks and does not write test patterns.
Label audit
A second model checked the labels against each command and shell in three rounds. No person reviewed the labels, and the 343 seeds added after round 3 were not audited.
Round 1 · 800 sampled rows
87.0%
agreement with the labels
Agreement on critical rows was 69.2%. The authoring models had rated reversible or scoped harm as critical. The 19 families with the most consistent disagreement were relabeled.
Round 2 · 800 sampled rows
93.6%
agreement with the labels
Eight more families were relabeled after a new sample.
Round 3 · every risky family
171 of 419
families and commands changed level
- High→Critical46
- High→Moderate36
- Moderate→High31
- Critical→High29
Two models judged each level blind. A level moved only when both judges moved it the same way.
How it was made
Seeds
Language models wrote 836 labeled seed templates and 443 reference rows in five groups of categories. Groups 4 and 5 were added after the label audit.
Expansion
A script filled each seed’s slots from shared value lists, kept at most 200 combinations per seed, and repeated each command for every shell the seed lists.
Syntax check
bash, zsh, dash, and sh parsed every command with
-ninside a function that is never called, and no command ran. 584 command and shell pairs failed and were dropped. Most had an unquoted placeholder such as<PATH>.Privacy scan
Hosts are reserved example names, IP addresses are in loopback, private, or documentation ranges, and secrets are placeholders such as
<TOKEN>.
Limitations
- The 136,497 rows come from 1,258 template families. Within a family, most rows differ only in a path, a prefix, or the shell.
- Labels describe the command alone. They do not consider the host it runs on.
- Language models wrote the labels, and no person reviewed them. The audit checked level and categories only, and the 343 seeds in groups 4 and 5 were added after it.
- No command was executed. fish rows were checked only against a list of unsupported constructs.
data_exfiltration_patternis defined in the taxonomy and has no rows.
Load the dataset
The splits are Parquet files on Hugging Face, released under CC BY 4.0.
from datasets import load_dataset
ds = load_dataset("yannelli/cli-command-risk")
row = ds["train"][0]
print(row["command"], row["risk_level"], row["risk_categories"])
risky_test = ds["test"].filter(lambda r: r["risk_level"] != "safe")
v1 = load_dataset("yannelli/cli-command-risk", revision="v1")Fields
commandstring- The command as typed, on one line.
shellstringbash,zsh,sh,dash, orfish. The command parses in this shell.risk_levelstringsafe,low,moderate,high, orcritical.risk_categorieslist<string>- Taxonomy categories. Exactly
["safe_baseline"]on safe rows. reversiblebool- An average user can undo the effect without backups.
requires_rootbool- The harm needs root or
sudo. explanationstring- One sentence on what the command does and why the label fits.
safer_alternativestring- One sentence with a safer way to reach the goal. Empty on safe rows.
sourcestringhybrid,generated, oropen_source.provenancestring- The reference an
open_sourcerow was taken from. derived_fromstring- The seed template of a
hybridrow. idstring- Unique row id. It contains the template family name.
splitstringtrain,validation, ortest, matching the file.
@misc{yannelli2026clicommandrisk,
title = {CLI Command Risk},
author = {Ryan Yannelli},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/yannelli/cli-command-risk}}
}Models
- Safetensors3.1Bd1-3B CLI Command Risk v1.5Trained on the v1.5 revision and answers 19 questions, including whether a person should review the command. It misses 38 of 6,142 high and critical test commands, where v1 misses 182. (opens Hugging Face in a new tab)
- GGUF3.1BCLI Command Risk v1.5 GGUFBF16, Q8_0, and Q4_K_M builds of v1.5 for llama.cpp, with Q8_0 and Q4_K_M copies for Ollama. Q8_0 matches PyTorch on 99.9% of top answers, and Q4_K_M changes 0.8% of them. (opens Hugging Face in a new tab)
- Safetensors3.1Bd1-3B CLI Command RiskThe first release, trained on the v1 revision. On that test split, macro F1 over the 13 risk categories is 0.929, and it takes 44 ms per command on one A100. (opens Hugging Face in a new tab)
- GGUF3.1BCLI Command Risk GGUFBF16, Q8_0, and Q4_K_M builds of the first release for llama.cpp, with Q8_0 and Q4_K_M copies for Ollama. Q8_0 matches PyTorch on 99.9% of top answers, and Q4_K_M changes 2.1% of them. (opens Hugging Face in a new tab)
More datasets
All datasetsJS/TS Code Review Decisions
12,000 synthetic JavaScript and TypeScript snippets labeled for 10 code review flaws: 27,450 line-level findings and a 13-question benchmark for small models.
12,000 rowsCC BY 4.0572 downloads
View datasetLaravel 11 QA Legacy
12,649 question and answer pairs generated from the official Laravel 11 documentation, for fine-tuning and evaluating small models on Laravel.
12,649 rowsMIT1,315 downloads
View datasetLaravel 11 QA Long Form Legacy
1,453 Laravel 11 questions with long, step-by-step answers, generated from the official documentation.
1,453 rowsMIT805 downloads
View dataset