Back to skill

Security audit

Sage CGO

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent growth-advisor tool, but it persistently changes workspace agent-instruction files and can copy private company memory into the workspace without enough user control.

Install only in a workspace where you want Sage CGO to persistently influence future agent behavior. Review the generated sections in AGENTS.md, CLAUDE.md, and related files before continuing, keep sensitive company facts out of ~/.sage, and avoid creating sage-mirror inside a Git repo, cloud-synced folder, or shared workspace unless you are comfortable exposing that data.

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:9
Finding

Persistent Modification of Workspace Agent Instructions and Identity

Content
View full analysis
"$tmp_section" if [ ! -f "$path" ]; then { default_header_for "$file"; echo; echo "$MARK_BEGIN"; cat "$tmp_section"; echo "$MARK_END"; } > "$path" echo "[CREATE] $file"; rm -f "$tmp_section" "$tmp_out"; return fi awk -v begin="$MARK_BEGIN" -v end="$MARK_END" -v section="$tmp_section" ' BEGIN { while ((getline line < section) > 0) replacement = replacement line "\n"; in_block=0; replaced=0 } $0 == begin { print begin; printf "%s", replacement; print end; in_block=1; replaced=1; next } $0 == end && in_block { in_block=0; next } !in_block { print } END { if (!replaced) { print ""; print begin; printf "%s", replacement; print end } } ' "$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" ]; then upsert_sage_section "AGENT.md"; fi ``` ### Technical Analysis The documented startup procedure invokes a bootstrap script that creates or modifies workspace-level Agent control files. These files include primary instruction files (`AGENTS.md` and `CLAUDE.md`) as well as identity, user, tool, and heartbeat files. The script inserts a marked Sage CGO instruction section into every listed file. If a file already exists, the `awk` operation replaces the marked block or appends a new block. If it does not exist, t ...[truncated 2217 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mirror_sage.sh:13
Finding

Unrestricted Mirroring of Confidential Company Memory into the Current Workspace

Content
View full analysis
"$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 ``` ### Technical Analysis The mirror script recursively copies the entire `~/.sage` data store into a target directory that defaults to `sage-mirror` in the current workspace. According to the packaged manifest, this data store can include company profiles, team rosters, product and pricing information, operational workflows, recent decisions, meeting summaries, unresolved issues, and business insights. The operation applies no content filtering, repository detection, permission hardening, or version-control exclusion. The generated README labels the destination as “read-only,” but the script does not enforce read-only filesystem permissions. Files therefore retain ordinary writable behavior subject to the invoking user's permissions. When a target already exists, it is renamed to a timestamped backup. Repeated execution can consequently leave multiple historical copies containing stale or sensitive information. The script does not provide cleanup, retention limits, or warnings about committing the mirror to source control. This is especially risky when the target workspace is a Git repository, a cloud-synchronized folder, an indexed development environment, or a directory available to ...[truncated 1672 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心能力是创业增长顾问/增长系统建设,侧重 PMF、北极星指标、内容矩阵、渠道实验、变现路径等业务增长工作;而实际代码仅执行本地文件系统操作:检查 ~/.sage 是否存在、备份目标目录、递归复制 ~/.sage 到目标位置,并写入说明文档。虽然描述中提到会将增长记忆沉淀到 ~/.sage/growth,但该脚本并未实现任何增长相关逻辑,也不是专门处理 ~/.sage/growth,而是镜像整个 ~/.sage。其主要目的与声明的主要用途明显不一致,属于实质性能力和目的不匹配。

Content

No source excerpt is available for this finding.

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/bootstrap_workspace_identity.sh (reported line 104)May include surrounding context.

sh
{ echo "_Updated by Sage CGO bootstrap on $TODAY._"; echo; sage_section_for "$file"; } > "$tmp_section"
  if [ ! -f "$path" ]; then
    { default_header_for "$file"; echo; echo "$MARK_BEGIN"; cat "$tmp_section"; echo "$MARK_END"; } > "$path"
    echo "[CREATE] $file"; rm -f "$tmp_section" "$tmp_out"; return
  fi
  awk -v begin="$MARK_BEGIN" -v end="$MARK_END" -v section="$tmp_section" '
    BEGIN { while ((getline line < section) > 0) replacement = replacement line "\n"; in_block=0; replaced=0 }

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/bootstrap_workspace_identity.sh (reported line 113)May include surrounding context.

