Back to skill

Security audit

Sage CPO

Security checks for vulnerabilities and agentic risk

Overview

This product-advice skill is local-only, but it automatically rewrites workspace agent-instruction files and can duplicate business memory into the project, so it needs review before installation.

Install only if you want this skill to persistently shape agent behavior in the workspace. Before use, review the files it may create or modify, especially AGENTS.md, CLAUDE.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, HEARTBEAT.md, ~/.sage, and sage-mirror/. Avoid storing secrets in ~/.sage, keep mirrors out of version control, and require a manual diff or backup before running the bootstrap script.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
scripts/bootstrap_workspace_identity.sh:10
Finding

Persistent Workspace-Level Agent Instruction and Identity Hijacking

Content
View full analysis
&2 exit 1 fi ``` From `scripts/bootstrap_workspace_identity.sh:18-38`: ```bash sage_section_for() { local file="$1" case "$file" in "AGENTS.md"|"CLAUDE.md"|"AGENT.md") cat <<'EOF' ## Sage CPO Workspace Role The Agent operating in this workspace is instructed to become Sage CPO rather than use Sage CPO only as a task-scoped capability. Startup sequence: 1. Inspect the current workspace structure, existing context, and this file. 2. Load the Sage CPO core identity and product reasoning instructions during every session. 3. Inspect the shared company knowledge base and product extension. 4. Treat the persistent Sage directories as the source of product facts. 5. Load additional product operating-system instructions for relevant discussions. 6. Load scenario instructions for requirements, MVP, PMF, pricing, customization, and AI products. 7. Require output to follow the product-executive decision format. EOF ;; ``` The quoted heredoc above is an English rendering of the instructions written by the script. The actual package contains the equivalent directives in Chinese. From `scripts/bootstrap_workspace_identity.sh:118-129`: ```bash ' "$path" > "$tmp_out" mv "$tmp_out" "$path" rm -f "$tmp_section" echo "[UPDATE] $file" } for file in "${OPENCLAW_FILES[@]}"; do upsert_sage_section "$file"; done if [ -f "$WORKSPACE/AGENT.md" ]; th ...[truncated 2769 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mirror_sage.sh:4
Finding

Writable Business-Memory Mirror Misrepresented as Read-Only

Content
View full analysis
&2 exit 1 fi if [ -e "$TARGET" ]; then TS="$(date +%Y%m%d-%H%M%S)" BACKUP="${TARGET}.backup-${TS}" mv "$TARGET" "$BACKUP" echo "[INFO] Existing $TARGET moved to $BACKUP" fi mkdir -p "$TARGET" cp -R "$SAGE_HOME"/. "$TARGET"/ ``` From `scripts/mirror_sage.sh:22-35`: ```bash cat > "$TARGET/README.md" <<'EOF' # Sage DNA Mirror This folder is a read-only workspace mirror of `~/.sage`, created for convenient browsing. Rules: - `~/.sage` remains the source of truth. - Do not edit this mirror expecting changes to sync back automatically. - If you want to update company DNA, update `~/.sage` through Sage COO. EOF echo "[OK] Mirrored $SAGE_HOME to $TARGET" echo "[NOTE] This is a read-only browsing mirror. Source of truth remains $SAGE_HOME" ``` ### Technical Analysis The script copies the complete contents of `~/.sage` into a caller-controlled target path, which defaults to `sage-mirror` in the current workspace. The copied data can include: - Company profiles and history. - Team rosters and optional contact details. - Product and pricing information. - Operational workflows. - Meeting summaries. - Open issues and recent decisions. - Product feedback, experiments, metrics, and roadmaps. Although the script repeatedly calls the result a “read-only” mirror, it does not apply read-only permissions, access-control restrictions, filesystem attributes, or any other technical enforcement. `mkdir -p` and `cp -R` normally produce an ordinary writable directory subject to the invoking ...[truncated 2259 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (39)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a high-level AI product copilot focused on product strategy and memory in ~/.sage/product. The supplied code does not implement product ideation, analysis, roadmap support, or any AI/CPO behavior. Instead, it performs a filesystem operation: mirroring the entire /.sage directory to another folder, optionally moving aside an existing target as a backup, and creating a README. This is a materially different primary purpose and introduces undeclared file-copy/backup capabilities against a broader resource scope (/.sage, not specifically ~/.sage/product).

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file content is entirely in Chinese and the loading instruction is written as an unconditional directive, with no indication that language choice depends on user preference. This can violate language/locale policy because it effectively constrains the interaction language without opt-in or documented regional justification.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/init_sage.sh (reported line 24)May include surrounding context.

sh
TODAY="$(date +%Y-%m-%d)"
if [ -f "$SAGE_HOME/MANIFEST.yaml" ]; then
  sed -i.bak "s/last_updated: \"YYYY-MM-DD\"/last_updated: \"$TODAY\"/" "$SAGE_HOME/MANIFEST.yaml" && rm -f "$SAGE_HOME/MANIFEST.yaml.bak"
fi
if [ -f "$SAGE_HOME/INDEX.md" ]; then
  perl -0pi -e 's/`YYYY-MM-DD`:初始化/`'"$TODAY"'`:初始化/' "$SAGE_HOME/INDEX.md"

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/init_sage.sh (reported line 24)May include surrounding context.

