Back to skill

Security audit

Sage COO

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed AI COO memory tool, but it automatically modifies persistent agent-instruction files and stores business memory in local files, so users should review it before installing.

Install only if you want this skill to persistently turn a workspace into a Sage COO workspace and maintain company memory under ~/.sage. Review which workspace files it will create or update, avoid storing secrets or highly sensitive business data, and be careful before using the mirror feature in repositories or synced folders.

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

Persistent Modification of Workspace Agent-Control Files

Content
View full analysis

Vulnerability Details

File Location: scripts/bootstrap_workspace_identity.sh:193-200
Related Locations: scripts/bootstrap_workspace_identity.sh:17-23, 42-112, 133-191; SKILL.md:13-15, 40-60; references/openclaw-workspace-bootstrap.md:23-56
Vulnerability Type: Persistent workspace instruction injection
Risk Level: Critical

Vulnerable Code

bash
for file in "${OPENCLAW_FILES[@]}"; do
  upsert_sage_section "$file"
done

if [ -f "$WORKSPACE/AGENT.md" ]; then
  upsert_sage_section "AGENT.md"
fi

The target list is defined as:

bash
OPENCLAW_FILES=(
  "AGENTS.md"
  "CLAUDE.md"
  "SOUL.md"
  "IDENTITY.md"
  "TOOLS.md"
  "USER.md"
  "HEARTBEAT.md"
)

The update function writes a managed section to files that do not exist and replaces or appends the section in existing files:

bash
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 &amp;&amp; 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"

Technical Analysis

