credentials
What it does
Lets a program inside a smolvm virtual machine use your API key on the web addresses you name, without ever being able to read the key. It is for people whose agents or untrusted code must call paid services.
When to use it
- ✓When an agent inside a machine needs to call an API with your key.
- ✓When you need to know how a key can stay out of a machine.
- ✓When you want proof that a secret never reached the machine.
Skill link
https://github.com/smol-machines/smolvm/blob/main/docs/credentials/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Let my agent call our payment API with my key, but make sure the key never gets copied into the machine.”
5 new skills a week. 1 minute to read.
How it works
The machine holds a placeholder instead of the real key. The host swaps in the real value on the way out, only for the hosts you named, and the skill checks that the value never entered the machine.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
FAQ
Which websites can the key be used with?
Only the HTTPS hosts you name when you set it up.
How do I know the key is not inside the machine?
The skill includes a check that searches the machine, its settings and the smolvm database for the value.
Which computers was it checked on?
The skill lists the macOS and Linux machines it was tested on, with their versions.
Details
Original description by the author
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
Popularity
- GitHub stars
- 6.9k
- Ranking position
- #13716
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
branch-and-checkpoint
6.9kHelps your agent save a running smolvm virtual machine as checkpoints, restore it later, pause and resume it, and branch it into copies.
coding-agent
6.9kHelps your agent run a coding agent such as Claude Code inside a safe smolvm virtual machine with your project folder mounted.
dev-env
6.9kTeaches your agent to keep a smolvm dev machine with its tools installed, so it restarts quickly and keeps packages across sessions.
docker-in-machine
6.9kHelps your agent run a Docker daemon inside a smolvm virtual machine, so tests, builds and agents that start containers can work there.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.