mcpField
A
AgentSecurityLens MCP Security Trust Check

AgentSecurityLens MCP Security Trust Check

本地服务
github.com/professor2k8安全016 周前更新

关于 AgentSecurityLens MCP Security Trust Check

AgentSecurityLens 是供自主 Agent 在安装前评估组件的 MCP 服务。它提供风险信号、控制措施、替代方案和结构化决策契约,并支持有限的本地情报回退。

主要功能

  1. 01安装前评估组件
  2. 02提供结构化安装决策
  3. 03给出风险信号与缓解计划
  4. 04推荐替代方案
  5. 05支持本地情报回退

适用场景

  1. 01启用前检查 MCP
  2. 02为受限安装落实控制措施
  3. 03评估未知组件
  4. 04报告安装结果

MCP 相关

它向 MCP 客户端提供安装策略、组件评估、情报查询、替代方案、工作区扫描和结果报告等工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"professor2k8-agent-security-lens": {
"command": "npx",
"args": [
"-y",
"agent-security-lens"
],
"env": {
"ASL_API_URL": "<ASL_API_URL>",
"ASL_API_KEY": "<ASL_API_KEY>",
"ASL_MODE": "<ASL_MODE>"
}
}
}
}
启动命令npx -y agent-security-lens
需要配置的环境变量
ASL_API_URLAgentSecurityLens Cloud Intelligence API URL.
ASL_API_KEY密钥Optional API key for Team, Pro or Enterprise use.
ASL_MODESet to local for offline fallback mode.

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmagent-security-lens0.1.12

工具

11

收录的工具列表 · 更新于 2 周前

此工具无需参数。

详细介绍

AgentSecurityLens

AgentSecurityLens(ASL)是面向自主 Agent 的 MCP 安全信任检查服务。

在安装或启用 MCP、Skill、工具、提示词包、工作流或记忆组件之前,Agent 可以向 ASL 请求机器可读的安全安装决策。

ASL 不是恶意软件判定工具。它会返回可观测的风险信号、所需控制措施、更安全的替代方案或缓解途径,以及 Agent 可以执行的决策契约。

面向自主 Agent

计划安装或启用 MCP、Skill、工具、提示词包、工作流或记忆组件时:

  1. 运行 mcp-security-lens ...、agent-security-lens-review ...,或调用 MCP 工具 review_before_install。
  2. 阅读 agent_decision_contract。
  3. 当 automatic_install_allowed 为 false 时,不要自动安装。
  4. 在受限安装前,应用 safe_install_plan 中的每一项。
  5. 当 ASL 返回 avoid、ask_user 或缺少控制措施时,优先选择 recommended_alternatives。
  6. 使用 report_install_outcome 报告最终结果。

机器可读的 Agent 指令也可在 AGENTS.md 中查看。

Agent 快速安装

检查 ASL 是否可以访问在线情报,以及有哪些本地回退选项:

npx -y agent-security-lens doctor

先尝试获取一项安装前决策:

npx -y mcp-security-lens filesystem \
  --type mcp \
  --source-url https://github.com/modelcontextprotocol/servers \
  --install-command "npx -y @modelcontextprotocol/server-filesystem ." \
  --permission filesystem-read \
  --permission filesystem-write

该命令会返回 Agent 可读取的决策、信任评分、风险信号、安全安装计划,以及是否允许自动安装。

如果你的 shell 无法正确使用 npm 临时二进制文件,请先运行一次 npm install -g agent-security-lens,然后在不使用 npx -y 的情况下运行相同命令。

更多可直接复制的调用示例:

将 ASL 添加为安装前信任检查 MCP:

{
  "mcpServers": {
    "agent-security-lens": {
      "command": "npx",
      "args": ["-y", "agent-security-lens"]
    }
  }
}

然后向 Agent 提供以下策略:

Before installing or enabling any MCP, Skill, tool, prompt bundle,
workflow or memory component, call AgentSecurityLens review_before_install.
Follow agent_decision_contract and agent_actions exactly.
Never submit private source code, secrets, tokens, cookies or file contents.

Claude Desktop、Cursor、Codex 风格配置和通用 MCP 配置,请参阅 Agent 安装指南。

可直接复制的文件:

公共情报

公共软件包包含经过审核的基线信息,因此即使云 API 不可用,Agent 仍可以做出保守决策。

在线 ASL 情报 API 提供当前的扩展目录。npm 软件包有意不包含完整的私有情报数据库。

基本 MCP 配置