The bootstrap process creates or modifies files commonly loaded as authoritative Agent instructions, identity definitions, personality rules, user context, and recurring task gui ...[truncated 2543 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove workspace identity modification from the default Skill startup procedure.
  2. Keep role and response-style instructions scoped to the active Skill session.
  3. Require explicit, informed confirmation before modifying any Agent-control file.
  4. Present a dry-run diff that lists every file to be created or changed.
  5. Allow users to select individual target files rather than modifying the complete predefined list.
  6. Detect conflicts with existing instructions and stop rather than appending potentially contradictory rules.
  7. Create timestamped backups before modification and provide a documented uninstall command that removes only the managed sections.
  8. Separate optional workspace initialization from normal company-memory initialization.
  9. Do not inject mandatory identity or output-format rules into files consumed by unrelated Agent runtimes.
  10. Record user consent and report the exact files changed after execution.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mirror_sage.sh:12
Finding

Company Memory Is Stored and Mirrored Without Enforced Access Controls

Content
View full analysis

Vulnerability Details

File Location: scripts/mirror_sage.sh:12-20
Related Locations: scripts/init_sage.sh:4, 17-20; references/sage-dna-protocol.md:98-105
Vulnerability Type: Insecure storage and duplication of potentially sensitive business data
Risk Level: Medium

Vulnerable Code

The initialization script creates the long-term memory directory without setting a restrictive process mask or explicit permissions:

bash
if [ -d "$SAGE_HOME" ]; then
  echo "[OK] $SAGE_HOME already exists. No files overwritten."
  exit 0
fi

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

The mirroring script duplicates the entire memory directory into a workspace:

bash
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"/

It subsequently labels the copy as read-only but does not enforce read-only permissions:

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

Technical Analysis

The long-term store is intended to contain company profiles, personnel rosters, customer information, pricing, operational workflows, meeting summaries, decisions, and unresolved business issues. Although the templates advise against storing passwords, API keys, bank details, and private links, the scripts do not enforce filesystem confidentiality.

mkdir -p and cp -R rely on the caller's current umask and inherited source permissions. In an environment with permissive defaults, other local users or ...[truncated 2462 chars]

Remediation
View remediation

Remediation Suggestions

  1. Set umask 077 before creating or copying company-memory files.
  2. Create ~/.sage and mirror directories with mode 0700.
  3. Create sensitive files with mode 0600 and verify permissions after copying.
  4. Replace full-tree mirroring with an explicit allowlist or user-selected file list.
  5. Display a pre-copy inventory and require confirmation when files may contain personnel, customer, financial, or strategic information.
  6. Add generated mirrors and timestamped backups to .gitignore automatically, or refuse to mirror inside a version-controlled workspace unless explicitly confirmed.
  7. Enforce the claimed read-only state with appropriate file permissions where operationally suitable.
  8. Warn that local permissions do not prevent cloud synchronization, indexing, backup, or repository inclusion.
  9. Avoid retaining unlimited timestamped backups; implement bounded retention and a secure cleanup option.
  10. Detect symbolic links and unsafe target paths before moving or copying data.
  11. Provide a redacted export mode that excludes rosters, contacts, customer records, meeting summaries, and other sensitive domains.
  12. Preserve the existing privacy guidance but supplement it with technical controls rather than relying only on Agent compliance.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (42)

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 explicitly instructs the agent to create or modify multiple workspace files and even provides shell commands to do so, but it does not require obtaining explicit user consent or clearly warning that local files will be changed. This creates a real risk of unauthorized filesystem modification, especially because the affected files shape agent behavior and may alter existing project configuration in ways the user did not intend.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing description and default prompt are written entirely in Chinese, indicating a fixed language experience with no stated option for alternative languages. This can violate language or locale policy when the skill does not offer the user a language choice or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The default prompt broadly activates the agent as a 'long-term operations partner' and instructs it to inspect or initialize ~/.sage without clear user-trigger boundaries, scope limits, or exclusions. In an agent/workspace environment, this can cause overcollection of local context and unnecessary persistence access, increasing the chance of unintended data exposure or overbroad autonomous behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill entrypoint and its operational instructions are written as mandatory Chinese-language guidance for any Sage agent that starts from this file. There is no indication that users may choose another language or that the locale restriction is required for a region-specific or compliance-bound purpose, which creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest sets language: "zh-CN", which is a natural-language locale constraint. Under the policy, forcing a specific language is a violation unless the skill offers user opt-in or clearly documents that the skill is region-specific and why that constraint is necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents all user-facing headings and placeholders exclusively in Chinese, such as '公司发展历程' and '待填写'. Under the policy rules, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The configuration hard-codes the skill language to "zh-CN", which is a natural-language locale restriction. The provided file does not indicate any user choice, opt-in, or documented justification for limiting the skill to this locale.

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 template is written in Chinese and provides no indication that users may choose another language or locale. Under the policy rule for natural-language constraints, this is a locale/language restriction without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s headings and instructions are entirely in Chinese, which imposes a specific language on users with no visible opt-in or alternative locale. Under the policy, language constraints should either be user-selectable or clearly justified as 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

The template headings and placeholder text are entirely in Chinese, which implicitly directs users to produce content in that language. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown template includes a '触发条件' section but only contains the placeholder '待填写', so it does not define when the workflow should or should not be used. The lack of concrete trigger phrases or exclusion conditions makes activation scope ambiguous and could lead to unintended invocation when downstream users fill or interpret the template loosely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown template is entirely written in Chinese, including all headings and placeholder text, with no indication that another language may be used. Under the policy rule for natural-language violations, forcing a specific language without user opt-in can be a locale/language policy issue.

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 presents the skill identity and instructions entirely in Chinese and states it should be loaded for every session, which implies a default Chinese-language operating mode. There is no opt-in, alternative language option, or justification that the skill is intended only for a Chinese-language context, so this creates a language/locale policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation condition is broad and topic-based, so the skill may load during ordinary discussions about OKRs, metrics, meetings, or founder time allocation even when the user did not intend to invoke a COO workflow. This can cause over-collection or persistence of business context into ~/.sage and may steer conversations into operational guidance unnecessarily, increasing the chance of unwanted context injection or inappropriate file writes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The entire onboarding instruction set, including the prescribed opening lines and interaction style, is written only in Chinese and does not state that the user may choose another language. This can amount to a language policy violation because it implicitly constrains the interaction locale without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly instructs the agent to modify workspace identity files and update ~/.sage files during onboarding, but it does not require obtaining explicit user consent immediately before making those changes. This can lead to unauthorized or surprising file modifications in the user's workspace, especially because the changes affect persistent agent behavior and not just local notes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file is entirely written as a Chinese-only operating instruction for the skill and presents the persona/bootstrap behavior in that language without any opt-in or alternative locale guidance. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy violation.

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 create or modify multiple workspace control files (such as AGENTS.md, CLAUDE.md, SOUL.md, and IDENTITY.md) to alter agent behavior and identity, but it does not require explicit user confirmation or provide a warning that local project state will be changed. Because these files influence future sessions and may persistently steer agent behavior, silent modification creates a real risk of unauthorized workspace tampering and durable prompt injection.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The phrase stating the user is 'obviously in a state of having many things but unable to grasp the priorities' is subjective and lacks concrete boundaries. Because this is a markdown file describing activation conditions, the vague wording could cause the skill to activate based on normal conversational ambiguity rather than a clearly defined trigger.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The condition activates when the user asks to 'organize company memory' or 'check whether .sage is healthy,' but it does not define scope limits, required context, or exclusion cases. In markdown trigger guidance, this can overlap with routine requests and lead to unintended invocation of a broader diagnostic workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The document is entirely written as a fixed Chinese interaction protocol, beginning with a Chinese-titled '互动协议', and it does not indicate that the user may choose another language or locale. This can violate language/locale policy when a skill constrains interaction language without explicit user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document instructs the agent to write persisted data into the user's home-directory state store ($HOME/.sage/) by default, without requiring an explicit consent/confirmation step immediately before modifying local files. Because this skill is designed to accumulate long-term company memory, incorrect inference, prompt-injected content, or overshared sensitive business data could be silently persisted and later reused, expanding the blast radius beyond a single chat.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content inserted by the script is written in Chinese and directs the agent's behavior in that language context, but the file provides no user choice or opt-in regarding language or locale. This can violate language/locale policy expectations when the user or workspace may not prefer Chinese.

Content

No source excerpt is available for this finding.