본문으로 건너뛰기
Skillpedia
보안6.9k · #13724

throwaway-machine

하는 일

스크립트나 테스트 모음을 일회용 smolvm 머신 안에서 실행하는 방법을 보여 줍니다. 허용하지 않는 한 리포지토리를 바꾸거나 인터넷에 닿을 수 없습니다. 완전히 신뢰하지 않는 코드를 실행하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓에이전트가 만든 스크립트를 안전하게 실행하고 싶을 때.
  • ✓내 컴퓨터에서 코드를 신뢰하지 않고 풀 리퀘스트를 테스트하고 싶을 때.
  • ✓실행을 취소하면서도 머신을 남기지 않아야 할 때.

스킬 링크

https://github.com/smol-machines/smolvm/blob/main/docs/throwaway-machine/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/smol-machines/smolvm/blob/main/docs/throwaway-machine/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“정체를 알 수 없는 이 테스트 모음을 인터넷 접근이 없는 일회용 머신에서 실행하고, 결과를 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

리포지토리는 그대로 유지되고, 결과는 별도의 출력 폴더에 기록됩니다. 네트워크 접근은 사용자가 특정 호스트 하나를 허용하지 않는 한 꺼져 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Running untrusted work in a throwaway machine

Verified on smolvm v1.23.0 on macOS arm64, 2026-10-04, by the offline route, the network-on route and the cancel; on Linux aarch64 by the offline route and the cancel on v1.20.2, 2026-09-29, and the network-on route on v1.18.2, 2026-09-24. Done means the command's output landed in your writable directory, the repo is unchanged, the workload could not reach the network, and nothing is left running. The Linux runs used the scripts of their date; this version's preflight, run and cleanup scripts ran on Linux aarch64 on v1.22.2 on 2026-10-03.

On macOS from v1.24.0 the offline route does not run (#1819). Every --oci-cache run, the bake's own included, fails with agent did not become ready within 30 seconds: measured on v1.24.0, v1.24.1, v1.25.0, v1.25.1, v1.27.3, v1.28.1 and v1.29.0, while v1.23.3 and v1.23.7 boot the same command on the same host. The preflight says offline_shape=unavailable there and bake.sh says result=FAILED. For a run with no network, use the persistent machine with no network in README.md, which boots the image with no bake; the network-on route works.

Ctrl-C on run.sh ends the run from v1.20.2: the script forwards an interrupt or a SIGTERM to the CLI, which ends its VM. Before v1.20.2 the cancel is scripts/cleanup.sh --cancel, as "Cancelling" below measures.

Two issues shaped this packet, both fixed in v1.20.2 on macOS and Linux; older releases still have them: #1193, a cached run's VM outlives an interrupted CLI, invisible to machine list; and #1192, a cached run with any mount never boots on macOS, for which references/macos.md gives the older releases a route.

Workflow

If you have no script to isolate, make one. A file that reads a path under /workspace, tries to create a file there, and tries to fetch a URL proves all three properties in one run, and the three lines it prints are the evidence. An agent with an empty directory and no fixture stopped and asked the user instead of building one.

- [ ] 1. preflight.sh, and read result= and device_budget_ok=
- [ ] 2. bake.sh          (offline route only; network on, nothing untrusted mounted)
- [ ] 3. run.sh           (the untrusted command; records the VM pid)
- [ ] 4. verify.sh        (from inside the guest and from the host)
- [ ] 5. cleanup.sh       (or cleanup.sh --cancel to stop a run early)

1. Preflight. Read-only: starts no VM, bakes nothing.

scripts/preflight.sh --mounts 2 --ports 0

device_budget_ok=no means the boot will fail with no more IRQs are available. On x86_64 through v1.22.2 the guest has eleven IRQs: four -v mounts boot and five do not, and publishing any port, or granting egress, adds one device. arm64 guests have 128, and the preflight prints device_budget_ok=not_limiting there. v1.23.0 ships a libkrun whose x86_64 guests have IRQs 5 to 23 (#1521); its ceiling was not measured, and the preflight applies the budget through v1.22.2 only. Combine directories under one mount rather than discovering this at boot.

offline_shape=unavailable means this host cannot run the shape below: macOS before v1.20.2 (#1192), or Windows. The preflight cannot see whether the 8192 MiB bake helper fits; bake.sh finds that out in step 2 and says so.

2. Bake the image. This is the only step in which a machine has a network.

scripts/bake.sh python:3.12-alpine

Network on, nothing untrusted mounted, done before the untrusted code is anywhere near the machine. Afterwards the runs' machines need no network at all, which is materially stronger isolation than granting egress and hoping. The host CLI still asks the registry for the image's manifest on every --oci-cache run, to authorize the pull and to notice a tag that moved, so the host needs to reach the registry; the workload does not.

3. Run the untrusted command.

scripts/run.sh --repo ./repo --out ./out -- sh -c 'python3 /workspace/calc.py > /out/result.txt'

The repo is mounted read-only at /workspace, or at the path --repo-path names, the output directory writable at /out, and the run has no network. It prints used_host_cache=yes, which is the assertion that the bake worked and that this run's machine pulled nothing: without it the guest pulled, which

자주 묻는 질문

코드가 인터넷에 접근할 수 있나요?

기본적으로는 아닙니다. 네트워크 접근은 사용자가 명시적으로 허용한 호스트에 한해, 하나씩만 허용됩니다.

모든 Mac에서 작동하나요?

스킬은 1.24.0 버전부터 macOS에서 오프라인 경로가 실패한다고 설명하며, 그곳에서는 다른 설정을 제안합니다.

실행을 어떻게 중지하나요?

스킬은 실행 취소를 다루며, 최신 버전에서는 Ctrl-C를, 이전 버전에서는 정리 스크립트를 쓰라고 설명합니다.

상세 정보

작성자의 원본 설명

Runs untrusted code in a throwaway smolvm microVM against a repo it must not modify, with no network unless explicitly granted, and collects artifacts from a writable output directory. Use when executing an agent's generated script, a pull request's test suite, or any code that should not be trusted with the host; when a workload needs egress granted one host at a time; or when a run has to be cancelled, because Ctrl-C on the wrapper script leaves the VM running, and on releases before v1.20.2 so does Ctrl-C on the CLI. Do not use it for a development environment that is re-entered across sess

repo: smol-machines/smolvm

인기도

GitHub 스타
6.9k
순위
#13724
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