安全与信任边界总览
一层图读边界,细节链出去
信任边界由身份、能力广告、本机路径与协议硬门共同围成:
- 租户 / 身份:Aida JWT → TenantContext;Server session 与 Desktop session 不是同一授权标识(见
auth-tenant)。 - 能力广告(Desktop 协议 v3,钉点 Agent
e2adc9a3c325/ Desktop8eecd12081db):握手帧只剩{ type, protocolVersion: 3, invocationId },不再冻结negotiatedCapabilities;本轮可用的本机能力以会话载荷capabilities.supportedPrimitives为准,localFileCapability/executorReadiness只表达就绪。版本即能力:v3 蕴含全部旧 feature token。 - Path-free LF:绝对路径只在 Main;Agent 只见 relativePath / saveDestinationId(见
local-file-v5)。 - Plugin 信任:不可变包 + 投影绑定 + receipt digest;Host 在 Desktop Main,不在服务端 Runtime。
- 426 硬门族:Desktop 协议门统一为
DESKTOP_UPGRADE_REQUIRED(X-AIDA-Protocol有值且 ≠ 3、任何localExecutor.version≠ 3,或 chat 提交没带头却携带本机执行载荷;ADR-0093 起无头且无本机载荷的 chat 提交可受理;此协议放行本身不授予本机执行能力;覆盖 chat 提交、validate-local-executor、本机执行回执、Local File 回执/投递、durable recovery、桌面分发),旧码LOCAL_FILE_PROTOCOL_UPGRADE_REQUIRED、desktop_protocol_version_required、local_execution_recovery_protocol_upgrade_required已删除。另有两扇独立的门:Interaction Kernel 的interaction_protocol_upgrade_required(Kernel 协议 2)与 Runtime Work 的RUNTIME_EXECUTION_PROTOCOL_UNSUPPORTED。完整表见desktop-runtime。 - 本机凭证落盘(钉点 Desktop
8eecd12081db):Main 只认强加密的 safeStorage;Linuxbasic_text/unknown后端视为不可用,凭证退回 session-only、不写伪加密密文(见desktop-client)。代码已核;未在真实 Linux 桌面运行,等 Stanley 真机验证。 - 原生路径隐私(钉点 Desktop
8eecd12081db,e2fdc7c7/f54b63ce/736ba9e9):用户消息里的本机绝对路径在 Main 换成[LocalMaterial:…]标记再发 Agent(projectNativeMessage,需要选择时NATIVE_PATH_SELECTION_REQUIRED,发送前对同一来源版本再复核一次);原路径只留在 Main 的加密 message-overlay(LocalSecureEnvelope,见storage-planes)。证据:aida-desktop·apps/desktop/electron/agent-loop/enterprise-adapter.tsL65–84 ·projectNativeMessage·4346d79eb364;aida-desktop·apps/desktop/electron/native-path/native-path-message-overlay.tsL1–39 ·LocalMaterialMarker·4346d79eb364 - 安装包执行信任(Desktop
4346d79eb364):不再保存 pluginId/toolId 的「始终允许」授权;Main 对 Plugin 与已安装 Skill 使用authorizeInstalledCapability,冻结身份、请求摘要、执行实例与原任务有效性,不适用 ClientAccessMode 或通用逐次确认。目录选择、Computer Use 目标窗口、连接授权、typed user action 与本地文件操作权限仍是独立边界。证据:aida-desktop·apps/desktop/electron/installed-capability-authorization.tsL18–70 ·authorizeInstalledCapability·4346d79eb364;apps/desktop/electron/main.tsL1251–1259 / L1862–1883 ·4346d79eb364
能力广告回答「本轮允许什么」;执行信任回答「谁持有路径/回执/绑定」。两层不可互相替代(见视图 layers)。
原生路径识别修复(Desktop 398e3301):引号内含 .. 父目录段的相对路径整段作为私有定位符交给 Main 校验(之前中文和部分 ASCII 前缀会漏识别),http(s):// 改为大小写无关识别且不跳过同一引号里后面的本机路径。证据:aida-desktop · apps/desktop/shared/native-path-contract.ts L35–40 · quotedRelativePathParts · 4346d79eb364;aida-desktop · apps/desktop/shared/native-path-contract.ts L54–72 · parts?.includes('..') · 4346d79eb364
失败 / 非目标
- 协议不匹配 → 整入口 426,不降级半开。
- 非目标:不复述桌面 runtime 全量错误码表;不做渗透测试级威胁建模。
- 相关:
auth-tenant、desktop-runtime、local-file-v5、capability-plugins、vertical-plugin-mount。
视图
-
main— 边界总览。 -
layers— 能力广告 vs 执行信任分层。 -
fail-426-lf— Desktop 协议不是 v3 →DESKTOP_UPGRADE_REQUIRED(整次提交;视图 id 沿用旧名)。 -
fail-426-ix—interaction_protocol_upgrade_required。 -
fail-426-runtime—RUNTIME_EXECUTION_PROTOCOL_UNSUPPORTED,与DESKTOP_UPGRADE_REQUIRED并列。 -
ok-426-lf— Desktop 协议 v3 放行(对偶fail-426-lf)。 -
ok-426-ix— Interaction 协议头放行(对偶fail-426-ix)。 -
ok-426-runtime— Runtime 协议runtime-work-v1放行(对偶fail-426-runtime)。 -
ok-chat-headerless— ADR-0093:无X-AIDA-Protocol的 chat 提交(如移动端)按「有没有本机执行载荷」分流。
成功对偶(与失败链入口相同)
- ok-426-lf:
X-AIDA-Protocol=3且localExecutor.version=3→ 门放行 → 创建 Run;有合法localFileCapability时本轮才注册 Local File V4 工具(localFileV4Admitted),没有也不 426。另一条放行(ADR-0093,见视图ok-chat-headerless):没带协议头且无本机执行载荷 → 可受理;本机工具仍需执行域、能力与原绑定等各自准入前提;没带协议头却带了本机执行载荷 → 仍 426。 - ok-426-ix:协议头=2 → middleware
await next→ Kernel。 - ok-426-runtime:提交头缺省/空值或 work-v1 且无 policy,或 skill-v2 与 policy 匹配,才通过这一门;runtime-v2.1 拒绝。各路由差异见 协议地图。
失败链(深挖)
- fail-426-lf:协议头有值且不是 3、载荷 version 不是 3,或没带协议头却携带本机执行载荷 → 426
DESKTOP_UPGRADE_REQUIRED(body 带expectedProtocolVersion: 3);不创建 Run;整次提交阻断,Desktop 映射到升级提示。version缺失按 schema 违规,不算升级信号。 - fail-426-ix:IX 中间件头不接受 → 426;Kernel 未进。
- fail-426-runtime:Runtime 协议串不匹配 → 426;并列的 Desktop 协议门是
DESKTOP_UPGRADE_REQUIRED(见desktop-runtime)。
证据与范围
-
aida-agent·packages/agent/src/gateway/chat-routes.tsL520–524 ·desktopPayloadVersionUnsupported·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL374–412 ·DESKTOP_UPGRADE_REQUIRED_BODY·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL489–529 ·chatBodyCarriesLocalExecution·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/request-schemas.tsL74–91 ·LOCAL_EXECUTION_CHAT_BODY_FIELDS·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/transport/handshake.tsL9–17 ·buildHandshakeFrame·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/api-conversation-interactions.tsL465–495 ·interaction_protocol_upgrade_required·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/api-durable-local-execution-recovery.tsL66–72 ·DESKTOP_UPGRADE_REQUIRED_BODY·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/protocol-version.tsL1–38 ·desktopPayloadVersionUnsupported·e2adc9a3c325 -
aida-agent·packages/agent/src/runtime/local/local-file-v4-negotiation.tsL26–52 ·localFileV4Admitted·e2adc9a3c325 -
aida-desktop·apps/desktop/shared/generated/protocol-version.tsL1–8 ·DESKTOP_PROTOCOL_VERSION·4346d79eb364 -
aida-desktop·apps/desktop/electron/plugin-host/plugin-host.tsL195–199 ·PluginHost·4346d79eb364 -
aida-desktop·apps/desktop/electron/security/safe-storage-policy.tsL1–52 ·basic_text·4346d79eb364 -
aida-agent·packages/agent/src/gateway/session-binding.tsL91–120 ·resolveSessionBinding·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL381–421 ·RUNTIME_EXECUTION_PROTOCOL_UNSUPPORTED·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL373–386 ·desktopPayloadVersionUnsupported·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/api-conversation-interactions.tsL248–278 ·protocolAccepted·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL381–421 ·RUNTIME_EXECUTION_PROTOCOL·e2adc9a3c325
结论来自固定版本的静态源码与合同阅读;实现存在、默认开关和生产启用分别判断。本站代码证据面板列出声明状态与具体限制。
邮箱连接与 Computer Use 本机边界(本钉点)
- 邮箱:公开 connect 与 JWT 认证邮箱读取分离;authorization ticket 只授予浏览器连接建立元数据,永不授予邮箱读;支持 IMAP/OAuth 与代理 origin。见视图
mailbox-connect。 - Computer Use:Desktop
computerUsebridge +ComputerUsePanel窗口授权;需 OS helper / 包签名;旧 Desktop 不应接收新能力投影(真机未核)。 - 证据:
aida-agent·packages/agent/src/gateway/api-mailbox.tsL307–314 ·connect-only·e2adc9a3c325;aida-desktop·apps/desktop/src/local-executor/ComputerUsePanel.tsxL18 ·computerUse·4346d79eb364;aida-agent·docs/reference/computer-use.md·aida.computer-use·e2adc9a3c325
安装即授权(当前 Desktop 代码复核)
- 删除
PluginExecutionGrantStore/execution-grants.json及遗留PluginExecutionApprovalGate(plugin-execution-approval.ts随目录批任务移除)。「始终允许」持久授权与逐次目录批任务弹窗不再存在。 - 实际 Main wiring:Skill
authorizeExecution与 PluginauthorizeResource都调用authorizeInstalledCapability,产生source=installed_plugin/modeRevision=0的 Desktop-local decision;检查 identity、requestDigest、executor generation 和 task current,不以 Ask/Full 模式或通用逐次确认决定执行。 - 包完整性/版本与原 pending Work 检查仍保留;安装信任不是 Computer Use 窗口、连接授权或本地文件写权限的替代,也不是 OS sandbox。
- 证据:
aida-desktop·apps/desktop/electron/installed-capability-authorization.tsL39–97 ·4346d79eb364;aida-desktop·apps/desktop/electron/main.tsL1666–1706 / L2519–2557 ·4346d79eb364。
邮箱续查的授权拒绝与正文/附件接口(2026-11-03)
邮箱续查保留原 connectionId 绑定;越界工具调用在派发连接器之前以 PLUGIN_CONNECTOR_READ_SCOPE_VIOLATION 拒绝,不代表邮箱查询失败,也不能尝试其他账号。IMAP 传输层另行处理缺省 UIDNEXT:空邮箱返回空页;有 beforeUid 时使用原游标,否则读取末位序号的 UID 推导上界;已提供但畸形的 UIDNEXT 仍失败,UIDVALIDITY 绑定和分页边界不放宽。api-mailbox.ts 新增 POST /:connectionId/message(解析头、限长正文、附件清单)与 POST /:connectionId/attachment(单个附件原始字节,上限 25MiB,供 aida.mail 转存 Artifact)。
aida-agent·packages/agent/src/gateway/delegated-desktop-capabilities.tsL253–262 ·7f2e519936b5aida-agent·packages/agent/src/connectors/email/imap-mailbox-client.tsL414–447 ·7f2e519936b5aida-agent·packages/agent/src/gateway/api-mailbox.tsL744–845 ·7f2e519936b5
Runtime 提交 wire 与原 Work identity
chat POST 的 Runtime 提交门接受缺省/空值(无 policy)、runtime-work-v1(无 policy),以及 runtime-work-skill-v2 且携带合法 skillExecutionPolicy;其他非空头为 RUNTIME_EXECUTION_PROTOCOL_UNSUPPORTED,头与 policy 不匹配为 RUNTIME_WORK_SKILL_POLICY_MISMATCH,均返回 426。原 Work binding 仍是 runtime-work-v1;取消提交、补充材料等路由单独判定,见协议地图。
证据:提交门 与 实际 chat POST 调用。