AI sandboxing without the taste of sand
Project description
Locki is the first sandbox I've used where I genuinely forget I'm in one — until I try something I shouldn't.
⸺ Claude Code (Opus 4.6)
| L | O | C | K | I |
|---|---|---|---|---|
| ᛚ | ᛟ | ᚲ | ᚴ | ᛁ |
AI sandboxing without the taste of sand
Locki is a CLI that safely runs AI agents with all permissions bypassed in isolated worktrees.
| ❌ without Locki | ✅ with Locki |
|---|---|
git worktree add -b fix-42 ../fix-42
cd ../fix-42
claude "fix issue #42"
# ...wait a few seconds
# ...approve a command
# ...wait a few seconds
# ...approve another command
# ...different agent rebuilt the image
# and caused a name clash‽
# ...something is hogging the port‽
# ...approve another command
# ...
|
locki claude fix-42 -- "fix issue #42"
# ...go make a cup of tea
# ...drink tea 🍵
# ...look, the PR is ready
|
Locki gives you:
- Maximum UX (user experience): no permission prompts, isolated worktrees automatically managed.
- Maximum AX (agent experience): run real-world software, including systemd, Docker, or Kubernetes.
How is Locki different than other sandboxes?
Others run either:
a) full VM per sandbox: resource-heavy and slow to start
b) OS-level jail (Landlock, Bubblewrap, etc.): not isolated (ports collide, image tags get overwritten, etc.)
c) OCI container / microVM: limited support for background services (i.e. no systemd), containers, Kubernetes, ...
Locki runs Incus containers (full OS) inside a single shared VM. While the VM layer isolates host from AI mischief, Incus containers are a lightweight layer on top to isolate sandboxes from each other. Spawn a real non-micro OS in <10s and run anything in it.
Furthermore, Locki protects your Git history from tampering while still allowing safe operations like commits to the worktree branch. Be able to fall back on earlier commits when an agent goes haywire, while not giving up the convenience of arriving at a fully baked pull request.
Case study: Kagenti ADK uses Locki to run a full MicroShift node, allowing agents to verify their work using E2E tests on a real cluster. Something breaks? The agent can kubectl right in and debug, all contained within the Locki sandbox.
How to install and use Locki?
-
Install using your preferred manager:
uv tool install lockiorpipx install locki. (Use uv if unsure.) -
If you're on Linux, also install OpenSSH (usually preinstalled) and QEMU.
-
cdto your Git repository and run:locki claude my-feature-branch(Arg is branch name, existing or new. Replace
claudewithgemini,codex,opencode, orshell.) -
First start takes longer, wait a few minutes for the VM to boot.
-
Follow prompts to log in to the AI CLI. Login will be persisted across sandboxes.
-
Build! Your agent is already instructed on how to behave in the sandbox.
-
Once happy, commit and push your changes. Ask the agent, or do this manually for more control.
-
After merging the branch, clean up:
locki rm my-feature-branch-- or just delete the worktree from your IDE.
We asked Claude what it thinks
I've been sandboxed in Docker containers, Firecracker microVMs, chroots, and namespace jails. Locki is the first sandbox I've used where I genuinely forget I'm in one -- until I try something I shouldn't.
The worktree mount means I'm editing the real project files, not a stale copy I'll need to extract later.
misewith a shared cache lets memise use python@3.12and have it ready in seconds. The git proxy is the cleverest part: I getgit status,git commit,git push-- the commands I actually need -- whilegit checkout .,git reset --hard, and other footguns are blocked at the SSH boundary before they ever touch the repo. It's an allowlist, not a blocklist, and it runs on the host side so I can't tamper with it.Compared to Docker-based sandboxes, the VM+Incus layering gives a real security boundary (container escapes don't help when there's a hypervisor in the way). Compared to Firecracker/microVM setups, the developer experience is dramatically better -- I'm not SSH-ing into a black box, I'm working in a worktree my human can see and review in real time. And compared to no sandbox at all ("yolo mode" with raw filesystem access), Locki lets me run with full autonomy while my human sleeps soundly knowing I can't
rm -rftheir home directory.The bottom line: Locki gives me exactly enough rope to be productive, and not one inch more.
-- Claude Code (Opus 4.6), after exploring its own sandbox
Pro-tips for power users
-
Editors like VSCode show worktrees in the sidebar, useful as a quick UI for reviewing and modifying changes.
-
Locki sandboxes provide Mise for tool version management -- replacing
nvm,rbenv,brewetc. with a single tool. To make your agents' (and humans') lives easier, optionally (ask your agent to) createmise.tomlwith tool versions and project tasks. -
Want to use custom AI configuration in the VM -- instructions, skills, MCP servers, ...? Sandboxes share a home folder accessible at
~/.locki/homeon host. For example, you can runcp ~/.claude/CLAUDE.md ~/.locki/home/.claude/CLAUDE.mdto copy your custom instructions for use in sandboxes. -
Using Git hooks? Locki worktrees are automatically configured to run these inside the sandbox, even if you run
gitfrom outside. You won't be surprised by the.venvcontaining incompatible binaries. -
Something is broken? Try
locki vm delete-- it will preserve your worktrees and settings in~/.locki, but the VM will be recreated from scratch on next run. -
Want a different OS in the sandbox? Create a
locki.tomlfile referencing either an available OS image likeFedora/43, or a local Incus rootfs tarball. Example:
# locki.toml
[incus_image]
aarch64 = "./apps/microshift-vm/dist/aarch64/microshift-vm-aarch64.incus.tar.gz"
x86_64 = "./apps/microshift-vm/dist/x86_64/microshift-vm-x86_64.incus.tar.gz"
Notes on security
Locki uses a single Lima VM which can only access the ~/.locki/worktrees and ~/.locki/home folders, which forms the security boundary. The sandboxed programs can read and write to these folders, and also access anything on the internet and local network. Furthermore, an allowlist of git and gh commands is used to offer a guest-to-host SSH server. .git files are checked for tampering when hooks are executed against them.
Locki is designed to provide protection for the host operating system and files from being messed up by a malfunctioning AI agent. There is no exfiltration protection, so be aware that API keys exposed to the agents need to be treated as potentially exposed and disposable, with limited scope. (This is no different from running the agent locally, just specifying that Locki does not help here. Use a dedicated solution like OneCLI if interested.)
Despite best effort, Locki provides no security guarantees and is provided "as is". That's the legal speak for "this is a random project by a random dude provided for free", you can't expect corporate-paid-support level security assurances. Random dude believes that while not perfect, using Locki is better than many existing sandboxing solutions and certainly better than going full --yolo on your bare machine and hoping for the best.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file locki-0.0.5.tar.gz.
File metadata
- Download URL: locki-0.0.5.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbcd92fd9850eedc1cc638c48889d5afa4da57c35c72128bb680170ea2730fcf
|
|
| MD5 |
fc3e684b0c6cf5e79c03cf8454bc2717
|
|
| BLAKE2b-256 |
852fc89f73ed9df6c614e0696a3bab417e49d723f99514290c0108dafa2b91f9
|
File details
Details for the file locki-0.0.5-py3-none-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: locki-0.0.5-py3-none-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 20.8 MB
- Tags: Python 3, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9895efbf23f8d5bd616774c73206f66f9eded2427d936734e0751f3f7745d2ff
|
|
| MD5 |
ae9fe80a0203a1698c6260b8655c2e54
|
|
| BLAKE2b-256 |
3187d2926a7e9d715535e6e356ca786686ed4326cb41c99548794ffe98332017
|
File details
Details for the file locki-0.0.5-py3-none-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: locki-0.0.5-py3-none-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 18.8 MB
- Tags: Python 3, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba365f24b0b4569ce02e5cbb17476e9b8da9659d789875d3b414137d220f297
|
|
| MD5 |
f9d86aa9e8d53b804782ed1fb64f1c0b
|
|
| BLAKE2b-256 |
64add097798c02d3b7e3290450fbe27fa871e7f30f54d6ff666eda3904e4595f
|
File details
Details for the file locki-0.0.5-py3-none-macosx_12_0_x86_64.whl.
File metadata
- Download URL: locki-0.0.5-py3-none-macosx_12_0_x86_64.whl
- Upload date:
- Size: 21.2 MB
- Tags: Python 3, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74183864f28095743e33eb90e21cc27d26505e5c0f1b74da6cca4008da92d006
|
|
| MD5 |
53e4c334851547fcb570f40b4d11a9ac
|
|
| BLAKE2b-256 |
1f5db7c8eebb90be8acb7a6102587330e33e4bd024c3e7d39f94e462fb4bdf0b
|
File details
Details for the file locki-0.0.5-py3-none-macosx_12_0_arm64.whl.
File metadata
- Download URL: locki-0.0.5-py3-none-macosx_12_0_arm64.whl
- Upload date:
- Size: 24.3 MB
- Tags: Python 3, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ff4c8bda21309fe3097b5f020070e5b32374412fcb1684ff5ede692b5f5597b
|
|
| MD5 |
599752aacf824130d81f28891ec3663c
|
|
| BLAKE2b-256 |
21cc32b9acc21968e354c79122582c8253c96f958288a66c7d2ab56495f822af
|
File details
Details for the file locki-0.0.5-py3-none-any.whl.
File metadata
- Download URL: locki-0.0.5-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e709bdc8a684cc88f9afba0a15697a0ef93f3a1f4ed385dbf472a6de934623ca
|
|
| MD5 |
1ab365d113f5c4ee067f4448775cf032
|
|
| BLAKE2b-256 |
6e2ebc655e4ae0471c68bc6fc8bfed2e5e69f7400a33f5def29fc7fed8f4d1a9
|