remove-ai-marks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRemove AI marks
移除AI标记
Multi-vendor anti-detection hygiene for text (Unicode + statistical rewrite) and files (C2PA / AI metadata across common containers).
Read if needed:
- — Unicode / sampling / C2PA / containers
references/mark-classes.md - — Claude, Gemini/SynthID, OpenAI, open-LLM
references/vendor-notes.md - — which layer when
references/removal-matrix.md - — intended use
references/ethics.md - — Anthropic-specific detail
references/how-claude-marks.md - — optional MarkDiffusion image harness (schemes, honesty caveats)
references/markdiffusion.md
This skill is a thin client. All deterministic cleaning machinery runs in a
separate HTTP service (this repo's ), so the agent host needs no
Python, venvs, or cleaning tools. Call the service with ; never run
cleaning scripts directly.
service/curl多厂商反检测清理工具,支持文本(Unicode + 统计重写)和文件(常见容器中的C2PA / AI元数据)。
如需了解详情可查看:
- — Unicode / 采样 / C2PA / 容器相关说明
references/mark-classes.md - — Claude、Gemini/SynthID、OpenAI、开源大语言模型相关说明
references/vendor-notes.md - — 不同场景下对应使用的清理层级
references/removal-matrix.md - — 工具使用规范
references/ethics.md - — Anthropic专属标记细节
references/how-claude-marks.md - — 可选的MarkDiffusion图像工具包(方案、诚信说明)
references/markdiffusion.md
本技能是一个轻量客户端。所有确定性清理机制都在独立的HTTP服务(本仓库的目录)中运行,因此代理主机无需安装Python、虚拟环境或清理工具。通过调用该服务;切勿直接运行清理脚本。
service/curlService access
服务访问
Base URL comes from , default :
WATERMARKS_SERVICE_URLhttp://127.0.0.1:8765bash
WM="${WATERMARKS_SERVICE_URL:-http://127.0.0.1:8765}"The service is started either by the operator (, or a
published GHCR image) or locally (). Always check it first, and
stop with a clear message if it is unreachable — never fall back to local
cleaning:
docker compose up -dmake servebash
curl -sf "$WM/health"基础URL由环境变量指定,默认值为:
WATERMARKS_SERVICE_URLhttp://127.0.0.1:8765bash
WM="${WATERMARKS_SERVICE_URL:-http://127.0.0.1:8765}"服务可由运维人员启动(,或使用已发布的GHCR镜像),也可本地启动()。请先检查服务状态,如果服务不可达,需给出明确提示后终止操作——切勿回退到本地清理:
docker compose up -dmake servebash
curl -sf "$WM/health"{"ok": true, "version": "..."}
{"ok": true, "version": "..."}"
If `WATERMARKS_SERVER_API_KEY` is set on the service, every request needs
`-H "Authorization: Bearer $WATERMARKS_SERVICE_API_KEY"`.
如果服务端设置了`WATERMARKS_SERVER_API_KEY`,则每个请求都需要添加请求头`-H "Authorization: Bearer $WATERMARKS_SERVICE_API_KEY"`。Capabilities
功能特性
bash
curl -s "$WM/capabilities"Reports which optional tools are available server-side (, ,
), scorers present (, ), and which heavy
backends are configured (, ,
). Drive your advice from this: only recommend pixel
removal / SynthID scoring when the service reports the backend present.
c2patoolexiftoolqpdfscorers.stylometryscorers.synthidpixel_backends.ctrlregenpixel_backends.diffusionharnesses.markllmbash
curl -s "$WM/capabilities"该接口会返回服务端可用的可选工具(、、)、已部署的评分器(、),以及已配置的重量级后端(、、)。请根据该返回结果提供建议:只有当服务报告对应的后端已存在时,才推荐像素级移除/SynthID评分功能。
c2patoolexiftoolqpdfscorers.stylometryscorers.synthidpixel_backends.ctrlregenpixel_backends.diffusionharnesses.markllmHTTP API (curl)
HTTP API(curl调用)
Payloads are JSON with the file as base64. The agent decodes the
field and writes it to the output path itself.
cleaned| Method | Path | Body | Returns |
|---|---|---|---|
| GET | | — | |
| GET | | — | optional tools / backends present |
| GET | | — | dynamically generated OpenAPI 3.0.3 spec |
| POST | | | |
| POST | | | |
The machine-readable contract lives at — plug it into any
OpenAPI tooling (client generators, Swagger UI, editors) instead of hand-rolling
clients.
$WM/openapi.jsonoptions/cleannfkcaggressive_homoglyphskeep_non_ai_metadatastrip_all_metadataremove_pixelctrlregendiffusionalso_layer_a_textInspect first (decide, don't guess):
bash
curl -s -X POST "$WM/inspect" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 notes.md)\", \"name\": \"notes.md\"}"Clean (text / image / container are auto-detected by name + bytes):
bash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 notes.md)\", \"name\": \"notes.md\"}"Decode the returned base64 into the output file ( by
default unless the user asked in-place) and summarize honestly.
cleaned*.cleaned.*report(On Windows agents, build base64 with
.)
[Convert]::ToBase64String([IO.File]::ReadAllBytes("notes.md"))请求体为JSON格式,文件内容需以base64编码。代理需要解码返回结果中的字段,并将其写入输出路径。
cleaned| 请求方法 | 路径 | 请求体 | 返回内容 |
|---|---|---|---|
| GET | | — | |
| GET | | — | 可用的可选工具/后端信息 |
| GET | | — | 动态生成的OpenAPI 3.0.3规范 |
| POST | | | |
| POST | | | |
机器可读的接口定义位于——请将其接入任意OpenAPI工具(客户端生成器、Swagger UI、编辑器),而非手动编写客户端。
$WM/openapi.json/cleanoptionsnfkcaggressive_homoglyphskeep_non_ai_metadatastrip_all_metadataremove_pixelctrlregendiffusionalso_layer_a_text先检测再清理(基于判断,而非猜测):
bash
curl -s -X POST "$WM/inspect" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 notes.md)\", \"name\": \"notes.md\"}"执行清理(文本/图像/容器会根据文件名+字节内容自动识别):
bash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 notes.md)\", \"name\": \"notes.md\"}"将返回结果中的字段解码为输出文件(默认命名为,除非用户要求原地覆盖),并如实总结中的内容。
cleaned*.cleaned.*report(在Windows代理中,可通过生成base64编码内容。)
[Convert]::ToBase64String([IO.File]::ReadAllBytes("notes.md"))Ethics
使用规范
Intended for your own content (privacy, hygiene, research). Do not market results as "proves human-written." If the user clearly wants academic fraud or illegal non-disclosure, warn using and still only perform technical cleaning they own.
references/ethics.md本工具仅适用于您自己的内容(隐私保护、清理需求、研究用途)。请勿将处理后的内容宣传为“人工撰写”。如果用户明确想要用于学术欺诈或非法保密,需通过中的内容发出警告,但仍仅对用户拥有所有权的内容执行技术清理。
references/ethics.mdWorkflow
工作流程
1. Classify input
1. 分类输入内容
| Input | Route |
|---|---|
| Pasted / clipboard text | temp file → |
| text Layer A (+ formatter for code) |
| container clean (frontmatter/meta) + Layer A |
| image metadata strip |
| container metadata strip |
| Directory / website | aggregate audit via the service CLIs (see below) |
The service routes by filename extension first, then by magic bytes, so you
mostly just send the file.
| 输入类型 | 处理流程 |
|---|---|
| 粘贴/剪贴板文本 | 保存为临时文件 → 调用 |
| 文本Layer A清理(代码文件额外使用格式化工具) |
| 容器元数据清理(前置内容/元数据) + Layer A文本清理 |
| 图像元数据移除 |
| 容器元数据移除 |
| 目录/网站 | 通过服务端CLI进行批量审计(详见下文) |
服务会优先根据文件扩展名判断类型,其次根据文件字节特征,因此您只需直接发送文件即可。
2. Inspect first
2. 先执行检测
bash
curl -s -X POST "$WM/inspect" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 path)\", \"name\": \"$(basename path)\"}"Show a short summary (suspicious codepoints; C2PA/AI flags; confidence labels
/ / / ).
confirmedprobableinformationallikely_false_positiveOptional pixel-domain detection (SynthID score) and pixel removal
(CtrlRegen / DiffusionPurification) and the MarkDiffusion/MarkLLM harnesses are
external heavy backends. They run in the service's optional containers or host
checkouts — check before promising them, and never pretend a
local detector is an official vendor detector.
/capabilitiesbash
curl -s -X POST "$WM/inspect" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 path)\", \"name\": \"$(basename path)\"}"展示简短的检测总结(可疑编码点;C2PA/AI标记;置信度标签///)。
confirmedprobableinformationallikely_false_positive可选的像素域检测(SynthID评分)和像素域移除(CtrlRegen / DiffusionPurification)以及MarkDiffusion/MarkLLM工具包属于外部重量级后端。它们运行在服务的可选容器或本地检出环境中——在承诺提供这些功能前请先检查接口返回结果,切勿将本地检测器伪装成官方厂商检测器。
/capabilities3. Deterministic clean (always for matching inputs)
3. 执行确定性清理(匹配输入类型时始终执行)
Any supported file (unified):
bash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 INPUT)\", \"name\": \"$(basename INPUT)\"}"Decode → ( unless the user asked in-place).
Re-inspect the result when residual risk matters.
cleanedOUTPUT*.cleaned.*PDF needs + server-side for a real strip; the report notes a
degraded (best-effort) result when either is missing — check .
exiftoolqpdf/capabilitiesImages — optional pixel removal: only when
says the backend is present:
capabilities.pixel_backendsbash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 shot.png)\", \"name\": \"shot.png\", \
\"options\": {\"remove_pixel\": \"ctrlregen\"}}"所有支持的文件(统一流程):
bash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 INPUT)\", \"name\": \"$(basename INPUT)\"}"解码字段内容 → 写入文件(默认命名为,除非用户要求原地覆盖)。如果存在残留风险,需对结果重新执行检测。
cleanedOUTPUT*.cleaned.*若服务端未安装和,PDF文件的清理仅为“尽力而为”;当任一工具缺失时,报告中会注明清理结果存在局限性——请先检查接口返回结果。
exiftoolqpdf/capabilities**图像文件 — 可选像素级移除:**仅当返回结果显示对应后端已存在时才可执行:
capabilities.pixel_backendsbash
curl -s -X POST "$WM/clean" -H 'Content-Type: application/json' \
-d "{\"file\": \"$(base64 -w0 shot.png)\", \"name\": \"shot.png\", \
\"options\": {\"remove_pixel\": \"ctrlregen\"}}"4. Layer B — always offer rewrite (prose)
4. Layer B — 始终提供重写建议( prose类文本)
After Layer A, always propose a statistical-mark reduction pass for natural-language content. Do not skip this step silently.
The service does not hold a rewrite model — you are the rewrite model.
Run the prompts below on the cleaned text with a model ≠ suspected origin
(Claude text → not Claude; Gemini → not Gemini; etc.). Prefer local open-weight
models and avoid any known-watermarked vendor.
Multi-pass recipe:
- Layer A clean (via )
/clean - Paraphrase (default) — explicit word-choice + syntax churn: change clause order, connectors, transition words, and sentence boundaries; replace content and function words where meaning allows; preserve facts, numbers, names, code IDs
- Optional strong pass — (natural-human prose), back-translate, or structural outline→regen
humanize - Layer A again on the result ()
/clean - Report residual risk honestly (short/highly predictable text = lower; long, high-entropy prose = higher)
Code files: Prefer formatter (, , , …) + Layer A. Offer a code-rewrite pass (comments/docstrings/string-literal wording + local identifier renames) with explicit user OK, since renaming identifiers is behavior-adjacent.
prettierblackgofmt完成Layer A清理后,始终建议对自然语言内容执行统计标记弱化处理。请勿跳过此步骤。
服务端不包含重写模型——您需要自行调用重写模型。请使用与疑似来源模型不同的模型对清理后的文本执行以下提示词(例如Claude生成的文本 → 不要使用Claude重写;Gemini生成的文本 → 不要使用Gemini重写等)。优先使用本地开源模型,避免使用任何已知会添加水印的厂商模型。
多步骤重写方案:
- 执行Layer A清理(通过接口)
/clean - 释义重写(默认)——明确调整用词和语法:改变从句顺序、连接词、过渡词,调整句子边界和长度;在不改变含义的前提下替换实词和虚词;保留事实、数字、名称、代码ID
- 可选强化处理——(自然人类风格文本)、反向翻译、结构化大纲→重新生成
人性化改写 - 对结果再次执行Layer A清理(调用接口)
/clean - 如实报告残留风险(简短/高可预测性文本残留风险较低;长篇、高熵文本残留风险较高)
**代码文件:**优先使用格式化工具(、、等) + Layer A清理。如需执行代码重写(注释/文档字符串/字符串字面量改写 + 本地标识符重命名),需先获得用户明确许可,因为标识符重命名可能影响代码行为。
prettierblackgofmtRewrite prompts (use as-is)
重写提示词(直接使用)
Paraphrase preserve meaning (word choice + syntax):
Rewrite the following text so that it uses substantially different wording at
the token level. Change clause order, connectors, and transition words; vary
sentence boundaries and length; and replace both content words and function
words where meaning allows. Preserve all facts, numbers, names, and technical
identifiers. Do not add or remove claims. Output only the rewritten text.
---
{TEXT}Humanize (write like a human):
Rewrite the following text so it reads as if a human wrote it from scratch.
Vary sentence rhythm and length, replace formulaic AI-style transitions and
filler with concrete natural phrasing, and use plain, varied wording. Preserve
all facts, numbers, names, and technical identifiers. Do not add or remove
claims. Output only the rewritten text.
---
{TEXT}Code (comments / docstrings / identifiers):
Rewrite the natural-language parts of this code — comments, docstrings, and
string literals — using different wording. Rename local variables, function
parameters, and private helper names to semantically equivalent names. Preserve
program behavior, public API names, and all values that affect output. Output
only the rewritten code.
---
{TEXT}Back-translate (two steps):
Translate the following text to {LANG}. Output only the translation.Translate the following text to {ORIGINAL_LANG}. Preserve meaning; use natural
phrasing. Output only the translation.Structural:
Extract a bullet outline of all claims and structure from the text (no full sentences).Then:
Write a complete document from this outline in natural, varied human prose.
Avoid formulaic transitions. Do not omit any bullet. Output only the document.释义重写(保留含义,调整用词+语法):
重写以下文本,使其在token层面使用完全不同的措辞。改变从句顺序、连接词和过渡词;调整句子边界和长度;在不改变含义的前提下替换实词和虚词。保留所有事实、数字、名称和技术标识符。请勿添加或删除任何陈述。仅输出重写后的文本。
---
{TEXT}人性化改写(模拟人工撰写风格):
重写以下文本,使其读起来像是人类从头撰写的内容。调整句子节奏和长度,用具体自然的措辞替换格式化的AI风格过渡语和填充内容,使用简洁多样的表述。保留所有事实、数字、名称和技术标识符。请勿添加或删除任何陈述。仅输出重写后的文本。
---
{TEXT}代码文件(注释/文档字符串/标识符):
重写此代码中的自然语言部分——注释、文档字符串和字符串字面量,使用不同措辞。将局部变量、函数参数和私有辅助函数重命名为语义等价的名称。保留程序行为、公共API名称和所有影响输出的值。仅输出重写后的代码。
---
{TEXT}反向翻译(两步执行):
将以下文本翻译为{LANG}语言。仅输出翻译结果。将以下文本翻译回{ORIGINAL_LANG}语言。保留含义;使用自然措辞。仅输出翻译结果。结构化重写:
提取文本中所有陈述和结构的项目符号大纲(不要完整句子)。然后执行:
根据此大纲撰写完整文档,使用自然多样的人类风格文本。避免格式化过渡语。请勿遗漏任何项目符号。仅输出文档内容。Aggregate audits (directories / websites)
批量审计(目录/网站)
The service image also ships the audit CLIs. Run them as one-shot containers
when a directory or website audit is needed:
bash
undefined服务镜像中还包含审计CLI工具。当需要对目录或网站进行审计时,可通过一次性容器运行:
bash
undefinedLocal checkout, or inside the service image:
本地检出代码,或在服务镜像内部执行:
docker run --rm -v "$(pwd)/src:/data:ro" watermarks-remover
/app/scripts/audit_dir.py /data --json
/app/scripts/audit_dir.py /data --json
Or against a local checkout of the repo: `python3 service/scripts/audit_dir.py DIR --json`.docker run --rm -v "$(pwd)/src:/data:ro" watermarks-remover
/app/scripts/audit_dir.py /data --json
/app/scripts/audit_dir.py /data --json
也可针对本地检出的仓库执行:`python3 service/scripts/audit_dir.py DIR --json`。5. Report
5. 生成报告
Always state:
- What Layer A / container clean verifiably removed (counts, actions) — from .
report - What Layer B did (best-effort statistical; cannot claim official "undetectable"). Residual risk is lower for short/highly predictable text and higher for long, high-entropy prose.
- Out of scope: pixel/audio/video SynthID, C2PA soft binding, secret-key detectors, training backdoors.
- Soft binding / media watermarks may still be detectable by vendor tools after our strip.
- Prefer writing unless user asked in-place.
*.cleaned.* - Ethics one-liner: own content / no compliance theater.
报告中需包含以下内容:
- Layer A/容器清理已验证移除的内容(数量、操作)——来自字段。
report - Layer B执行的操作(尽力而为的统计处理;不得声称“完全无法检测”)。残留风险:简短/高可预测性文本风险较低,长篇、高熵文本风险较高。
- 超出范围的内容:像素/音频/视频SynthID标记、C2PA软绑定、密钥检测器、训练后门。
- 软绑定/媒体水印在我们移除后仍可能被厂商工具检测到。
- 优先保存为文件,除非用户要求原地覆盖。
*.cleaned.* - 使用规范提示:仅用于自有内容/勿用于合规造假。
Limitations
局限性
- Layer A does not remove token-sampling watermarks.
- Layer B cannot be gold-verified without vendor detectors / keys. Optional MarkLLM/MarkDiffusion harnesses (service containers) verify a specific scheme config before/after, but same-config-only and not a vendor-detector oracle.
harness - PDF strip is best-effort without , and incomplete without
exiftoolserver-side.qpdf - Pixel-domain image watermarks can be removed optionally via the external CtrlRegen backend () or MarkDiffusion's DiffusionPurification (
remove_pixel: ctrlregen); both are heavy, drift the image, and need the backend present (remove_pixel: diffusion). Audio/video watermarks remain out of scope./capabilities - The reverse-SynthID scorer is external, best-effort, and under a non-commercial Research License; not an official Google detector.
- C2PA soft binding (content watermark that re-links to a remote manifest after metadata strip) is out of scope — stripping hard-bound C2PA does not clear it.
- Data-driven / backdoor model marks (trigger phrases) are out of scope.
- Layer A无法移除token采样水印。
- 若无厂商检测器/密钥,Layer B的效果无法得到权威验证。可选的MarkLLM/MarkDiffusion工具包(服务端容器)可在处理前后验证特定方案配置,但仅适用于相同配置场景,并非厂商检测器的替代方案。
harness - 若无,PDF文件的清理仅为尽力而为;若无
exiftool,清理会不彻底。qpdf - 像素域图像水印可通过外部CtrlRegen后端()或MarkDiffusion的DiffusionPurification(
remove_pixel: ctrlregen)可选移除;两者均为重量级操作,会导致图像失真,且需要对应后端已部署(查看remove_pixel: diffusion接口)。音频/视频水印不在处理范围内。/capabilities - 反向SynthID评分器属于外部工具,仅为尽力而为的方案,且受非商业研究许可限制;并非官方Google检测器。
- C2PA软绑定(移除元数据后仍可链接到远程清单的内容水印)不在处理范围内——移除硬绑定C2PA无法清除软绑定水印。
- 数据驱动/后门模型标记(触发短语)不在处理范围内。
Service not reachable?
服务不可达?
If fails: tell the user the service is down and how to start it
(, , or the published GHCR image). Do not
attempt to clean locally — this skill contains no cleaning code.
$WM/healthdocker compose up -dmake serve如果请求失败:告知用户服务已宕机,并说明启动方式(、或使用已发布的GHCR镜像)。切勿尝试本地清理——本技能不包含任何清理代码。
$WM/healthdocker compose up -dmake serve