Lock down agents in a VM, enabling mischief without consequences
Project description
🔒🐍 Locki
AI sandboxing for real-world projects
Locki is a CLI tool for Linux and macOS that allows running multiple AI agents in "yolo mode", without any interference or security risks.
locki claude my-new-feature # <- Claude CLI in "skip all permission" mode opens in a fresh sandbox
How is Locki different than other sandboxes?
- VM-based security -- Locki sandboxes are enclosed in a Lima VM. Nothing gets executed on host. Only raw code leaves the VM.
- LXC-based environment -- Run anything, like Docker and even full Kubernetes in the Locki sandboxes.
- Worktree-based convenience -- Browse worktree files locally. See agent's changes natively in VSCode sidebar.
How to use?
- Install using your preferred manager:
uv tool install lockipipx install lockimise use -g pipx:locki
cdto your Git repository and run:locki claude my-first-sandbox- Replace
claudewithshellto open a regular shell session.
- Replace
- First start takes longer, wait a few minutes for the VM to boot.
- Follow prompts to log in to Claude Code CLI.
- Browser won't open. Click the link or press
cto copy instead. - Login will be persisted across sandboxes.
- Browser won't open. Click the link or press
- Build!
- Agent is instructed to start by setting up project tools. This may take a bit of time. Subsequent sandbox installs will be much faster due to shared cache for most common dependency managers (
npm,pip, etc.) - Want to configure Claude Code CLI? Copy your config from
~/.claudeto~/.locki/claudeto use it in the VM!
- Agent is instructed to start by setting up project tools. This may take a bit of time. Subsequent sandbox installs will be much faster due to shared cache for most common dependency managers (
- Once happy, commit and push your changes from host. (Sandbox does not have Git access for security reasons.)
- Locki ensures that Git hooks are still executed inside the sandbox.
- 🚧 Upcoming feature: MCP server exposing a safe subset of Git operations to the sandbox.
- After merging the branch, remove the sandbox using:
locki remove my-first-sandbox.- If you manually remove the worktree, Locki will eventually detect this and remove the sandbox too.
In trouble? Or need to uninstall Locki? Run locki factory-reset to teardown the VM.
Notes on security: Locki uses a single Lima VM which is set to only share the ~/.locki/worktrees folder. Each worktree has an associated LXC container (through Incus). LXC containers are not a security boundary (more so that Locki pokes holes in them for caching etc.), the shared VM is -- thus the only possible vector of escape is the source code written into a worktree. In order to protect Git hook execution, Locki configures the worktree to use Locki-managed hooks that offload execution of parent repo hooks into the sandbox, and checks for .git file tampering. Despite best effort, Locki provides no security guarantees and is provided "as is".
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 Distribution
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.2.tar.gz.
File metadata
- Download URL: locki-0.0.2.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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 |
20b9da54edf9f385ee468c72a18a48636dd603f523fde27fdc43d0c027c47612
|
|
| MD5 |
48ed8c9859e6006b305ffec2323297b9
|
|
| BLAKE2b-256 |
39936f7ccdc2084f5f97f4bb3d94cfe54b7905a3da0631b3eb9a84e5203c3380
|
File details
Details for the file locki-0.0.2-py3-none-any.whl.
File metadata
- Download URL: locki-0.0.2-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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 |
8de2ee14fb8022c75e500a071c07857b305d5dd6cff6a1397437bc5984c58e81
|
|
| MD5 |
b71d535a1f75a8c63eeaa0f27f04e643
|
|
| BLAKE2b-256 |
da77d2b667b8098becac0c3f29850ee2d4a19d3994fcc1964e4e1a7341c91195
|