
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.
概覽
本機技能路由器與提示注入防火牆,只把當前任務真正需要的少數技能、MCP 伺服器與工具提供給 AI 編碼代理。
- 可以做什麼
- 把任務路由到一組互補的技能、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 分
請在儲存庫或註冊中心條目中宣告授權條款。