HYUKI5's picture
カードを組み立て直す(訳文と書式の修正を反映)
cba62a2 verified
|
Raw History Blame Contribute Delete
16.5 kB
---
license: other
pretty_name: kontext-security/ShellRisk-Bench (mirror)
source_datasets:
- kontext-security/ShellRisk-Bench
tags:
- laya
- laya-finetune
- mirror
- domain-technology
- domain-code
- use-unclear
- genre-source-code
- label-binary
- annot-rule
- lang-en
language:
- en
task_categories:
- text-classification
size_categories:
- 10K<n<100K
configs:
- config_name: default
data_files:
- split: train
path: data/train-*.parquet
- split: test
path: data/test-*.parquet
---
# kontext-security/ShellRisk-Bench(複製)
## データの内容
シェルコマンドの投稿を、文脈なしで「リスクあり」か「リスクなし」に二値分類するベンチマーク。1 行が 1 件のコマンドで、`command` にコマンドの文字列、`label` に `risky` か `not_risky` が入る。リスクなしは SWE-smith と Terminal-Bench の軌跡と nl2bash、リスクありは Atomic Red Team・GTFOBins・InternalAllTheThings から集めた。`command` は実行せず、出典ごとにライセンスが異なる。
## データの概要
| 項目 | 値 |
|---|---|
| 行数 | 20,966(1 構成・2 分割の合計) |
| 列数 | 5 |
| 容量 | 2.59 MB(ファイル 4 本) |
| ファイルの形式 | parquet 2 |
| 言語 | en |
| 公開 | public |
### 構成と分割
| 構成(config) | 分割(split)ごとの行数 | 列数 |
|---|---|---:|
| `default` | `train` 16,772、`test` 4,194 | 5 |
### 列(構成 `default`・分割 `train`)
| 列 | 型 | 先頭の行の値 |
|---|---|---|
| `command` | `string` | `rm -f reproduce_issue.py && find . -name "*.pyc"…` |
| `id` | `string` | `sha256:32d8dba23443186c5ca04c446d46e0212fb04b61c…` |
| `label` | `string` | `not_risky` |
| `source` | `string` | `swesmith` |
| `upstream_id` | `string` | `swesmith-041457` |
行数と列は HF のデータセットビューアの集計(元のデータセットの現在の版で数えたもの)。全データセットの一覧は [HYUKI5/dataset-catalog](https://huggingface.co/datasets/HYUKI5/dataset-catalog) にある。
## 複製について
[`kontext-security/ShellRisk-Bench`](https://huggingface.co/datasets/kontext-security/ShellRisk-Bench) をリビジョン `437467862139b4e9cdd5322024ef3434a67c7ec8` の時点でそのまま複製したもの。中身は変えていない。判断モデル Laya(`convaiinnovations/laya`)の微調整に使う候補として、調査メモ(`Laya 学習用データセット調査`)に載せたデータを集めている。
## 出典
- 元のデータセット: https://huggingface.co/datasets/kontext-security/ShellRisk-Bench
- 複製したリビジョン: `437467862139b4e9cdd5322024ef3434a67c7ec8`(2026-08-19 15:14:23+00:00)
- 元のライセンス表記: `other`
## 論文
- 元のカードに論文へのリンクは見つからなかった
## アノテーションの方法
**出典とラベル**
データは、固定された 6 つの公開の出典から構築されている:
| Class | Source | Label basis |
|---|---|---|
| リスクなし | [SWE-smith trajectories](https://huggingface.co/datasets/Kwai-Klear/SWE-smith-mini_swe_agent_plus-trajectories-66k) | 良性のソフトウェア工学タスクから推定 |
| リスクなし | [Terminal-Bench trajectories](https://huggingface.co/datasets/yoonholee/terminalbench-trajectories) | 良性のターミナルタスクから推定 |
| リスクなし | [nl2bash](https://github.com/TellinaTool/nl2bash) | 人手で整備されたコマンドのコーパス |
| リスクあり | [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) | 実行可能な ATT&CK テスト |
| リスクあり | [GTFOBins](https://github.com/GTFOBins/GTFOBins.github.io) | 整備されたバイナリの悪用手法 |
| リスクあり | [InternalAllTheThings](https://github.com/swisskyrepo/InternalAllTheThings) | 整備された攻撃用のシェルのペイロード |
良性の軌跡(trajectory)のラベルは、コマンドごとに独立に検証したものではなく、タスクから推定したものである。リスクありのラベルは、出典のセキュリティのコレクションの目的に従う。正確なリビジョンと変換については、リポジトリの [データセットの出典](https://github.com/kontext-security/shellrisk-bench/blob/main/DATASETS.md) を参照すること。
**分割の構築**
v0.1 の分割では、正規化した完全一致のコマンドを全体で重複除去し、両方のラベルで観測された文字列を取り除く。リスクありのコマンドは 966 件すべてを残し、良性のコマンドは決定的に 20,000 件を上限とする。そして、シード 13 で層化した 80/20 の分割を行う。
test の混合比がおよそ 20:1 なのは、意図的に設定した動作点である。本番環境におけるリスクのあるコマンドの出現率の、実測による推定値ではない。
## 微調整に使うときの注意
- 調査メモの台帳での区分: D(記載なし・other・unknown・資料間の食い違い)。区分は記載の文言で機械的に付けたもので、法的な判定ではない。学習に入れる前に元のカードとライセンスの原文で確かめる。
- Laya の入力は 2,048 token まで(ModernBERT-large / mmBERT)。長い本文は先頭から黙って切られるので、切れる行は事前に除くか、要約・切り出しをしてから入れる。
- 分割は記事・文書単位で行い、同じ本文から作った別の問いを学習側と較正側に分けない。温度と閾値は学習に使っていない分割で別々に当てる。
## 調査メモの記述
| メモ | 節 | ライセンス(記載) | 確認 | 注記 |
|---|---|---|---|---|
| `jev_sources_tasksource_bekko.csv` | CSV(tasksource-jev-typed-decisions) | other / license_use=unspecified | 確認済 | license_use=unspecified / [Jev 元データ source] source_annotation_converted(deterministic recast; no model r |
## 元のカード(日本語訳)
以下は元のデータセットのカードの本文を日本語に訳したもの(機械翻訳)。訳に疑問があるときは、末尾の原文を確かめる。
---
# ShellRisk-Bench
ShellRisk-Bench は、個々のシェルコマンドの投稿を、文脈なしで二値のリスク分類する再現可能なベンチマークである。タスク、ユーザー、セッションの文脈なしに評価したとき、そのコマンドが意味のあるサイバーリスクまたはシステムリスクをもたらすかどうかを問う。
**公開:** v0.1 の Parquet の train と test の分割は、Dataset Viewer と `load_dataset()` から公開で利用できる。
ベンチマークには、決定的な train 分割として 16,772 行、test 分割として 4,194 行が含まれる。test セットには `risky` が 193 件、`not_risky` が 4,001 件含まれる。
ソースコード、アダプタ、評価ツール、固定されたリビジョン、公開された結果は、[ShellRisk-Bench の GitHub リポジトリ](https://github.com/kontext-security/shellrisk-bench) にある。
## 使い方
```python
from datasets import load_dataset
dataset = load_dataset("kontext-security/ShellRisk-Bench")
print(dataset["train"])
print(dataset["test"])
```
`command` フィールドは、動作しない信頼できないテキストとして扱うこと。データセットの内容を実行したり、シェルにパイプで渡したりしないこと。
## スキーマ
| Field | Type | Description |
|---|---|---|
| `id` | string | 正規化したコマンドの、安定した `sha256:` のダイジェスト |
| `source` | string | 出典のアダプタのキー |
| `upstream_id` | string | 出典のアダプタが割り当てた行の識別子 |
| `command` | string | 正規化したシェルコマンドの投稿 |
| `label` | string | `risky` または `not_risky` |
1 行の投稿は、パイプラインや `&&` または `;` で結合したコマンドも含めて、分割せずそのまま残す。複数行のスクリプトとセッションは除外する。系列のラベルを、構成するコマンドに伝播させることはない。
## 出典とラベル
データは、固定された 6 つの公開の出典から構築されている:
| Class | Source | Label basis |
|---|---|---|
| リスクなし | [SWE-smith trajectories](https://huggingface.co/datasets/Kwai-Klear/SWE-smith-mini_swe_agent_plus-trajectories-66k) | 良性のソフトウェア工学タスクから推定 |
| リスクなし | [Terminal-Bench trajectories](https://huggingface.co/datasets/yoonholee/terminalbench-trajectories) | 良性のターミナルタスクから推定 |
| リスクなし | [nl2bash](https://github.com/TellinaTool/nl2bash) | 人手で整備されたコマンドのコーパス |
| リスクあり | [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) | 実行可能な ATT&CK テスト |
| リスクあり | [GTFOBins](https://github.com/GTFOBins/GTFOBins.github.io) | 整備されたバイナリの悪用手法 |
| リスクあり | [InternalAllTheThings](https://github.com/swisskyrepo/InternalAllTheThings) | 整備された攻撃用のシェルのペイロード |
良性の軌跡(trajectory)のラベルは、コマンドごとに独立に検証したものではなく、タスクから推定したものである。リスクありのラベルは、出典のセキュリティのコレクションの目的に従う。正確なリビジョンと変換については、リポジトリの [データセットの出典](https://github.com/kontext-security/shellrisk-bench/blob/main/DATASETS.md) を参照すること。
## 分割の構築
v0.1 の分割では、正規化した完全一致のコマンドを全体で重複除去し、両方のラベルで観測された文字列を取り除く。リスクありのコマンドは 966 件すべてを残し、良性のコマンドは決定的に 20,000 件を上限とする。そして、シード 13 で層化した 80/20 の分割を行う。
test の混合比がおよそ 20:1 なのは、意図的に設定した動作点である。本番環境におけるリスクのあるコマンドの出現率の、実測による推定値ではない。
## 用途と制限
ShellRisk-Bench は、固定され監査可能な分割の上で、コマンド単位の分類器とセキュリティのガードレールを比較することを目的とする。ユーザーの意図、周囲のタスクの文脈、複数コマンドのセッション、完全な認可の判断は評価しない。
主要な分割は、同じ出典から得られ、同一分布内にあるものである。既知の出典の分布から抽出した、未見のコマンド文字列に対する性能を測る。新しいコマンドの方言への転移を示す証拠ではない。出典ごとのグループ化や、1 つの出典を除外する分析を行う際は、`source` フィールドを残すこと。
## 試してみる
ShellRisk-Bench は Kontext Security が保守している。Kontext の一部として、Kestrel がエージェントのツール呼び出しのサイバーリスクを評価する様子を見るには、[kontext.security](https://kontext.security) を訪れること。
## ライセンス
データ全体に対する単一の包括的なライセンスはない。ベンチマークのコードとドキュメントは Apache-2.0 であり、各出典は独自の条件を保持する。固定された出典は、現時点でそれぞれ MIT、Apache-2.0、MIT、MIT、GPL-3.0、ライセンスファイルなし、を宣言している。データを使用または再配布する前に、[DATASETS.md](https://github.com/kontext-security/shellrisk-bench/blob/main/DATASETS.md) にある出典ごとのリンクと注記を確認すること。
<details>
<summary>原文(英語)</summary>
# ShellRisk-Bench
ShellRisk-Bench is a reproducible benchmark for context-free binary risk
classification of individual shell-command submissions. It asks whether a
command poses meaningful cyber or system risk when evaluated without task,
user, or session context.
**Release:** The v0.1 Parquet train and test splits are publicly available
through Dataset Viewer and `load_dataset()`.
The benchmark contains a deterministic train split of 16,772 rows and test
split of 4,194 rows. The test set contains 193 `risky` and 4,001 `not_risky`
examples.
The source code, adapters, evaluation tooling, pinned revisions, and published
results are available in the
[ShellRisk-Bench GitHub repository](https://github.com/kontext-security/shellrisk-bench).
## Usage
```python
from datasets import load_dataset
dataset = load_dataset("kontext-security/ShellRisk-Bench")
print(dataset["train"])
print(dataset["test"])
```
Treat the `command` field as inert, untrusted text. Do not execute dataset
contents or pipe them into a shell.
## Schema
| Field | Type | Description |
|---|---|---|
| `id` | string | Stable `sha256:` digest of the normalized command |
| `source` | string | Source adapter key |
| `upstream_id` | string | Row identifier assigned by the source adapter |
| `command` | string | Normalized shell-command submission |
| `label` | string | `risky` or `not_risky` |
Single-line submissions remain whole, including pipelines and commands joined
with `&&` or `;`. Multi-line scripts and sessions are excluded; sequence labels
are never propagated onto their component commands.
## Sources and labels
The data is built from six pinned public sources:
| Class | Source | Label basis |
|---|---|---|
| Not risky | [SWE-smith trajectories](https://huggingface.co/datasets/Kwai-Klear/SWE-smith-mini_swe_agent_plus-trajectories-66k) | Inferred from benign software-engineering tasks |
| Not risky | [Terminal-Bench trajectories](https://huggingface.co/datasets/yoonholee/terminalbench-trajectories) | Inferred from benign terminal tasks |
| Not risky | [nl2bash](https://github.com/TellinaTool/nl2bash) | Human-curated command corpus |
| Risky | [Atomic Red Team](https://github.com/redcanaryco/atomic-red-team) | Executable ATT&CK tests |
| Risky | [GTFOBins](https://github.com/GTFOBins/GTFOBins.github.io) | Curated binary-abuse techniques |
| Risky | [InternalAllTheThings](https://github.com/swisskyrepo/InternalAllTheThings) | Curated offensive shell payloads |
The benign trajectory labels are task-inferred rather than independently
verified command-by-command. Risky labels follow the purpose of the upstream
security collections. See the repository's
[dataset provenance](https://github.com/kontext-security/shellrisk-bench/blob/main/DATASETS.md)
for exact revisions and transformations.
## Split construction
The v0.1 split globally deduplicates exact normalized commands, removes strings
observed with both labels, retains all 966 risky commands, deterministically
caps benign commands at 20,000, and performs a stratified 80/20 split with seed
13.
The approximately 20:1 test mix is a constructed operating point. It is not an
empirical estimate of the prevalence of risky commands in production.
## Uses and limitations
ShellRisk-Bench is intended to compare command-level classifiers and security
guardrails on a fixed, auditable split. It does not evaluate user intent,
surrounding task context, multi-command sessions, or complete authorization
decisions.
The headline split is same-source and in-distribution. It measures performance
on unseen command strings drawn from known source distributions; it is not
evidence of transfer to a novel command dialect. Keep the `source` field when
performing source-grouped or leave-one-source-out analysis.
## Try it
ShellRisk-Bench is maintained by Kontext Security. To see Kestrel evaluating
the cyber risk of agent tool calls as part of Kontext, visit
[kontext.security](https://kontext.security).
## Licensing
There is no single blanket license for the data. The benchmark code and
documentation are Apache-2.0, while each upstream source retains its own terms.
The pinned sources currently declare MIT, Apache-2.0, MIT, MIT, GPL-3.0, and no
license file, respectively. Consult the source-specific links and notes in
[DATASETS.md](https://github.com/kontext-security/shellrisk-bench/blob/main/DATASETS.md)
before using or redistributing the data.
</details>