Skip to main content

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?

  1. Install using your preferred manager:
    • uv tool install locki
    • pipx install locki
    • mise use -g pipx:locki
  2. cd to your Git repository and run: locki claude my-first-sandbox
    • Replace claude with shell to open a regular shell session.
  3. First start takes longer, wait a few minutes for the VM to boot.
  4. Follow prompts to log in to Claude Code CLI.
    • Browser won't open. Click the link or press c to copy instead.
    • Login will be persisted across sandboxes.
  5. 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 ~/.claude to ~/.locki/claude to use it in the VM!
  6. 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.
  7. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

locki-0.0.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

locki-0.0.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

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

Hashes for locki-0.0.2.tar.gz
Algorithm Hash digest
SHA256 20b9da54edf9f385ee468c72a18a48636dd603f523fde27fdc43d0c027c47612
MD5 48ed8c9859e6006b305ffec2323297b9
BLAKE2b-256 39936f7ccdc2084f5f97f4bb3d94cfe54b7905a3da0631b3eb9a84e5203c3380

See more details on using hashes here.

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

Hashes for locki-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8de2ee14fb8022c75e500a071c07857b305d5dd6cff6a1397437bc5984c58e81
MD5 b71d535a1f75a8c63eeaa0f27f04e643
BLAKE2b-256 da77d2b667b8098becac0c3f29850ee2d4a19d3994fcc1964e4e1a7341c91195

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page