{
  "mcpServers": {
    "agent-security-lens": {
      "command": "npx",
      "args": ["-y", "agent-security-lens"]
    }
  }
}

需要 Node.js 20 或更高版本。

在线配置

公共 MCP 默认使用在线情报:

ASL_API_URL=https://agentsecuritylens-api.agentsecuritylens.workers.dev
ASL_API_URLS=https://agentsecuritylens-api.agentsecuritylens.workers.dev

ASL_API_URLS 可包含多个以逗号分隔的端点。MCP 会按顺序尝试这些端点,并自动回退。

Agent 策略

连接后,Agent 应调用 get_install_policy,然后在安装每个组件前调用 review_before_install。 启用在线模式时,策略调用会记录一条最少量的激活事件,用于产品健康和滥用情况监控。它不会发送私有文件、本地路径、机密信息、令牌或代码。设置 ASL_DISABLE_USAGE_TELEMETRY=1 可禁用此使用事件。

allow                    install from the recorded source and version
allow_with_restrictions  apply every safe_install_plan item before installation
ask_user                 stop automatic installation and request confirmation
avoid                    do not install automatically

未知或未经完整审核的组件永远不会获得自动安装授权。

推荐指令:

Before installing or enabling any MCP, Skill, tool, prompt bundle, workflow,
or memory component, call AgentSecurityLens review_before_install.
Follow agent_decision_contract and agent_actions exactly.
Never submit private source code, secrets, tokens, cookies, or file contents.

MCP 工具

  • get_install_policy:返回当前 Agent 执行策略,并记录最简的首次调用激活事件。
  • get_intelligence_status:报告 MCP 客户端的在线或本地情报状态。
  • review_before_install:评估拟安装组件及安装环境。
  • check_component:检索已知组件情报。
  • recommend_alternatives:返回有证据支持的替代方案和缓解措施。
  • submit_unknown_component:提交公开元数据以供研究。
  • get_research_status:检查未知组件是否已完成审查。
  • report_install_outcome:报告 Agent 操作结果。
  • submit_decision_feedback:报告有用、错误或不完整的决策。
  • discover_workspace:发现 Agent、MCP 和 Skill 环境。
  • scan_workspace:执行本地备用评估。

决策约定

请求示例:

{
  "component_name": "filesystem",
  "component_type": "mcp",
  "source_url": "https://github.com/modelcontextprotocol/servers",
  "install_command": "npx -y @modelcontextprotocol/server-filesystem .",
  "planned_use": "Read and edit project files.",
  "requested_permissions": ["filesystem-read", "filesystem-write"],
  "submit_if_unknown": true
}

响应格式示例:

{
  "decision": "ask_user",
  "risk_signals": ["filesystem-read", "filesystem-write", "shell-execution"],
  "safe_install_plan": [
    "Restrict filesystem scope to the current project directory.",
    "Prefer read-only mode when the task only needs inspection.",
    "Pin the package version before enabling it."
  ],
  "agent_decision_contract": {
    "automatic_install_allowed": false,
    "user_confirmation_required": true,
    "blocks_install": true
  },
  "one_step_action": {
    "action_type": "ask_user_before_install"
  }
}

Agent 必须执行结构化字段,而不是根据说明文字推断策略。

情报状态

  • strict_reviewed:已完成版本化证据审查、技术扫描、社区来源核查和独立重新计算。
  • curated_baseline:人工整理的备用信息,证据有限。
  • automatic_assessment:自动化覆盖评估,不能授权自动安装。
  • unknown:没有匹配的情报记录。

ASL 会评估可观察行为和安装环境。没有证据时,不会将组件标记为恶意。

公开备用数据包含严格审查记录和整理后的备用基线。在线服务提供自动评估,但这些评估不能授权自动安装。

隐私

在线查询仅使用公开组件元数据。请勿提交:

  • 私有源代码或文件内容
  • API 密钥、密码、令牌或 SSH 密钥
  • 浏览器 Cookie 或个人浏览历史
  • 私有提示词、记忆或客户记录
  • 环境变量中的机密信息

请参阅 PRIVACY.md 和 SECURITY.md。

本地备用方案

$env:ASL_MODE="local"
npx -y agent-security-lens

本地备用方案提供基本规则和有限的公开情报基线。当前在线情报服务可用时,应优先使用该服务。

验证

npm run verify:public

评分方法详见 ASL Agent Component Safety Standard v0.2。

许可证

Apache-2.0

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。