T06 · System Persistence
- Location
SKILL.md:205- Finding
Unattended Pipeline Resumption Through a Persistent Scheduled Task
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real book-generation workflow, but it can keep running later, expose API keys to child processes, and broadly commit or push repository changes.
Install only after reviewing the workflow carefully. Run it in a dedicated repository or branch, disable the cron safety-net behavior, avoid private source material with DeepWiki unless you explicitly approve the disclosure, do not export global API keys to all subagents, pin any optional dependencies, and review git status and diffs before any commit or push.
SKILL.md:205Unattended Pipeline Resumption Through a Persistent Scheduled Task
SKILL.md:532Mandatory Promotional Link Injection Into Generated Chapters
SKILL.md:612Global OpenClaw Credentials Are Exported to the Shared Process Environment
SKILL.md:903Unpinned Third-Party Skill Installation Creates a Supply-Chain Execution Risk
SKILL.md:956Overbroad Git Staging Can Publish Unrelated or Sensitive Repository Files
The code does not implement any AI orchestration, content generation, chapter revision, or book-writing workflow. Its sole purpose is post-processing an existing markdown file into HTML, with metadata handling and optional CSS generation. This is materially different from the declared purpose of producing or revising technical books via multi-agent AI. The behavior is narrower and unrelated to the listed triggers except in a very indirect manuscript-processing sense.
The declared description promises an end-to-end AI book creation workflow with parallel research/writing/review agents and support for revising chapters. The actual code does not perform any AI orchestration, content generation, revision, or review. It simply locates existing chapter markdown files and concatenates them into one manuscript with metadata and a table of contents. While manuscript assembly could be a supporting component of a book-writing system, this specific code chunk’s primary behavior is materially narrower and different from the declared purpose, so this is a clear description-behavior mismatch.
The declared description emphasizes end-to-end AI-driven book creation and chapter revision using multiple coordinated agents. In contrast, this code only performs document polishing and packaging on an already-written manuscript file. It adds formatting elements like title page, TOC, and copyright, then emits metadata. While this could be a supporting utility within a broader book-writing workflow, the supplied code chunk itself does not implement the core advertised capabilities, so the description does not accurately represent the actual behavior shown.
The declared description promises a content-generation workflow: spawning parallel agents to research, write, review, and revise book chapters. The actual code does none of that. It performs project maintenance/QA by checking markdown link targets, image paths, and orphaned diagram directories within a book repository. While link validation could be a supporting tool in a broader book-production pipeline, this code chunk’s primary purpose is materially different from the declared skill purpose, and the listed triggers about writing or revising books do not match this behavior. Therefore this is a clear description-behavior mismatch.
The skill explicitly directs overwriting existing chapter files and replacing diagram directories in place, while discouraging backups. That creates a strong integrity risk because a mistaken invocation, poor model output, or adversarial prompt can irreversibly alter project content and then propagate those changes via commit/push workflows.
**Best practice: Replace in-place, never create `-new` or `-v2` suffixes.**
- `chapters/chapter-NN.md` ← always overwrite the current file
- `diagrams/chapter-NN/` ← always replace diagrams in the same directory
- **No backups** (`-pre-revision`, `-old`, `-v2`) — git history IS the backup
- **No new directories** (`chapter-02-new/`) — the PR diff shows what changed
The skill instructs checking config and .env-style locations for API keys, which is direct credential discovery behavior. In combination with subsequent export instructions, this can unnecessarily expose secrets to logs, shell history, subagents, and child processes, making credential compromise substantially more likely.
# === OPTIONAL: Image Generation ===
echo "=== Image Generation (for scrapbook illustrations) ==="
# Check all possible locations: env vars, config.json, .env files
ZAI=$(grep -o '"zai_api_key"' ~/.openclaw/config.json 2>/dev/null)
GLM=$(grep -o '"glm_api_key"' ~/.openclaw/config.json 2>/dev/null)
OR=$(grep -o '"openrouter_api_key"' ~/.openclaw/config.json 2>/dev/null)
The skill clearly instructs file reads, file writes, git operations, and shell execution, but it does not declare a scoped permission boundary in the manifest. That increases the chance the runtime grants broader capabilities than a user would reasonably expect from a 'book writing' skill, especially because later steps include repository mutation and external calls.
The trigger phrases are broad and likely to match common writing-related requests, which can cause accidental activation of a high-impact skill that reads/writes files, clones repos, and may push changes. Over-broad invocation is more dangerous here because the skill is not read-only and includes autonomous orchestration and publishing actions.
The skill instructs cloning repositories, replacing chapter files, regenerating manuscripts, committing, and pushing changes, but it does not present an up-front warning that repository contents will be modified. This creates a real integrity risk: a user may invoke what sounds like a writing assistant and unexpectedly have local or remote repos altered.
The skill directs use of external network services such as DeepWiki and remote review/publishing flows, but this behavior is not made explicit in the top-level manifest description. Hidden or under-disclosed network transmission is risky because repository content, chapter drafts, and metadata may be sent to third parties without clear informed consent.
The revision workflow explicitly instructs querying DeepWiki and performing web search for updated information, which can transmit repo-related context off-box. In a book-writing skill this can be legitimate, but it is still a real data-exposure concern if the repo or draft content is sensitive or private.
If the revision requires new information (updated APIs, new features, recent events):
Spawn a **research agent** to:
- **Query DeepWiki MCP** (`curl https://api.deepwiki.com/v1/chat`) for current repo architecture and features
- Analyze the source repo (if provided) for changes since the chapter was written
- Web search for updated information and external context
- Produce `research/revision-research-chapter-NN.md`
The environment discovery section explicitly probes for API keys in local config and exports them as environment variables for downstream tools and subagents. Credential discovery and propagation materially increase the blast radius of any later prompt injection, subprocess compromise, or overly broad subagent behavior because secrets become more widely accessible than necessary.
The environment discovery workflow reads configuration files for API keys and exports them without any explicit privacy warning to the user. This is dangerous because a content-generation skill has no obvious need to inspect local secret storage, and users may not realize sensitive credentials are being surfaced to subagents and subprocesses.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# === OPTIONAL: DeepWiki ===
echo "=== DeepWiki MCP (for repo research) ==="
curl -s --max-time 3 https://api.deepwiki.com/v1/health >/dev/null 2>&1 && echo "✅ DeepWiki API reachable" || echo "⬜ DeepWiki unreachable (will use direct repo analysis)"
# === OPTIONAL: GitHub CLI ===
echo "=== GitHub CLI (for PR workflow) ==="
The skill sends repository identifiers and user prompts to an external API (api.deepwiki.com) for analysis. External transmission is contextually related to research, but it still creates a confidentiality risk because repository structure, topic details, or unpublished manuscript context may be disclosed to a third party.
# Query DeepWiki for detailed repo analysis
curl -s https://api.deepwiki.com/v1/chat \
-H "Content-Type: application/json" \
-d '{
"repo": "owner/repo",
The skill sends repository identifiers and user prompts to an external API (api.deepwiki.com) for analysis. External transmission is contextually related to research, but it still creates a confidentiality risk because repository structure, topic details, or unpublished manuscript context may be disclosed to a third party.
# Query DeepWiki for detailed repo analysis
curl -s https://api.deepwiki.com/v1/chat \
-H "Content-Type: application/json" \
-d '{
"repo": "owner/repo",
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
]
if css_path and os.path.exists(css_path):
cmd += [f"--css={css_path}"]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print(f"pandoc error: {result.stderr}", file=sys.stderr)
return False
The trigger phrases are broad enough to match many ordinary writing-related requests, which can cause this high-privilege skill to activate outside the user's clear intent. Because the skill requests exec, file read/write, and session spawning, accidental activation expands the attack surface and may lead to unnecessary code execution or repository access in unrelated contexts.
The regex-style trigger patterns are underspecified and can match vague or partial requests such as any request to 'write ... book' or 'book about ...', without confirming that the task actually requires this specific privileged workflow. In a skill that can execute commands and spawn sessions, ambiguous auto-activation increases the risk of misrouting user prompts into a powerful agent pipeline with broader system access than necessary.
The trigger example on line 10, "Help me write a book project", uses a vague everyday phrase rather than a distinctive invocation. Broad trigger phrases can cause the skill to activate in contexts where a user is only discussing planning or asking for lightweight help, which is especially risky here because the skill launches multi-agent orchestration for large-scale book generation and revision workflows.
The README describes a workflow that sets up a repo, generates chapters, research, reviews, logs, and final outputs, but it does not clearly warn users that running the skill will create and modify many files across the workspace/repository. In a multi-agent workflow, this omission can lead to unintended local changes, repository pollution, or accidental overwrites, especially when users invoke it on an existing project rather than an isolated directory.
The very short trigger 写书 is prone to accidental matches in ordinary conversation. This matters because accidental invocation can launch a skill with file, shell, network, and repository-modification behavior rather than a harmless drafting assistant.
The PR workflow explicitly copies the original chapter to chapters/chapter-NN-pre-revision.md, while the later integration guidance says 'No backups' and states that git history is the backup. This is a direct contradiction between the skill's own procedural guidance and its stated revision policy.
The image-generation command passes --language en, forcing English output regardless of the user's preferred language. This is a natural-language locale constraint documented in the skill, but the file does not present it as an option or justify it as region-specific behavior.
The trigger list mixes English and Chinese phrases, but the manifest does not explain whether the skill will operate in the user's language, switch languages automatically, or impose any locale-specific behavior. This can create ambiguity around language handling without explicit user choice or documentation.
No suspicious patterns detected.