MCPcopy Create free account
hub / github.com/Louisym/MiniCC / AllowList

Class AllowList

tutorials/18_design_patterns_for_agents.py:822–828  ·  view source on GitHub ↗

AllowList 模式: 只允许白名单路径

Source from the content-addressed store, hash-verified

820 def name(self): return "WorkspaceOnly"
821
822 class AllowList(IsolationStrategy):
823 """AllowList 模式: 只允许白名单路径"""
824 def __init__(self, allowed: list[str]):
825 self.allowed = allowed
826 def check_path(self, path):
827 return any(path.startswith(a) for a in self.allowed)
828 def name(self): return "AllowList"
829
830 # 同一组路径, 不同策略, 不同结果
831 test_paths = [

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected