Laguarde

dev.futur-panda由 futur-panda.dev 发布v0.3.2更新于 Oct 28, 2026

Self-hostable policy control plane for AI coding agents.

概览

AI 生成的概览

可自托管的策略控制平面,让 AI 编码代理获取项目策略、评估拟执行动作,并把决策记录为审计证据。

可以做什么
  • 获取当前项目策略包及其不可变的修订版本号
  • 针对确切拟执行的动作预览边界判定(允许、受限、需审批、禁止)
  • 重新评估并把决策持久化为 SQLite 记录与 Markdown 证据
  • 列出并提交开发者偏好提案,交由人工审核与批准
  • 通过本地仪表盘和 REST API 管理策略、审阅决策、批准反馈
适用场景
适合希望让编码代理在执行前对照团队共享的代码规则、通用护栏、项目初始化配方和 PR 评审准则进行自查,并保留可审计的放行理由的团队。前提是代理愿意配合,且宿主环境能把该决策服务当作强制关卡。
运行要求
以本地守护进程方式运行,通过 npm 包 laguarde-mcp 启动,需要 Node.js 24 或更高版本;需注册当前 Git 仓库以获得项目专属 MCP 地址。守护进程监听本机 3000 端口,数据默认存放在 ~/.laguarde,可通过 LAGUARDE_DATA_DIR、LAGUARDE_DB_PATH 和 LAGUARDE_EVIDENCE_DIR 更改位置。
安装前请注意
策略只是建议性的:不配合的代理仍可绕过 Laguarde 使用其他工具,真正的强制需要接入执行钩子、沙箱、文件系统权限或 CI 关卡。README 说明带认证的团队层级与审批绑定仍在计划中。决策与证据会写入本地 SQLite 数据库和 Markdown 文件,请把数据目录放在合适位置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Laguarde,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Laguarde

[skills.sh]

Laguarde is a self-hostable policy control plane for AI coding agents.

It gives a team one persistent place to define engineering practices, evaluate agent actions, ratify recurring developer preferences, and retain the exact policy revisions behind important decisions.

Laguarde runs locally for one developer or behind a team URL. Agents interact with the same server through standard MCP; humans use the dashboard and REST API.

What the prototype proves

  • Four policy categories: code rules, general guardrails, project initialization recipes, and PR review guidelines.
  • Four decisions: allowed, limited, approval, and forbidden.
  • Context-specific policy bundles with immutable revision identifiers.
  • One local daemon with a persistent registry of projects and Git origins.
  • Fail-safe action evaluation: an unmatched action is limited, not silently allowed.
  • Human approval for dependency, migration, deletion, and authentication actions.
  • SQLite decision records plus human-readable Markdown evidence.
  • Developer feedback convergence: a human may merge any proposal immediately; three observations promote it as a stronger candidate.
  • A dashboard for policy CRUD, decision evaluation/review, and feedback ratification.

Quick start

For a local MCP installation, use Node.js 24 or newer:

bash
npx -y --package [email protected] laguarde-daemon ensurenpx -y --package [email protected] laguarde-daemon register --cwd .

The first command reuses the healthy local daemon or starts it once. The second registers the current Git repository and prints its project-specific MCP URL. All local projects share the daemon, dashboard, SQLite database, and audit history while remaining separately identifiable.

Conceptual MCP configuration:

json
{  "mcpServers": {    "laguarde": {      "type": "http",      "url": "http://127.0.0.1:3000/mcp/projects/RETURNED_PROJECT_ID"    }  }}

For repository development, install Bun and run:

bash
bun installbun run buildbun run start

Project HTTP MCP endpoints live under http://localhost:3000/mcp/projects/:projectId, and agent-facing discovery is available at http://localhost:3000/llms.txt.

Onboarding surfaces:

  • human guide: http://localhost:3000/guide;
  • agent self-setup contract: http://localhost:3000/install (text/plain).

To onboard a capable agent, send it the /install URL and explicitly ask it to connect Laguarde for the current project. The contract tells it how to verify the server, make a minimal native MCP configuration change, discover the tools, and load the registered project's policy bundle.

Agent policy-gate skill

Install the optional fail-closed skill from this repository with:

bash
npx skills add https://github.com/FuturPanda/laguarde --skill laguarde-policy-gate

The skill requires a cooperative agent to load the project-bound Laguarde policy bundle, evaluate and record every material action, and stop when policy is unavailable, limited, approval-required, or forbidden. It does not replace a sandbox or host-level execution hook.

For S3/CloudFront onboarding, generate the two static upload objects with:

bash
bun run export:onboarding

See docs/s3-onboarding.md.

MCP Registry publication is automated through GitHub Actions after a one-time DNS authentication setup. See docs/registry-publishing.md.

The daemon's first start creates ~/.laguarde/laguarde.db, seeds global policy, and adds ten policies. Set LAGUARDE_DATA_DIR, or the more specific LAGUARDE_DB_PATH and LAGUARDE_EVIDENCE_DIR, to place persistent data elsewhere.

Agent workflow

  1. get_policy_bundle retrieves the current policies and their revision IDs.
  2. evaluate_action previews the boundary decision for an exact intended action.
  3. record_decision re-evaluates and persists that action as evidence.
  4. The agent proceeds only when allowed, narrows a limited request, waits for approval, or stops when forbidden.
  5. list_preference_proposals and propose_preference turn reusable developer corrections into a human review queue.

See usage instructions for tool inputs and concrete calls.

Architecture

mermaid
flowchart LR  A[Agent / IDE] -->|MCP| M[Laguarde server]  H[Human dashboard] -->|REST| M  M --> J[Project registry]  M --> P[Policy evaluation]  P --> D[(SQLite)]  P --> E[Markdown evidence]  F[Developer feedback] --> Q[Proposal convergence]  Q -->|review at any time| H  Q -.->|3 observations promote priority| Q  H -->|ratify| R[Immutable policy revision]  R --> D

The published CLI uses Node.js, TypeScript, Express, SQLite, and the standard MCP SDK. Bun remains the repository's development and test runner. Policy types share one revisioned model, while category-specific configuration is stored in fields.

Important enforcement boundary

MCP connectivity makes policies discoverable and decisions auditable, but it does not technically prevent an uncooperative agent from using tools outside Laguarde. Hard enforcement requires Laguarde decisions to be wired into an execution hook, command proxy, sandbox, filesystem permissions, or CI gate.

This prototype is therefore an enforceable decision service, but only an advisory boundary until the host agent or execution environment uses it as a mandatory gate.

Repository guide

  • src/ — policy engine, persistence, REST API, and MCP tools.
  • public/ — human dashboard.
  • llms.txt — agent-facing discovery and operating contract.
  • examples/ — bootstrap, control-boundary, and feedback demos.
  • docs/ — installation, usage, decisions, and current limits.
  • test/ — executable behavior specification.

Verification

bash
bun testbun run typecheckbun run build

Next engineering milestones

  1. Add authenticated organization/team/project hierarchy and explicit policy precedence.
  2. Add an execution adapter that verifies approval immediately before an agent tool call.
  3. Bind approvals to an exact action digest and expiry.
  4. Add database migrations and production persistence adapters.
  5. Add static code/diff inspection rather than relying only on declared action metadata.

来源:README.md,提交 6da49be

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。