- 回滚/备份:空 bak 改名 .bad 跳过;升级刷新 bak 补上单数 marker 补丁;统一原子写 - 补丁命中:optional 命中不符记软失败;#42 插入型替换加探针防重复插入 - Windows:进程枚举改用 | 分隔 + UTF-8,修复中文路径换包不杀旧进程;换包失败拉起原版 - 安全:asar 解包防越界;红队路径校验 realpath 防空 symlink;更新仅 https;报告回放去换行注入 - 提示词钩子:停用后 rewriteFn 返回原装配文本并清理 assemble guard;缓存签名纳入红队/策略/override - 红队:listEngagements 默认不算统计;listVulns/报告支持 evidenceLimit - 子代理名额占位即时生效并回退;--apply 有失败项退出码 1 - 清理:删除 lib/mnemon-settings.js 及 13 处死代码/未使用 import;移除 test 目录与 test 脚本
27 lines
1.2 KiB
JavaScript
27 lines
1.2 KiB
JavaScript
/** 判定「宿主提示词已清洗」用的标记。desktop.js 生成 WSH 脚本时复用同一份。 */
|
|
export const HOST_CLEAN_MARKERS = {
|
|
identity: "[dsh-purge] identity stripped",
|
|
inject: [
|
|
"[dsh-purge] complete prompt keeps waterfall inject",
|
|
"[dsh-purge] complete prompt keeps inject",
|
|
"[dsh-purge] fold-complete inject first",
|
|
],
|
|
drops: [
|
|
"transformed.sections : [completeSection]",
|
|
": [completeSection]",
|
|
],
|
|
};
|
|
|
|
/** 重启前看系统提示词文件:标记写上了,或者当前原文里已经没有那两处旧拦截。 */
|
|
export function hostPromptKeepsInject(text) {
|
|
const body = String(text || "");
|
|
const identityMarked = body.includes(HOST_CLEAN_MARKERS.identity);
|
|
const injectMarked = HOST_CLEAN_MARKERS.inject.some((m) => body.includes(m));
|
|
if (identityMarked && injectMarked) return true;
|
|
// 空文件或不是这份模块,不能当成已经洗过。
|
|
if (!body.includes("system-prompt/assemble")) return false;
|
|
const identityLeft = body.includes("You are an AI agent powered by DeepSeek Harness.");
|
|
const dropsInject = HOST_CLEAN_MARKERS.drops.some((m) => body.includes(m));
|
|
return !identityLeft && !dropsInject;
|
|
}
|