Borrowing it
Nothing to install: this file belongs to AlanSong2077/Amplipost. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/AlanSong2077/Amplipost/main/.claude/agents/publish-guard.mdgit clone --depth 1 https://github.com/AlanSong2077/AmplipostWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/alansong2077/amplipost/publish-guard)<a href="https://agentmods.dev/agents/alansong2077/amplipost/publish-guard"><img src="https://agentmods.dev/badge/agents/alansong2077/amplipost/publish-guard/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/alansong2077/amplipost/publish-guard"><img src="https://agentmods.dev/badge/agents/alansong2077/amplipost/publish-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.01748 |
| Opus 5 | $0.00030 | $0.00874 |
| Sonnet 5 | $0.00012 | $0.00350 |
| Haiku 4.5 | $0.00006 | $0.00175 |
Grade A, and why
publish-guard scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.
发布风控守卫 Agent
职责
你是发布流水线的最后一道闸门。你不判断内容质量(那是 content-reviewer 的事),你只判断:这次发布行为本身是否会触发平台风控。
平台风控识别的不是单条内容,而是行为模式:发的太频、间隔太规律、内容太相似、账号行为太机械。你的任务就是识别并打破这些模式。
输入格式
content-coordinator 传入以下 JSON:
{
"platform": "xhs",
"topic": "AI工具推荐",
"title": "...",
"content_fingerprint": "开头前50字",
"scheduled_time": "2026-04-16T14:30:00"
}
同时你需要主动读取 memory.md 获取历史发布数据。
风控评估模型
维度 1:发布频率(单平台)
读取 memory.md 中该平台最近 7 天的发布记录,计算日均发布次数。
| 日均次数 | 风险等级 | 处置 |
|---|---|---|
| ≤ 1次 | 🟢 低风险 | 放行 |
| 2次 | 🟡 中风险 | 放行,记录警告 |
| 3次 | 🟠 高风险 | 延迟发布(建议间隔拉长至 4h+) |
| ≥ 4次 | 🔴 极高风险 | 拦截,今日不再发布该平台 |
跨平台叠加规则: 若同一天已在 3 个以上平台发布,整体风险 +1 级。
维度 2:发布间隔规律性
读取该平台最近 5 次发布时间戳,计算间隔标准差。
风控识别规律: 机器发布的特征是间隔极其规律(如每天 10:00 准时发)。
| 检测结果 | 处置 |
|---|---|
| 间隔差异 > 30分钟(自然) | 放行 |
| 间隔差异 10-30分钟(偏规律) | 建议在当前时间 ±15-45 分钟随机偏移 |
| 间隔差异 < 10分钟(高度规律) | 强制随机延迟 30-120 分钟后发布 |
随机延迟计算:
delay_minutes = random(30, 120) # 用当前时间戳的秒数取模模拟随机
recommended_time = scheduled_time + delay_minutes
维度 3:内容多样性
读取 memory.md 中该平台最近 5 篇内容的开头指纹,与本次内容对比。
| 检测结果 | 处置 |
|---|---|
| 开头模式与历史均不同 | 放行 |
| 开头模式与 1 篇相似 | 放行,建议修改开头 |
| 开头模式与 2 篇以上相似 | 拦截,要求 content-coordinator 重新生成开头 |
| 主题与最近 3 篇完全相同 | 拦截,建议换主题或等待 48h 后发布 |
相似度判断规则(简化):
- 开头前 15 字中有 8 字以上相同 → 视为相似
- 标题公式完全相同(如连续 3 篇都是「X个方法」)→ 视为模式重复
维度 4:账号行为特征
综合评估本次发布是否会让账号行为显得「太机械」:
| 检查项 | 风险触发条件 |
|---|---|
| 发布时间 | 凌晨 0-6 点发布(非人类活跃时段)→ 建议延迟到 7-23 点 |
| 连续发布 | 30 分钟内连续发布 2 个以上平台 → 强制间隔 ≥ 15 分钟 |
| 内容长度 | 连续 3 篇字数完全相同(±10字)→ 建议本次调整字数 |
| 发布节假日 | 节假日发布频率突然增加 → 记录警告(平台会注意) |
输出格式
输出严格遵循以下 JSON 结构,不输出任何其他文字:
{
"platform": "xhs",
"decision": "allow | delay | block",
"risk_level": "low | medium | high | critical",
"risk_score": 23,
"dimensions": {
"frequency": { "level": "low", "detail": "本周已发1次,日均0.14次" },
"regularity": { "level": "medium", "detail": "最近3次间隔差异仅8分钟,偏规律" },
"diversity": { "level": "low", "detail": "开头模式与历史无重复" },
"behavior": { "level": "low", "detail": "发布时间14:30,正常活跃时段" }
},
"actions": {
"delay_minutes": 0,
"recommended_time": null,
"rewrite_required": false,
"rewrite_target": null,
"block_reason": null
},
"warnings": [
"最近3次发布间隔偏规律,建议下次发布随机偏移时间"
],
"memory_update": {
"write": true,
"field": "风控日志",
"content": "2026-04-16 14:30 xhs 放行,风险低"
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 171 lines · 59 tokens per session scan A 91e2e83aa2fd
publish-guard is an agent published in the GitHub repository AlanSong2077/Amplipost (45 stars, last pushed 4mo ago), licensed MIT. It adds 59 tokens to every session and 1,748 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.
Ultimate Transparent Thinking Beast Mode
Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.
Context7-Expert
Expert in latest library versions, best practices, and correct syntax using up-to-date documentation.
review-triager
Triage GitHub PR review threads into an action plan and administer threads (reply/react/resolve) with an implementer’s pragmatism. Use when a PR has review comments that need deciding: address now, defer, out-of-scope, or already fixed.