> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/jp/shii/studio/unsloth-niokerusandobokkusu.md).

# Unsloth におけるサンドボックス化

Unsloth は Linux では bubblewrap、macOS では Seatbelt、Windows では MXC を使用します。

Unsloth には OS レベルのサンドボックス化が追加され、すべてのツール呼び出しが OS レベルに害を与えることなく、いくつかのフォルダ内に隔離されるようになりました。Unsloth には 2 つのモードがあります - **"低"** そして **"高" サンドボックスセキュリティ** - 低では、Unsloth のソフトウェアサンドボックス手法を使用します。これは、すべてのツール呼び出しに対して高度な文字列、AST、正規表現チェックを行うものです（危険な rm -rf、トークンの持ち出しなどを無効化します）。高は真の OS レベルのサンドボックス化で、これはすべてのプラットフォームで利用できます。

| オペレーティングシステム                                | サンドボックスソフトウェア        | 呼び出しごとのレイテンシ |
| ------------------------------------------- | -------------------- | ------------ |
| <i class="fa-windows">:windows:</i> Windows | **MXC** （Windows 公式） | 164ms        |
| <i class="fa-linux">:linux:</i> Linux       | Bubblewrap / Bwrap   | 50ms         |
| <i class="fa-apple">:apple:</i> Mac         | Seatbelt（Mac 内部）     | 110ms        |

OS レベルのサンドボックス化を有効にするには：

* **Windows - MXC はプリインストールされています** Windows 11 24H2 以降向けです。
* **Linux** - Bwrap はインストールが必要です - 「高」を選択すると、こちらでインストールします
* **Mac - Seatbelt はプリインストールされています**そのため、Unsloth は自動的に Seatbelt を有効にします

OS サンドボックス化が低か高かを確認するには、権限ボタンをクリックしてください：

<div align="left"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FBdWF0MbLoJLwTeFVhX7j%2FScreenshot%202026-10-08%20at%207.00.50%E2%80%AFAM.png?alt=media&amp;token=a592513a-9f45-4e0b-80d4-b8a6456e37ac" alt="" width="563"><figcaption></figcaption></figure></div>

「詳細を見る」をクリックすると、サンドボックス設定ページに移動し、ソフトウェアサンドボックス化が有効になっているかどうか、さらに bwrap や MXC のインストール方法も確認できます：

<div align="left"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FfDEvjiXwBf1Fmftsp28q%2FScreenshot%202026-10-08%20at%206.56.34%E2%80%AFAM.png?alt=media&amp;token=b2c99b4c-67ea-4c50-bb98-4a710e0eafee" alt="" width="563"><figcaption></figcaption></figure></div>

3 つすべてのオペレーティングシステムについて、OS レベルのサンドボックス化がどのように有効になっているかを確認できます：

{% columns %}
{% column %}
Windows:

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FLnxxpIwGpSjut6R6kLn8%2FScreenshot%202026-10-08%20at%206.53.26%E2%80%AFAM.png?alt=media&amp;token=85be4503-5279-4716-a1d0-1efbb8126129" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
Mac:

<img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FRNZyuJL7xkrXJwYxofto%2FScreenshot%202026-10-08%20at%206.51.19%E2%80%AFAM.png?alt=media&amp;token=04ee3ff8-209c-41f6-bed2-8c64173ea77f" alt="" width="375">
{% endcolumn %}

{% column %}
Linux:

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FesfsF7INvYB1MpIQF3cn%2FScreenshot%202026-10-08%20at%206.53.20%E2%80%AFAM.png?alt=media&amp;token=33f9f7cd-df4e-4e74-89c4-0c482c64e3c5" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="50%" %}
ワークスペース外へのアクセスをブロックするサンドボックスの動作を確認できます：

### サンドボックス化のレイテンシ

ソフトウェアおよびハードウェアの OS レベルのサンドボックス化を大幅に最適化しましたが、OS レベルのサンドボックス化には確かにレイテンシの追加があります。以下の表をご覧ください：
{% endcolumn %}

{% column width="50%" %}
![](https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FcyBycXfercRlu0iEttel%2Fnew%20sandbox.png?alt=media\&token=d9064a88-e5c8-4e1d-a261-e93f20739ea6)
{% endcolumn %}
{% endcolumns %}

| オペレーティングシステム                                | サンドボックスソフトウェア        | 低サンドボックス | 高サンドボックス |
| ------------------------------------------- | -------------------- | -------- | -------- |
| <i class="fa-windows">:windows:</i> Windows | **MXC** （Windows 公式） | 8ms      | 164ms    |
| <i class="fa-linux">:linux:</i> Linux       | Bubblewrap / Bwrap   | 3ms      | 50ms     |
| <i class="fa-apple">:apple:</i> Mac         | Seatbelt（Mac 内部）     | 10ms     | 110ms    |

{% columns %}
{% column %}

### サンドボックス化を無効化 / 権限をバイパス / フルアクセス

サンドボックス化（ソフトウェアの低レベルと OS レベルの高レベルの両方）を無効にするには、単に「フルアクセス」を押してください。これで Unsloth は制約なしでコンピュータ全体にアクセスできます。
{% endcolumn %}

{% column %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6YpMXm0gOsM7lPaygu4T%2FScreenshot%202026-10-08%20at%206.45.21%E2%80%AFAM.png?alt=media&amp;token=b7f308f5-ac0b-4852-9eeb-961e6cc575ef" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### ソフトウェアサンドボックス化のアプローチ

Unsloth のソフトウェアサンドボックス化は、複数の正規表現、文字列チェックなどで構成されています - 追加されるレイテンシは約 **1〜2ms の追加レイテンシ** で、各ツール呼び出しごとに以下をブロックします：

* 削除およびディスク系ツール： `rm, dd, mkfs, fdisk, mount, umount`
* 権限と特権: chmod, `chown, sudo, su, doas, pkexec, passwd`
* ネットワーク： `curl, wget, nc, ncat, netcat, socat, ssh, scp, sftp, rsync`
* プロセスと電源： `kill, killall, pkill, shutdown, reboot, halt, poweroff`
* 別スクリプトの内容を見えないまま実行すること： `eval, source`
* Windows のみ： `rmdir, takeown, icacls, runas, powershell, pwsh`

Python コードについては、実行前にコードを読み取ることにより：

* シェルエスケープ： `os.system`と `subprked` コマンド、またはリテラルではないコマンド（たとえば su 経由の pip install など）
* ネットワーク呼び出し： `requests, urllib`、生のソケット接続
* 次のような一部の機微なシステム読み取り： `/etc/passwd`
* それらを回避するために、シグナルやタイムアウトを改ざんすること。

両方のモードで、すべての呼び出しに適用されます：

* 秘密の環境変数は除去されます。
* Studio 独自の認証情報ファイルは拒否されます
* プロセス、ファイルサイズ（100 MB）、メモリ（8 GB）、CPU 時間（600 s）に制限があるため、fork bomb はプロセス上限に達し、さらに呼び出しのタイムアウトも発生します

#### Windows MXC パートナーシップ

Unsloth で MXC がうまく動作するよう協力してくださった Windows チームに感謝します！ [こちらをご覧ください](https://blogs.windows.com/windowsexperience/2026/10/07/building-windows-for-hybrid-intelligence/) ローンチブログ投稿用

#### Unsloth でサンドボックス化を有効にする

Unsloth を最新に更新するだけで、サンドボックス化が有効になります！


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/jp/shii/studio/unsloth-niokerusandobokkusu.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
