[Tool Router]:完成安全工具路由骨架,包含结构化调用、风险分类和只读工具测试

This commit is contained in:
mkbk
2026-06-18 22:08:24 +08:00
parent dc9566d8d2
commit af7eb25ba6
5 changed files with 480 additions and 9 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ class AgentMemoryTests(unittest.TestCase):
policy = MemoryWritePolicy()
safe = policy.evaluate(MemoryRecordInput("preference", "用户喜欢 Python"))
sensitive = policy.evaluate(MemoryRecordInput("fact", "我的 api key 是 sk-abcdefghijklmnop"))
sensitive = policy.evaluate(MemoryRecordInput("fact", "我的 api key 是 secret-value"))
self.assertTrue(safe.should_save)
self.assertFalse(safe.requires_confirmation)