
Lockkeeper
io.github.Hannay001由 GitHub 账号 Hannay001 发布v1.4.0更新于 Oct 24, 2026
Routes each task to the few skills, MCP servers and tools that fit it.
概览
本地技能路由器与提示注入防火墙,为 AI 编程代理只提供当前任务真正需要的少量技能、MCP 服务器和工具。
- 可以做什么
- 把任务路由到一小组互补的技能、MCP 服务器、工具和代理,并给出需要读取的确切文件
- 在本地索引中搜索各代理已安装的能力
- 审计技能、插件和 MCP 配置中的提示注入、数据外泄和隐藏载荷,给出 clean、suspect 或 hostile 结论
- 索引已安装的技能、代理、命令、MCP 服务器和插件,并报告每个代理拥有的数量
- 可选通过 Claude Code 钩子实时拦截恶意工具调用
- 适用场景
- 适合代理安装了大量技能、插件和 MCP 服务器,导致上下文窗口被占满或经常选错工具的情况。也适合在安装第三方技能前检查是否存在提示注入。
- 运行要求
- 以 stdio 本地进程运行;需要 macOS、Linux 或 Windows 上的 Python 3.11 及以上,从 PyPI 安装(pipx、pip 或 uv),并用 lockkeeper mcp 命令启动。核心功能不需要 API 密钥、GPU 或云服务。
安装
在 SourceWeft 中
- 打开 控制台中的 Lockkeeper,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[Lockkeeper]
The skill router and prompt-injection firewall for AI coding agents
Give Claude Code, Codex, Cursor and other AI agents the few skills, MCP servers and tools that fit each task, instead of all of them.
Smaller context window, better tool choices, and no unvetted skill instructions reaching your agent.
[PyPI version] [tests] [Python 3.11+] [zero dependencies] [macOS, Linux, Windows] [License: FSL-1.1-ALv2]
Quickstart · Ways to use it · Benchmark · Firewall · FAQ · Docs
What is Lockkeeper?
AI coding agents get better with skills (SKILL.md files), MCP servers, plugins and tools. But every one you install adds to what the agent has to read and choose from. With hundreds installed, your context window fills up before work starts, and the agent often picks the wrong skill or none at all.
Lockkeeper is a local skill router. It indexes everything installed across all your agents, and for each task it hands the agent a small, complementary set, up to 10 capabilities by default (you choose the size), with the exact file to read for each. Before anything reaches your agent, its built-in firewall can check skills and live tool calls for prompt injection.
[Lockkeeper routing a payment-webhook audit task to two primary skills in the terminal]
Why developers use Lockkeeper
- 🎯 Better skill choices. On a public benchmark of real agent tasks, Lockkeeper ranks a correct skill first 65% of the time among 26,000 real skills (up from 35%) and 55% among 79,000, no model required. See the benchmark.
- 📉 A context window that stays small. With 58,018 capabilities in the library, a routed task still carries a median of about 8,700 tokens of skills instead of about 77.5 million. Adding skills to the library doesn't grow your prompt.
- 🛡 Safer skills and plugins. Scan any skill, plugin or MCP config for hidden instructions and data exfiltration before your agent reads it, and block hostile tool calls live.
- 🔌 Works where you already work. Automatic routing in Claude Code, an MCP server for Codex, Cursor, Windsurf, Cline and other clients, and a CLI for everything else.
- 🔒 Local, private and dependency-free. Pure Python standard library. No GPU, API key or cloud service needed. Telemetry is off unless you say yes.
Quickstart
1. Install from PyPI (Python 3.11+, macOS, Linux and Windows):
Only want the router skill? npx skills add Hannay001/lockkeeper installs it for any agent (it needs the lockkeeper command too). Prefer not to use a terminal? Paste the prompt in PROMPT.md into the AI agent you already use; it installs and configures Lockkeeper for you. Working from source? git clone https://github.com/Hannay001/lockkeeper.git && cd lockkeeper && ./install.sh
2. Index what you have installed:
3. Route a task:
Then pick how your agent should use it, below.
Four ways to use Lockkeeper
1. Route every prompt automatically (Claude Code)
Install the Claude Code plugin (after pipx install lockkeeper). Inside Claude Code:
It adds the routing hook, the MCP server and the router skill in one step. Prefer settings files? lockkeeper hooks install claude adds just the hook (use one or the other, not both).
Every prompt you send now reaches Claude Code with a short note naming the installed skills that fit it and the exact files to read. Slash commands and short replies like "thanks" pass through untouched, and the hook never blocks a prompt. Undo with lockkeeper hooks remove claude.
Then shrink the list Claude Code loads into every session:
Claude Code puts the name and description of every skill in ~/.claude/skills into each session. Library mode moves them to a folder Lockkeeper indexes but Claude Code doesn't load, so only the skills a prompt needs reach the context. Keep favorites where they are with --keep NAME.
2. As an MCP server (Codex, Cursor, Windsurf, Cline and any MCP client)
lockkeeper mcp gives your agent three tools, route, search and audit, and keeps the index loaded between calls so answers are fast.
The JSON form works for Cursor (~/.cursor/mcp.json), Windsurf, Cline and most other clients. Lockkeeper is also listed in the official MCP Registry (MCP Registry name: mcp-name: io.github.Hannay001/lockkeeper).
3. From the command line and scripts
4. As a firewall for skills and plugins
Supported agents
Lockkeeper reads the formats you already use: SKILL.md Agent Skills, agents and commands in Markdown, plugin manifests, and MCP server configs. The installer also detects agent tools it doesn't know by name.
Proven on a public benchmark
Routing claims should be measurable. Lockkeeper is tested against SkillRouter Eval Core, the public benchmark from the SkillRouter paper (arXiv:2603.22455): 75 real agent tasks with known correct skills, hidden among real SKILL.md files from public repositories, including 780 deliberately misleading look-alikes.
On the full pool, Lockkeeper's standard-library ranker scores between the paper's general-purpose embedding models (Qwen3-Embedding-0.6B at 53.3%, Gemini embedding at 56.0%) and roughly double its BM25 keyword baseline (28.0%), without loading a model. Methods, per-change results and caveats: docs/BENCHMARK.md.
Reproduce it yourself (downloads the ~400 MB dataset once):
Your prompt stays flat as your library grows. On the 79,141-skill benchmark pool (about 157M tokens of skill text), six everyday tasks each routed to 10 capabilities: a median of about 16,000 tokens even if the agent reads every one, over 99.98% kept out of context. The 26,000-skill pool gave about the same (17,600). Reproduce with python3 scripts/bench_context_savings.py.
How it works
- One index for every agent on your machine, deduplicated, and refreshed automatically when you install, remove or update a skill.
- Reads what each skill is about, not just its one-line description: the most distinctive words of every skill's body are indexed at rebuild.
- Bundles, not long lists. A route fills complementary roles (primary method, context, integration, verification, support), then tops up with close matches only, never past your bundle size (10 by default, 3 to 20).
- Optional upgrades, never required: an embedding sidecar for semantic re-ranking, and a decision-model stage (for example Laya or a cross-encoder) that starts in shadow mode so you can measure it before trusting it.
Prompt-injection firewall for skills and MCP
Skills and plugins are instructions your agent follows. Lockkeeper's scanner finds text that tries to override the agent, commands that send secrets or files to the network, credential-store access, code that decodes and runs hidden payloads, destructive commands, and invisible Unicode, across Markdown, configs and scripts.
- CI-ready verdicts:
clean,suspect,hostilewith exit codes 0, 1, 2. - Live protection: a Claude Code hook blocks hostile tool calls before they run.
- Evidence: signed receipts prove what was scanned and that results weren't altered.
- Optional: dependency CVE checks against osv.dev, and a second-pass LLM review.
Full details: docs/FIREWALL.md.
How Lockkeeper compares
FAQ
How do I stop too many skills from filling my Claude Code context window?
Run lockkeeper hooks install claude, then lockkeeper library move --apply. The first makes each prompt arrive with the few skills that fit it; the second moves your skills out of ~/.claude/skills into a library Lockkeeper indexes but Claude Code doesn't load, so their descriptions stop filling every session. lockkeeper library move without --apply shows the plan first, --keep NAME leaves favorites in place, and lockkeeper library restore --apply undoes it.
Does Lockkeeper work with MCP servers?
Both ways. It indexes the MCP servers and tools your agents have configured and routes to them, and it is itself an MCP server (lockkeeper mcp) that Codex, Cursor, Windsurf, Cline and other clients can call.
How do I check a skill from GitHub for prompt injection before installing it?
Run lockkeeper audit path/to/skill --recursive --strict. A hostile verdict (exit code 2) means don't install it. See docs/FIREWALL.md.
Does Lockkeeper send my prompts or code anywhere?
No. Routing, indexing and auditing run locally. The only network features are opt-in: the osv.dev dependency check, the LLM scan, remote decision providers, and the optional embedding sidecar, which downloads its model once.
Is there telemetry?
Only if you say yes. lockkeeper init and lockkeeper hooks install ask once, in your terminal (never in scripts or CI), and lockkeeper telemetry on|off changes your answer at any time. It shares anonymous daily counts (which commands ran and how fast), never prompts, skill names or file paths, and DO_NOT_TRACK=1 always turns it off. See docs/TELEMETRY.md.
Is Lockkeeper free to use?
Yes, for you and your company, including at work and on commercial projects: use it, change it and share it. What the Functional Source License (FSL-1.1-ALv2) doesn't allow is offering Lockkeeper, or a product built from it, to others as a commercial product or service that competes with it. Each release becomes Apache 2.0 two years after it ships, and versions up to 1.2.0 remain under the MIT license.
Do I need a GPU, an API key or an embedding model?
No. The core uses only the Python standard library. Embeddings and decision models are optional add-ons.
How many skills can Lockkeeper handle?
It's tested with up to 79,141 skills. At typical sizes (hundreds to a few thousand) routing and re-indexing take well under a second to a few seconds.
Will it choose worse skills than my agent would on its own?
Measure it: scripts/bench_routing.py runs the public benchmark, and scripts/eval_decision.py evaluates labeled tasks from your own history.
Documentation
Contributing
Issues, ideas and pull requests are welcome. To run the tests:
By submitting a pull request, you agree to license your contribution under the project's license.
Found a security issue or a way past the firewall? Please report it privately per SECURITY.md.
Built and maintained by Himanshu (@Hannay001) · Functional Source License (FSL-1.1-ALv2)
If Lockkeeper saves you context or catches something nasty, a ⭐ helps other developers find it.
来源:README.md,提交 291ba43
工具
0版本历史
1- v1.4.0最新Sep 27, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。