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 risk of mischief.

 

$ locki claude my-new-feature ← Claude Code in "skip all permissions" 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: Python, Node.js, Docker or 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. If you're on Linux, also install QEMU. For the safe sandboxed git/gh proxy, install an OpenSSH server package that provides sshd.
  3. cd to your Git repository and run:
    • Claude: locki claude my-first-sandbox
    • Gemini: locki gemini my-first-sandbox
    • Codex: locki codex my-first-sandbox
    • OpenCode: locki opencode my-first-sandbox
    • Plain shell: locki shell my-first-sandbox
  4. First start takes longer, wait a few minutes for the VM to boot.
  5. Follow prompts to log in to the AI CLI. Login will be persisted across sandboxes.
  6. 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 (mise, npm, pip, etc.)
    • Want to use custom configuration in the VM? Copy your config to ~/.locki/home, e.g. cp ~/.claude/CLAUDE.md ~/.locki/home/.claude/CLAUDE.md or cp ~/.config/opencode/opencode.json ~/.locki/home/.config/opencode/opencode.json.
    • OpenCode provider credentials should be configured interactively inside OpenCode.
  7. Once happy, commit and push your changes from host. (Sandbox does not have Git access for security reasons.)
    • Tip: VSCode will make this simple by showing worktrees in the sidebar.
    • Locki ensures that Git hooks are still executed inside the sandbox.
    • 🚧 Upcoming feature: exposing a safe subset of Git operations to the sandbox.
  8. 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 vm delete to teardown the VM. Contents of ~/.locki (worktrees, settings) will be preserved.

 

Notes on security: Locki uses a single Lima VM which can only access the ~/.locki/worktrees and ~/.locki/home (maps to ~ in sandboxes) folders. 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. Be careful when exposing credentials (like API keys) to AI agents, always be aware of the permission scope. 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.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distributions

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

locki-0.0.4-py3-none-manylinux_2_34_x86_64.whl (20.7 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

locki-0.0.4-py3-none-manylinux_2_34_aarch64.whl (18.7 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ ARM64

locki-0.0.4-py3-none-macosx_12_0_x86_64.whl (21.1 MB view details)

Uploaded Python 3macOS 12.0+ x86-64

locki-0.0.4-py3-none-macosx_12_0_arm64.whl (18.9 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

locki-0.0.4-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file locki-0.0.4.tar.gz.

File metadata

  • Download URL: locki-0.0.4.tar.gz
  • Upload date:
  • Size: 16.8 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

Hashes for locki-0.0.4.tar.gz
Algorithm Hash digest
SHA256 eaf7ba23cc810f99146c9e8a73f178d377ea4ce02c50cad8a188f81af3129f35
MD5 b08583a46bafa39e774c00c9bcd6add8
BLAKE2b-256 a76fcf468ee14d3738ecc9c7818e613ce34b3053990748fc507e8633f7a92f19

See more details on using hashes here.

File details

Details for the file locki-0.0.4-py3-none-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: locki-0.0.4-py3-none-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 20.7 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

Hashes for locki-0.0.4-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 34d67e6688d917632349940c0b80477b427392e48b710b11df9d0928c5dcca84
MD5 7a2941c54f18bf782de41ccd72a7e312
BLAKE2b-256 a3f261a970becec26dce61f03d721d4fb87729752e93f06885d4100781f8aac9

See more details on using hashes here.

File details

Details for the file locki-0.0.4-py3-none-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: locki-0.0.4-py3-none-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 18.7 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

Hashes for locki-0.0.4-py3-none-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 922a84e4790bb3e96aac2fa49c3effe866107159319506289c0bcf6edec883d1
MD5 56941e6d18fa068d2bcf86ff9ab10488
BLAKE2b-256 b4563d20dc636d2be4e5cf0e0e64fa7026406f9eeb509b425d553683ac3eecc8

See more details on using hashes here.

File details

Details for the file locki-0.0.4-py3-none-macosx_12_0_x86_64.whl.

File metadata

  • Download URL: locki-0.0.4-py3-none-macosx_12_0_x86_64.whl
  • Upload date:
  • Size: 21.1 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

Hashes for locki-0.0.4-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 6d547db16cba4c399afec8255bcfec944c67cc1cfad17664f51b977476345aff
MD5 9b61fca8347186e889c83adc5b79c3f8
BLAKE2b-256 1a1572a4218fe80801103548623cf60adbbd8585cff84187e97bd90466ab298d

See more details on using hashes here.

File details

Details for the file locki-0.0.4-py3-none-macosx_12_0_arm64.whl.

File metadata

  • Download URL: locki-0.0.4-py3-none-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 18.9 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

Hashes for locki-0.0.4-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 bf00130a997dc33cd00e75cf35bfde17c5c540a9442bd669e071e5d8a886b614
MD5 01d5af6a28ef5436085c198349695bce
BLAKE2b-256 f6e2b5272f0759b07d45d51198034afdcb91cf24ce599a6aac4815eff04a5b7f

See more details on using hashes here.

File details

Details for the file locki-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: locki-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.4 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

Hashes for locki-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 70938f5553d4913c46d4f52a65fb1ca7b7ff701e3b1f43248c759b76a2b3bf45
MD5 6a3e5d253ac2a09c2d48f4d0ced4217c
BLAKE2b-256 b9deb75c335c4a375fe8c051ed814aef745f2d420fc6abc4fed7a620e6d61b98

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