credentials
Skill này làm gì
Cho phép một chương trình bên trong máy ảo smolvm dùng API key của bạn trên các địa chỉ web bạn nêu, mà không bao giờ đọc được key. Nó dành cho những người có agent hoặc mã không tin cậy phải gọi các dịch vụ trả phí.
Khi nào nên dùng
- ✓Khi một agent bên trong máy cần gọi API bằng key của bạn.
- ✓Khi bạn cần biết làm sao để key không vào được máy.
- ✓Khi bạn muốn có bằng chứng rằng một bí mật chưa bao giờ đến được máy.
Liên kết skill
https://github.com/smol-machines/smolvm/blob/main/docs/credentials/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cho agent của tôi gọi API thanh toán của chúng tôi bằng key của tôi, nhưng đảm bảo key không bao giờ bị sao chép vào máy.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Máy giữ một giá trị giữ chỗ thay vì key thật. Máy chủ thay giá trị thật khi đi ra ngoài, chỉ cho các host bạn đã đặt tên, và skill kiểm tra để chắc rằng giá trị đó chưa bao giờ đi vào máy.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
A credential the machine can use and never hold
Verified on smolvm v1.29.0 on macOS arm64, 2026-10-15, and on v1.18.2 on Linux aarch64, 2026-09-24, for everything that
is decided on the host; on v1.29.0 on macOS arm64 the substituted value also arrived at a real API
that echoes the headers it received, a dummy value. Done means the guest's variable is a placeholder, the value
is nowhere in the guest, the machine's record or smolvm's database, TLS to the bound host goes
through the machine's own CA, and a placeholder anywhere but a request header is refused before it
leaves the host (from v1.27.0 a binding with :body also substitutes into a form body).
The Linux runs used the scripts of their date; this version's preflight and cleanup scripts ran
on Linux aarch64 on v1.22.2 on 2026-10-03.
docs/credential-substitution.md in the smolvm repository is how the feature works: bindings,
where the value comes from, what the guest sees, what happens to each request, and the limits.
README.md has what was measured beside it. This file is how to set it up and prove it.
Procedure
- [ ] 1. preflight.sh the flag, the network backend, the host variable
- [ ] 2. create-credentialed.sh a machine bound to one host
- [ ] 3. verify-containment.sh the value stays out; the interceptor is on the path
- [ ] 4. your own request the first call that sends the value
- [ ] 5. cleanup.sh
1. Preflight. Read-only, and it never prints the value or its length.
export API_TOKEN=... # however your secrets manager hands it over
scripts/preflight.sh --var API_TOKEN --host api.example.com
Every script here reads the value from its own environment, so keep it exported in the shell that
runs create-credentialed.sh and verify-containment.sh as well as this one.
has_credential_flag=yes
default_backend=virtio-net
tsi_stream_intercept=yes
host_var_set=yes
host_form=ok
memory_required_mib=1024
result=ready
tsi_stream_intercept is read from the symbols of the bundled libkrun: a binding selects virtio-net
by default, and --net-backend tsi carries a credential only when libkrun exports
krun_set_stream_intercept, which both v1.18.2 release libraries do. host_form=rejected means the
host is neither a lowercase DNS name nor, from v1.26.0, a wildcard such as *.example.com; create
would refuse it anyway, with a clearer message.
2. Create the machine. The value is read from the environment of this command's machine start, and that is the value the machine uses until its next start.
scripts/create-credentialed.sh --var API_TOKEN --host api.example.com
workload_ready_after_s=1
guest_sees=placeholder
binding=api-token host=api.example.com
result=up
The command it runs is smolvm machine create ... --credential api-token=API_TOKEN@api.example.com
and then machine start. --credential implies --net. In a Smolfile the same binding is a
[[network.credentials]] table, in docs/credential-substitution.md.
3. Prove the value stayed out. Nothing this sends carries the placeholder where it would be
substituted, so the value goes nowhere during the check. On an Alpine guest it adds openssl and
curl with apk, which step 4 then uses. Run it on the machine create-credentialed.sh made, before
any workload of yours runs in it: the guest search hands the value to a grep in the guest for the
length of the search, so a workload that can replace grep could read it.
scripts/verify-containment.sh --var API_TOKEN --host api.example.com --other-host example.org
guest_variable=ok (placeholder)
value_in_guest=ok (0)
value_in_record=ok (0)
interception=ok (on)
passthrough=ok (real)
query_refused=ok (403)
refusal_text=smolvm credentials: placeholders are substituted in request headers only
result=contained
value_in_guest hands the value to a grep inside the guest on standard input for the length of
the search, and looks in every process environment and the writable trees inside the guest;
value_in_record searches the machine's directory and smolvm's database on the host;
interception reads the issuer of the bound host's certificate as the guest sees it, which is
smolvm <machine> credential CA, while --other-host keeps its real issuer.
4. Use it. The workload sends the placeholder in a header, exactly where the real key would go.
smolskill-cred is the machine create-credentialed.sh makes unless you
Câu hỏi thường gặp
Có thể dùng key với những website nào?
Chỉ các host HTTPS mà bạn đặt tên khi thiết lập.
Làm sao biết key không nằm trong máy?
Skill có một kiểm tra tìm giá trị đó trong máy, trong cài đặt và trong cơ sở dữ liệu của smolvm.
Skill đã được kiểm tra trên những máy tính nào?
Skill liệt kê các máy macOS và Linux đã kiểm tra, kèm phiên bản của chúng.
Chi tiết
Mô tả gốc của tác giả
Gives a workload in a smolvm machine an API key or token it can use but never read, by binding the credential to named HTTPS hosts so the guest holds only a placeholder and the host substitutes the value on the way out, then proves on the host that the value never entered the machine. Use when an agent or untrusted code inside a machine has to call an API with your key; when deciding between a credential binding and --secret-env; when a request from a credentialed machine comes back 403 or 502 from smolvm itself; or when you need evidence that a key stayed out of a machine. Do not use it for a
repo: smol-machines/smolvm
Độ phổ biến
- Sao GitHub
- 6.9k
- Vị trí xếp hạng
- #13716
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
branch-and-checkpoint
6.9kGiúp agent của bạn lưu máy ảo smolvm đang chạy thành checkpoint, khôi phục sau này, tạm dừng, tiếp tục hoặc tách thành các bản sao.
coding-agent
6.9kGiúp agent của bạn chạy một agent lập trình như Claude Code bên trong máy ảo smolvm an toàn, với thư mục dự án của bạn được gắn vào.
dev-env
6.9kDạy agent của bạn giữ một máy phát triển smolvm với các công cụ đã cài, để nó khởi động nhanh và giữ gói phần mềm qua các phiên.
docker-in-machine
6.9kGiúp agent của bạn chạy Docker daemon bên trong máy ảo smolvm, để các bài kiểm thử, bản build và agent khởi động container có thể làm việc ở đó.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.