| title | LidLift: Pre-Execution Tool-Fit Guardrails for MCP Agents | ||||
|---|---|---|---|---|---|
| authors | Igor Holt | ||||
| date | 2026-04-15 | ||||
| arxiv | |||||
| tags |
|
||||
| layout | modern |
Igor Holt
2026-04-15
LidLift is a production tool-routing safety layer for MCP-based agents. It scores prompt-to-tool fit before execution, converts that score into one of four operator-facing decisions (allow, review, clarify, or block), and exposes the same analyzer through both a web console and a remote MCP endpoint. This note summarizes the problem class, the decision model, the runtime split, and the operational lessons from shipping the system on public domains.
Tool-enabled agents fail in a specific and expensive way: they often select a tool that is structurally compatible with the prompt even when the tool is semantically wrong for the user intent. In practice, that means a read intent can drift into a write tool, a documentation lookup can drift into repository mutation, or an exploratory task can drift into a destructive API call.
LidLift addresses that failure mode before execution rather than after tracing. The system does not try to replace the model. It adds a deterministic guardrail layer in front of tool invocation.
The problem is not only whether a model can call tools. The harder problem is whether it should call a given tool at all.
Three patterns matter most:
- Irrelevant tool selection when a model can still fill the arguments.
- Overlapping tool catalogs where several tools look superficially valid.
- Read versus write mismatches where the selected tool carries materially higher operational risk than the user intent requires.
The product goal is therefore simple: reject the wrong tool early, rank the safer alternatives, and make that decision legible to both humans and agents.
LidLift evaluates prompt-tool fit in a shared core package and emits:
alignmentScoredissonanceScoreriskLevelguardrailDecisionguardrailReasonrecommendation
The decision model uses four gates:
allowwhen the tool is a strong fit and the operational mode matches the prompt.reviewwhen the tool may work but carries meaningful mismatch or risk signals.clarifywhen the prompt lacks enough specificity to justify execution.blockwhen the tool is operationally wrong, especially for read-versus-write conflicts.
This matters because a ranked list alone is not enough. Operators and external agents need an explicit pre-execution control surface, not just a softer recommendation.
LidLift ships as a split runtime:
packages/core: shared heuristics, schemas, and ranking logicapps/web: Next.js operator console on Vercelworkers/mcp: Cloudflare Worker exposing remote MCP tools on/mcp
The same analyzer is reused across:
- the browser console
- the web API (
/api/analyze) - the MCP tools (
analyze_tool_fit,rank_tools)
That shared contract keeps human review and agent integration aligned.
The public deployment is live at:
- Web console:
https://lidlift.optimizationinversion.com - API health:
https://api.optimizationinversion.com/health - MCP endpoint:
https://api.optimizationinversion.com/mcp
Two operational lessons were especially important:
- Public launch assets must match the real domains. Stale preview or
workers.devURLs create avoidable trust and onboarding failures. - The MCP server lifecycle must match the runtime model. In a stateless Cloudflare Worker, the
McpServerinstance must be created per request; reusing a singleton across transports causes production failures.
The current production stack was validated with:
pnpm --filter web lintpnpm buildpnpm --filter mcp testpnpm --filter mcp check
The live checks that matter are:
GET /healthon the web appGET /healthon the MCP WorkerGET /mcpwithAccept: text/event-stream
These checks verify both the operator surface and the external agent surface.
LidLift is deliberately narrow.
- It is a pre-execution control layer, not a full trace/observability platform.
- It does not yet include a benchmark harness published with public scoreboards.
- The optional narrative layer now runs through the Vercel AI SDK and AI Gateway; local development needs
AI_GATEWAY_API_KEY, while Vercel deployments can use OIDC-backed auth. - Hugging Face publication is not yet live because there is no paper page or Hub-authenticated publication flow configured in this repository.
LidLift shows that the highest-leverage safety improvement for tool-using agents is often not better post-hoc analysis, but a stricter decision before execution. By exposing that decision as a shared contract across web, API, and MCP surfaces, the product turns tool-choice quality into an explicit control plane instead of an implicit model behavior.
The next step is straightforward: publish a benchmark-backed evaluation layer around the guardrail decisions and connect the public research artifact to the live product surface.