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 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.
  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
    • 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.
  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 factory-reset to teardown the VM.

 

Notes on security: Locki uses a single Lima VM which is set to only share the ~/.locki/worktrees and ~/.locki/home 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. 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.3.tar.gz (16.2 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.3-py3-none-manylinux_2_34_x86_64.whl (20.7 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ ARM64

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

Uploaded Python 3macOS 12.0+ x86-64

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

Uploaded Python 3macOS 12.0+ ARM64

locki-0.0.3-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: locki-0.0.3.tar.gz
  • Upload date:
  • Size: 16.2 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.3.tar.gz
Algorithm Hash digest
SHA256 94b4298d19f35e34caaf6c792f75dd69962f930f8152b49e8fc9a4cb3be72c07
MD5 b33a9222833ccda23e4e4667723feca5
BLAKE2b-256 b592e7e7fc92a8355edf53a74ee965dfb1455ff7d7a2f974cf0622220b955a9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: locki-0.0.3-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.3-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9480a2e70276418573ed305ef985ed2e64eb17b19abd65bb88d1ffe7ec2e2eb6
MD5 c788febdf9376df21df9b1bba20c86c8
BLAKE2b-256 47d32678714431eb7b4bc71ca9175b3b0a5f53df93bf0b90acd8848337b283a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: locki-0.0.3-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.3-py3-none-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 9eed7fa810caa67bc281da846ef96917f7f9d616b818879f93665159cc224e22
MD5 6f90d09415687fc7373ebd262d7dde0a
BLAKE2b-256 1fca4c1e8f13ca0a6d88c2c5e26f05c63a6c05c9806716f275292667704011ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: locki-0.0.3-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.3-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 224014ae87cd003ee8d0bd3fe576a8d8463f1ae20f20598c7330bea795e5cc76
MD5 9761a88711ee7246e9e883b399797014
BLAKE2b-256 7a9701c93112c8235c544f54a2c789471b9d5816b230fadc1dacc599beb857a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: locki-0.0.3-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.3-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 19664faf876142554c1d0600459c6a9a08415b2975c78f17d26fd3607bd9a9ba
MD5 42ea21b7cf09ebb1d21608ef7ae4f750
BLAKE2b-256 4bcca479cf245264270f10084a588aa7cca36e7f16ebab7d97ee1aecb2fa0326

See more details on using hashes here.

File details

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

File metadata

  • Download URL: locki-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 68e893b875f2eba1e038cf8cec2ebc4e137fbcb58c0df0bd2d4d684fbd919944
MD5 5b15b72126ddd7d62d96b929332b37b3
BLAKE2b-256 0fc3325af01e41af4f957b4e715d157a4820245e3c3f8e336ddb55ed85caa6f5

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