基于 SkillHarness 论文(arXiv:2606.20636)与 Agent Skills 综述 (arXiv:2602.12430)引入激活前置条件(preconditions)与来源标记 (provenance),并新增从失败轨迹学习风险守卫建议的能力。 变更内容: - U1: SkillConfig 新增 v7 preconditions/provenance 字段(base.py) - U2: build_skill_system_prompt 注入 preconditions 软检查段落 - U3: SkillLoader 三路径记录 provenance + entry_points 危险能力告警 - U4: 10 个业务 Skill YAML 补充 preconditions(2-4 条中文短句) - U5: RiskGuardLearner 从失败轨迹学习风险守卫建议(人工审查,不自动应用) - U6: CLI 命令 agentkit skill learn-risk-guards 关键决策: - KTD1: preconditions 通过 system_prompt 注入(软检查),不做硬 LLM 调用 - KTD2: RiskGuardLearner 不自动应用,需人工审查(论文显示 75% 自动学习不安全) - KTD3: provenance 为轻量字符串,不加 hash/签名(无合规需求) 测试:39 个新增单元测试全部通过,ruff 检查通过。 |
||
|---|---|---|
| .. | ||
| experts | ||
| pipelines | ||
| skills | ||
| __init__.py | ||
| geo_handlers.py | ||
| geo_server.py | ||
| geo_tools.py | ||