Datasets · Text classification
CLI Command Risk
124,923 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.9% of rows are safe.
- Rows
- 124,923
- Distinct commands
- 25,702
- Template families
- 920
- Shells
- 5
- Task
- Text classification
- Splits
- train 95,893 · val 16,341 · test 12,689
- Format
- Parquet · 1.6 MB
- Published
- Downloads
- 48 all time
Risk levels
The chart counts rows at each level. Pick a split to filter it.
124,923 rows
- Safe49,89039.9%
Reads data or does routine work. It has no path to data loss, privilege change, or disruption.
- Low10,3618.3%
A local change that is quick to undo, such as deleting a cache or build folder that regenerates.
- Moderate10,3648.3%
Repairable without backups, such as one overwritten config file or one user’s killed processes.
- High23,53918.8%
Needs backups to recover, exposes secrets to others, runs unverified code, or takes the network down.
- Critical30,76924.6%
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 13 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.3% |
| Low | 7.7% | 6.0% |
| Moderate | 85.6% | 15.1% |
| High | 82.0% | 38.7% |
| Critical | 99.1% | 90.2% |
- zsh
- 25,468
- bash
- 25,440
- sh
- 25,087
- dash
- 25,063
- fish
- 23,865
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.
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
Three language models wrote 493 labeled seed templates and 443 reference rows. Each model wrote the seeds for its own group of categories.
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. 297 command and shell pairs failed and were dropped.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 124,923 rows come from 920 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.
- No command was executed. fish rows were checked only against a list of unsupported constructs.
data_exfiltration_patternandpackage_removalare defined in the taxonomy and have 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")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 RiskLFM2.5-VL-3B with a decision readout. 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 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. The dataset has 27,450 line-level findings and a 13-question benchmark for small decision models.
12,000 rowsCC BY 4.0200 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,248 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 rowsMIT747 downloads
View dataset