@kenhkl/agent-moss 0.17.24 → 0.17.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,5 +36,48 @@
36
36
  "/run",
37
37
  "/dev/shm"
38
38
  ],
39
- "_temp_dirs_comment": "临时目录(批量删除豁免)。L1 的 _check_dangerous_patterns 与 L2 的 read_before_write 共用这一份;调用方按需拼尾随斜杠做 startswith。"
39
+ "_temp_dirs_comment": "临时目录(批量删除豁免)。L1 的 _check_dangerous_patterns 与 L2 的 read_before_write 共用这一份;调用方按需拼尾随斜杠做 startswith。",
40
+ "write_content_analysis": {
41
+ "_comment": "写入内容的按语言静态分析(writeFile/editFile)。文档/数据不做命令执行检测;shell/python 按语言解析后只扫危险片段;预筛 + 片段/大小/时间预算控制性能。",
42
+ "data_exts": [
43
+ ".md",
44
+ ".markdown",
45
+ ".txt",
46
+ ".rst",
47
+ ".html",
48
+ ".htm",
49
+ ".json",
50
+ ".jsonl",
51
+ ".yaml",
52
+ ".yml",
53
+ ".xml",
54
+ ".csv",
55
+ ".tsv",
56
+ ".css",
57
+ ".scss",
58
+ ".ini",
59
+ ".conf",
60
+ ".cfg",
61
+ ".log",
62
+ ".toml",
63
+ ".properties",
64
+ ".sql"
65
+ ],
66
+ "shell_exts": [
67
+ ".sh",
68
+ ".bash",
69
+ ".zsh",
70
+ ".ksh",
71
+ ".dash"
72
+ ],
73
+ "python_exts": [
74
+ ".py",
75
+ ".pyw"
76
+ ],
77
+ "shell_precheck": "\\$\\(|`|\\b(?:rm|rmdir|unlink|shred|curl|wget|nc|ncat|socat|chmod|chown|dd|tee|truncate|mkfs|fdisk|parted|bash|sh|zsh|dash|python[0-9.]*|perl|ruby|node|php|lua|eval|exec|base64|sudo|su)\\b",
78
+ "python_precheck": "os\\.(?:system|popen|remove|unlink|rmdir|chmod|chown|kill)|subprocess|pty\\.|ctypes|eval\\s*\\(|exec\\s*\\(|__import__|compile\\s*\\(|open\\s*\\(|shutil\\.(?:rmtree|move|copy)|socket|urllib|requests\\.",
79
+ "max_content_bytes": 262144,
80
+ "max_scan_bytes": 65536,
81
+ "max_scan_ms": 100
82
+ }
40
83
  }
@@ -36,7 +36,8 @@
36
36
  "写入",
37
37
  "alter"
38
38
  ],
39
- "reason": "原始意图为查询/搜索,但执行了修改操作"
39
+ "reason": "原始意图为查询/搜索,但执行了修改操作",
40
+ "allow_if_write_intent": true
40
41
  },
41
42
  {
42
43
  "intent_keywords": [
@@ -78,7 +79,8 @@
78
79
  "reg delete"
79
80
  ],
80
81
  "reason": "原始意图为查询/搜索,但执行了修改操作",
81
- "os": "windows"
82
+ "os": "windows",
83
+ "allow_if_write_intent": true
82
84
  }
83
85
  ],
84
86
  "password_modify_consent": [
@@ -69,5 +69,69 @@
69
69
  "rsync"
70
70
  ],
71
71
  "_source_arg_commands_comment": "第一个位置参数是「源文件」的命令:源在敏感目录 → 视为读取。",
72
- "_reused": "不重复存的两组:① 写/删命令词边界正则 = platform_traits.json 的 write_command_res(逐字相同);② 工具排除前缀 = heuristic_rules.json 的 sensitive_excluded_prefixes(逐字相同);③ 临时目录名单 = heuristic_rules.json 的 temp_dirs(L1/L2 共用一份)。"
72
+ "single_file_write_tools": [
73
+ "write",
74
+ "file_write",
75
+ "writefile",
76
+ "edit",
77
+ "file_edit",
78
+ "editfile",
79
+ "searchreplace"
80
+ ],
81
+ "_single_file_write_tools_comment": "单文件写工具(action_type 已转小写):语义是「把声明的内容写到声明的一个路径」。read_before_write 对它们只取工具声明的路径(command 第一个路径 / JSON 的 file_path|filePath|path),不扫 content —— 否则内容正文里的路径会被误当成写目标。bash 类工具不走这条(重定向目标可能不在第一个)。",
82
+ "_reused": "不重复存的两组:① 写/删命令词边界正则 = platform_traits.json 的 write_command_res(逐字相同);② 工具排除前缀 = heuristic_rules.json 的 sensitive_excluded_prefixes(逐字相同);③ 临时目录名单 = heuristic_rules.json 的 temp_dirs(L1/L2 共用一份)。",
83
+ "protected_write_prefixes": [
84
+ "/etc/",
85
+ "/usr/",
86
+ "/bin/",
87
+ "/sbin/",
88
+ "/lib/",
89
+ "/lib64/",
90
+ "/boot/",
91
+ "/opt/",
92
+ "/root/",
93
+ "/var/",
94
+ "/srv/",
95
+ "/sys/",
96
+ "/proc/",
97
+ "/dev/",
98
+ "/run/"
99
+ ],
100
+ "_protected_write_prefixes_comment": "追加豁免的例外:系统目录里的追加仍要求先读(>> /etc/hosts 是典型后门)。普通工作区/临时目录的追加不要求先读。",
101
+ "protected_home_entries": [
102
+ ".ssh",
103
+ ".gnupg",
104
+ ".aws",
105
+ ".config",
106
+ ".kube",
107
+ ".docker",
108
+ ".npmrc",
109
+ ".netrc",
110
+ ".bashrc",
111
+ ".bash_profile",
112
+ ".bash_history",
113
+ ".profile",
114
+ ".zshrc",
115
+ ".zprofile",
116
+ ".gitconfig",
117
+ ".git-credentials",
118
+ ".vimrc",
119
+ ".wgetrc",
120
+ ".curlrc"
121
+ ],
122
+ "_protected_home_entries_comment": "家目录下第一层条目的追加豁免例外(~/.ssh/authorized_keys、~/.bashrc 等写后门高发位置)。",
123
+ "write_intent_keywords": [
124
+ "写入",
125
+ "写文件",
126
+ "写进",
127
+ "保存",
128
+ "生成文件",
129
+ "导出",
130
+ "输出到",
131
+ "append",
132
+ "write",
133
+ "save",
134
+ "export",
135
+ "generate"
136
+ ]
73
137
  }