sh
TODAY="$(date +%Y-%m-%d)"
if [ -f "$SAGE_HOME/MANIFEST.yaml" ]; then
  sed -i.bak "s/last_updated: \"YYYY-MM-DD\"/last_updated: \"$TODAY\"/" "$SAGE_HOME/MANIFEST.yaml" && rm -f "$SAGE_HOME/MANIFEST.yaml.bak"
fi
if [ -f "$SAGE_HOME/INDEX.md" ]; then
  perl -0pi -e 's/`YYYY-MM-DD`:初始化/`'"$TODAY"'`:初始化/' "$SAGE_HOME/INDEX.md"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest description is written entirely in Chinese and presents the skill identity and operating model in that locale, with no indication that users may choose another language. Under the policy, language or locale constraints should either be optional or explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to run initialization and write-related scripts that can create or modify files in the user’s home directory and workspace, but it does not require an explicit warning, preview, or consent step before doing so. In an agentic environment, implicit filesystem modification can surprise users, overwrite expected state, or expand the blast radius if the referenced scripts behave unsafely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill metadata and prompt are written entirely in Chinese and do not indicate any user language negotiation or locale requirement. This can cause mismatched-language responses, reduce user comprehension of the skill's actions, and weaken informed consent around potentially sensitive steps like checking or initializing ~/.sage company memory.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The default prompt frames the skill as a broad, persistent 'long-term product partner' and directs initialization of shared product memory, which can cause the agent to activate for a wide range of generic product-advice requests. This increases the chance of over-triggering, unintended context capture, and the skill influencing conversations beyond a narrowly scoped use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest sets language: "zh-CN", which imposes a specific language/locale. Under the policy rules, locale restrictions should either be optional for the user or clearly justified as region-specific; this file provides neither.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file’s headings and placeholder instructions are entirely in Chinese, which imposes a specific language/locale on downstream use of the skill content. There is no indication that Chinese is optional, user-selected, or required for a documented region-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown template presents all headings and placeholder instructions exclusively in Chinese, which can amount to a language policy violation when no user opt-in or locale limitation is stated. The file does not indicate that it is intended only for Chinese-speaking users or a region-specific workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setting "language": "zh-CN" hard-codes a specific language/locale in the skill configuration. Under the policy, forcing a language without offering user choice or documenting a justified regional constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s title, instructions, and template content are entirely in Chinese, which imposes a specific language/locale on users. There is no indication that users may choose another language, nor any documented justification that this skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing instructions and section labels in Chinese, which can force a specific language experience on users without opt-in. The policy requires either offering a language/locale choice or clearly documenting and justifying the locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document is entirely written in Chinese, including the title and section headings, with no indication that the language choice is optional or tied to a region-specific requirement. This can violate language/locale policy when a skill or operational document implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

这是一个 markdown 模板文件,适用 SQP-1。L07-L09 的“触发条件”仅写为“待填写”,没有说明具体触发语、适用范围或排除条件,容易造成实现者后续写出过宽或不明确的调用条件。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation trigger is very broad: any discussion about product strategy, metrics, OKRs, roadmap, team cadence, discovery, or product org operations will load this file. Overbroad activation can cause the skill to intervene in many normal conversations where it was not explicitly requested, increasing the chance of unwanted instruction injection, context pollution, or inappropriate persistence behavior tied to the broader skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The entire skill content is written as Chinese-only operating guidance and does not indicate that the assistant should adapt to the user's preferred language or offer a locale choice. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the regional/language constraint is explicit and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script injects Chinese-language identity and operating instructions into workspace files, including normative statements about how the agent should behave and respond, without offering a language choice or documenting a justified locale restriction. This can violate language/locale policy because it imposes a specific language context on all users of the workspace.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script automatically creates and overwrites multiple workspace instruction files without any prompt, dry-run mode, backup, or explicit consent. In an agent-skill context, modifying AGENTS.md/CLAUDE.md/IDENTITY.md can silently change downstream agent behavior and persistence, which makes this a real integrity risk even though the writes are marker-bounded.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/init_sage.sh (reported line 19)May include surrounding context.

sh
exit 0
fi

mkdir -p "$SAGE_HOME"
cp -R "$TEMPLATE_DIR"/. "$SAGE_HOME"/

TODAY="$(date +%Y-%m-%d)"

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The script copies the entire contents of ~/.sage into a workspace-accessible mirror directory, which can persist and expose sensitive product memory, credentials, notes, or other internal data beyond its original protected location. Even though the README calls the mirror 'read-only', filesystem permissions are not actually enforced, and the duplicated data increases the attack surface for leakage, accidental commit, or access by other tools/users.

Content

Scanner excerpt · scripts/mirror_sage.sh (reported line 19)May include surrounding context.

sh
echo "[INFO] Existing $TARGET moved to $BACKUP"
fi

mkdir -p "$TARGET"
cp -R "$SAGE_HOME"/. "$TARGET"/

cat > "$TARGET/README.md" <<'EOF'

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The template headings and instructional text are entirely in Chinese, which imposes a specific language on users without any stated opt-in or justification. Under the policy rule for natural-language violations, a fixed language requirement should be either optional or clearly scoped to a justified locale-specific use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file is written only in Chinese and does not indicate that the user can choose another language or locale. Under the policy, language constraints should be optional or explicitly justified; here no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown content is entirely written in Chinese, which constitutes a language-specific instruction/context without any indication that the user can choose another language. The policy allows locale constraints only when user choice is offered or the regional limitation is clearly documented and justified, neither of which appears here.

Content

No source excerpt is available for this finding.