feat(safety): 工具调用分级安全系统 - #29
Open
uuuiiiiooo wants to merge 1 commit into
Open
Conversation
实现完整的工具调用安全分级体系: - SafetyEngine: 4级风险评估(low/medium/high/critical),3种内置模式(standard/relaxed/unrestricted) - ReviewService: 多reviewer并发AI审阅,动态聚合策略(any_deny/unanimous/majority/raw) - scheduler安全门: fail-closed原则,review门+confirm门双独立门控 - Bootstrap注入: iris-core实例化引擎,Backend.setSafetyCtx()注入ToolLoop - 子代理继承: safetyCtx通过deps向下传递 - autoApproveHandle安全感知: 非交互平台主动拒绝safetyConfirmRequired - extension-sdk: SafetyEngineReadonly/SafetyEngineLike接口分离,内置模式不可覆盖 - 58个测试(22单元+22单元+14集成)全部通过 系统默认关闭(enabled:false),未配置时零干扰。
Lianues
force-pushed
the
dev
branch
2 times, most recently
from
April 14, 2026 00:27
b8c9b1c to
da04e9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能概要
为 Iris 添加完整的工具调用安全分级体系,通过风险等级评估 + AI 多 reviewer 审阅 + 用户确认三层机制保护高风险操作。系统默认关闭,未配置时零干扰。
核心组件
变更范围
src/safety/engine.tssrc/review/service.tssrc/tools/scheduler.tssrc/core/iris-core.ts,backend.tspackages/extension-sdk/src/safety.ts等src/tools/internal/sub-agent/index.tstests/safety-*.test.ts×3测试要点
npx tsc --noEmit零错误(主项目 + extension-sdk)