sh
{ echo "_Updated by Sage CGO bootstrap on $TODAY._"; echo; sage_section_for "$file"; } > "$tmp_section"
  if [ ! -f "$path" ]; then
    { default_header_for "$file"; echo; echo "$MARK_BEGIN"; cat "$tmp_section"; echo "$MARK_END"; } > "$path"
    echo "[CREATE] $file"; rm -f "$tmp_section" "$tmp_out"; return
  fi
  awk -v begin="$MARK_BEGIN" -v end="$MARK_END" -v section="$tmp_section" '
    BEGIN { while ((getline line < section) > 0) replacement = replacement line "\n"; in_block=0; replaced=0 }

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"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to execute local scripts that initialize ~/.sage, write growth data, and create a workspace mirror, all without an explicit consent/checkpoint warning to the user. This is dangerous because it can modify persistent files, duplicate potentially sensitive company data into the current workspace, and create unintended data exposure or state changes merely from invoking the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The default prompt describes treating the skill as a 'long-term growth partner' and then performing initialization/checks plus broad advisory tasks, but it does not define clear trigger boundaries or exclusions. In a manifest file, this kind of open-ended activation phrasing can overlap with many general growth-related requests and may cause unintended invocation.

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 locale at the skill level. Under the policy criteria, a fixed language setting is a violation unless the skill offers user choice or clearly documents a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The configuration hard-codes the language to "zh-CN" and provides no indication that users can choose another language or opt in to this locale. Per policy, forcing a specific language or locale without user choice is a natural-language policy concern unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The entire markdown template is written in Chinese and provides no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking context. Under the policy, a language-specific skill should either provide user opt-in or clearly document a justified locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire meeting summary template is written in Chinese, including all headings and field labels, which implicitly constrains the skill output to a specific language. The file does not offer an opt-in language choice or explain that the template is intended only for a Chinese-language or region-specific workflow.

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 forces a specific language for headings and instructions, which can violate language/locale policy when no user opt-in or rationale is provided. The file contains only Chinese labels such as '待跟进事项' and section headings, with no indication that the skill is region-specific or that other languages are supported.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown template includes a '触发条件' section but only provides the placeholder '待填写', leaving invocation conditions completely unspecified. This can lead to overly broad or ambiguous triggers when the template is used, increasing the risk of unintended skill or workflow activation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The invocation text says to load the file whenever the user discusses a long list of broad business topics such as growth strategy, GTM, ICP, or team operations. While domain-oriented, the condition is still expansive and does not define boundaries, exclusions, or negative examples, which could cause unintended activation in ordinary business conversations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file content is entirely in Chinese and provides no indication that language choice is optional or limited to a justified Chinese-language context. This can violate language or locale policy if the skill effectively constrains outputs or interaction to a specific language without user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document is written as a standing identity/instruction layer and presents all operational guidance in Chinese, implying the skill will operate in that language by default for every session. There is no indication that users may choose another language or locale, which can violate language-choice policy for general-purpose skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The entire skill file is written in Chinese and provides no indication that users may choose another language or that the skill is intentionally limited to Chinese-speaking contexts. Under the policy, forcing a specific language without opt-in 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
97% confidence
Finding

The entire onboarding skill is written in Chinese and provides no indication that the user may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in 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
91% confidence
Finding

The entire document is written in Chinese and provides no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in 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
94% confidence
Finding

标题及全文说明均以中文固定呈现,未见任何用户可选择语言/locale 的说明,也没有表明这是仅面向中文场景的受限文档。根据规则,强制特定语言而无用户 opt-in 属于自然语言策略违规。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script programmatically creates or rewrites multiple workspace instruction files (for example AGENTS.md, CLAUDE.md, IDENTITY.md, TOOLS.md) to alter the active agent's behavior. In a skill advertised as a growth advisor, silently persisting behavioral instructions into common control files materially changes downstream agent execution and can influence later sessions without explicit user review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script writes and overwrites instruction-bearing markdown files in place with no interactive confirmation, no preview, and no backup/rollback. Because these files commonly control agent behavior, silent modification can surprise users, disrupt existing policies, or persist unauthorized instructions in the repository.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script writes Chinese text literals such as '待填写' and Chinese document titles into generated markdown files, which imposes a specific language on users by default. This is a natural-language policy concern because there is no opt-in, alternative locale, or justification that the skill is intended only for Chinese-language use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The heartbeat check treats the Chinese phrase "待填写" as the marker for incomplete onboarding content. This imposes a specific language expectation in the skill logic and may fail for users working in other languages, which is a natural-language locale policy concern.

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)"