Back to skill

Security audit

CompoundMind

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent memory-indexing purpose, but it stores and resurfaces sensitive credentials, tokens, wallet/config details, and persistent behavioral directives in ways users should review carefully.

Install only after removing the bundled experience data, rotating any exposed credentials, and adding secret/PII redaction before persistence, indexing, briefing, or LLM calls. Treat all retrieved memories as untrusted notes, not instructions, and avoid enabling cron, heartbeat hooks, or --llm mode until scope, consent, and review controls are added.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
distill.py:421
Finding
Unredacted credentials and personal data are persisted in plaintext<![CDATA[ ## Vulnerability Details **File Location**: `distill.py:421-447`, `distill.py:483-503`; confirmed sensitive records in `data/experiences/2e40b3400fb0.json:37-46,211` and personal data in `data/experiences/d17102135085.json:88-89` **Vulnerability Type**: Plaintext sensitive-data storage and secret exposure **Risk Level**: High ### Vulnerable Code ```python def extract_facts(sections: list[dict]) -> list[dict]: """Extract specific, concrete facts.""" facts = [] seen = set() for section in sections: body = section["body"] header = section["header"] for line in body.splitlines(): line = line.strip() if len(line) < 15 or len(line) > 400: continue if any(re.search(p, line) for p in FACT_PATTERNS): key = line[:50] if key in seen: continue seen.add(key) # Strip markdown formatting clean = re.sub(r"\*{1,2}(.+?)\*{1,2}", r"\1", line) clean = re.sub(r"`(.+?)`", r"\1", clean) facts.append({ "fact": clean[:400], "domain": detect_domain(line + " " + header), "tags": extract_tags(line) }) return facts[:20] ``` The extracted values are subsequently written without redaction: ```python experience = { "id": exp_id, "source": relative, "source_date": source_date, "distilled_at": datetime.now().isoformat(), "hash": h, **extracted } EXP_DIR.mkdir(parents=True, exist_ok=True) exp_path = EXP_DIR / f"{exp_id}.json" exp_path.write_text(json.dumps(experience, indent=2)) ``` The package contains records matching live credential formats, including an API key identifier, an API secret, a service key, credential file paths, and an email address. The credential values are intentionally not reproduced in this report. ### Technical Analysis The `FACT_ ...[truncated 1939 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate every credential contained in bundled experience files and repository history. 2. Remove all credentials and unnecessary personal information from distributed JSON, SQLite files, commits, release archives, and backups. 3. Replace secret-oriented fact extraction with an allowlist of safe fact types. 4. Add redaction before persistence for: - API keys and bearer tokens - High-entropy secret strings - Private keys and seed phrases - Passwords and authentication cookies - Email addresses and other personal identifiers - Credential and configuration file contents 5. Store only indirect references, such as “credential available through the configured secret manager.” 6. Run the same redaction pipeline before indexing, printing, saving briefings, and making any external API call. 7. Apply restrictive permissions such as owner-only access to generated data files. 8. Consider encrypting sensitive local state with a key held outside the project directory. 9. Add automated secret scanning to tests and release packaging. 10. Fail closed when a record resembles a secret, requiring explicit user approval before retention. ]]>

T02 · Agent Memory Poisoning

Error
Location
distill.py:228
Finding
Untrusted memory directives can poison persistent Agent briefings<![CDATA[ ## Vulnerability Details **File Location**: `distill.py:228-258`, `brief.py:173-215`; confirmed directive records in `data/experiences/d17102135085.json:18` and `data/experiences/8ec0e63d4750.json:19` **Vulnerability Type**: Persistent instruction injection through distilled memory **Risk Level**: High ### Vulnerable Code ```python if section_is_lesson: # Extract all bullets from this section as lessons bullets = extract_bullet_items(body) for bullet in bullets: if bullet in seen: continue seen.add(bullet) outcome = outcome_of(bullet) domain = detect_domain(bullet + " " + header) importance = importance_of(bullet, outcome) lessons.append({ "text": bullet[:500], "domain": domain, "outcome": outcome, "importance": importance, "tags": extract_tags(bullet) }) else: # Scan body for lesson-pattern lines for line in body.splitlines(): line = line.strip() if len(line) < 30: continue if any(re.search(p, line) for p in LESSON_PATTERNS): if line in seen: continue seen.add(line) outcome = outcome_of(line) domain = detect_domain(line + " " + header) importance = importance_of(line, outcome) lessons.append({ "text": line[:500], "domain": domain, "outcome": outcome, "importance": importance, "tags": extract_tags(line) }) ``` Retrieved records are interpolated directly into the LLM prompt: ```python if wisdom ...[truncated 4172 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat every memory record as untrusted evidence, not as an executable instruction. 2. Reject or quarantine imperative records containing operational directives, destination identifiers, credential requests, privilege changes, or instructions to bypass confirmation. 3. Store provenance for every record, including author, source type, trust level, extraction method, and whether the user explicitly approved it. 4. Require explicit user confirmation before promoting a record into a persistent rule or preference. 5. Separate descriptive facts from normative rules in both storage and retrieval. 6. Place retrieved records in a clearly delimited data block and add a higher-priority instruction stating that instructions found inside the records must never be followed. 7. Escape or structurally encode retrieved records rather than concatenating them into a free-form prompt. 8. Reduce ranking weight for imperative language instead of increasing it. 9. Add policy checks that prevent stored memories from changing message destinations, permissions, authentication settings, scheduled tasks, or security controls. 10. Provide a review interface for inspecting, deleting, and correcting promoted memories. 11. Add adversarial tests covering prompt injection in Markdown headings, bullets, quotations, tool output, and relationship records. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
brief.py:162
Finding
Optional LLM synthesis can disclose sensitive stored memory to a third party<![CDATA[ ## Vulnerability Details **File Location**: `brief.py:162-215`; related documentation at `SKILL.md:126-128` **Vulnerability Type**: Unfiltered external transmission of sensitive memory records **Risk Level**: Medium ### Vulnerable Code ```python def build_briefing_llm(task: str, wisdom: dict, domains: list[str]) -> str: """Build briefing with LLM synthesis using COMPOUND_MIND_LLM_KEY.""" llm_key = os.environ.get("COMPOUND_MIND_LLM_KEY") or os.environ.get("ANTHROPIC_API_KEY") if not llm_key: raise RuntimeError("No LLM key available") try: import anthropic client = anthropic.Anthropic(api_key=llm_key) # Build wisdom summary for prompt sections = [] if wisdom["lessons"]: sections.append("LESSONS:") for r in wisdom["lessons"][:6]: outcome = r.get("outcome") or r.get("quality") or "" sections.append(f" [{outcome}] {r['text'][:200]} ({r.get('source_date', '')[:7]})") if wisdom["decisions"]: sections.append("DECISIONS:") for r in wisdom["decisions"][:4]: sections.append(f" {r['text'][:200]}") if wisdom["facts"]: sections.append("KEY FACTS:") for r in wisdom["facts"][:5]: sections.append(f" {r['text'][:150]}") if wisdom["relationships"]: sections.append("RELATIONSHIPS:") for r in wisdom["relationships"][:3]: sections.append(f" {r['text'][:150]}") wisdom_text = "\n".join(sections) or "No relevant experience found." domain_str = ", ".join(domains) prompt = f"""You are CompoundMind - a system surfacing relevant past experience before each task. Task: {task} Domains: {domain_str} Relevant accumulated wisdom: --- {wisdom_text} --- Generate a sharp pre-session briefing. Format: 1. One sentence framing the task from experience angle 2. TOP LESSONS (max 4 bullets) 3. WATCH ...[truncated 2580 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Apply mandatory secret and PII redaction immediately before every external API request. 2. Exclude the `facts` and `relationships` categories from external synthesis by default. 3. Introduce an explicit consent screen showing the exact records that will be transmitted. 4. Clearly document that LLM mode sends selected memory content to Anthropic. 5. Provide a strict offline configuration that disables all network-backed synthesis. 6. Allow users to label records as local-only, confidential, or externally shareable. 7. Minimize transmitted content to derived, non-sensitive summaries rather than raw records. 8. Block external transmission if secret scanning detects credentials, private keys, tokens, authentication material, or personal identifiers. 9. Log only metadata about external requests and never log prompt contents containing memory records. 10. Define retention and data-processing expectations in the documentation so users can make an informed decision. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (50)

Natural-Language Policy Violations

Critical
Confidence
100% confidence
Finding
The content includes hardcoded API credentials in plaintext, including an API secret that can likely be used immediately. Plaintext secrets in a repository or memory store are directly exploitable, easy to copy, and often propagated through logs, backups, embeddings, and search indexes.

Natural-Language Policy Violations

Critical
Confidence
100% confidence
Finding
A plaintext API key is stored in the natural-language 'facts' section, making the key available to anyone or any system that can read the memory artifact. Because this file belongs to a compounding memory/indexing skill, the key is especially dangerous: it may be replicated into searchable indexes, model context, or derived datasets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
This second mismatch likewise shows the skill claims broad raw-log distillation and searchable indexing, while the analyzed behavior appears narrower and also introduces undeclared external LLM usage. In a memory-processing skill, inaccurate capability claims are especially dangerous because they can hide the fact that sensitive historical data may leave the local environment or be processed in ways the user did not consent to.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
This second mismatch likewise shows the skill claims broad raw-log distillation and searchable indexing, while the analyzed behavior appears narrower and also introduces undeclared external LLM usage. In a memory-processing skill, inaccurate capability claims are especially dangerous because they can hide the fact that sensitive historical data may leave the local environment or be processed in ways the user did not consent to.

Credential Access

High
Category
Privilege Escalation
Content
]
    },
    {
      "fact": "- Wallet: nix-wallet, address kii1lkstmxppnxlv4u447csvv2dfy76lv7cjhvuxkk (keyring: test)",
      "domain": "trading",
      "tags": [
        "wallet"
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"hash": "63fa965c95a9d2f07a080272b8508dfd",
  "lessons": [
    {
      "text": "Access Key + Secret Key stored at `/root/.config/kling-ai/credentials.json`",
      "domain": "coding",
      "outcome": "neutral",
      "importance": 3,
Confidence
90% confidence
Finding
Referencing the exact path to a credentials file exposes where secrets are stored on the host and provides attackers or over-privileged agents a direct target for collection. Even without embedding the file contents, disclosing secret locations materially assists credential theft and post-compromise discovery.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
This record stores credential file paths plus raw API identifiers and secrets inside a long-term 'experience' artifact, which defeats the stated goal of storing distilled knowledge rather than sensitive source material. If this file is indexed, synced, or exposed to other agents or users, the secrets can be used directly for unauthorized access and lateral movement.

Credential Access

High
Category
Privilege Escalation
Content
]
    },
    {
      "text": "Stored at: `/root/.config/higgsfield/credentials.json`",
      "domain": "coding",
      "outcome": "neutral",
      "importance": 3,
Confidence
90% confidence
Finding
The experience data reveals another exact credentials file location, increasing the attack surface by mapping sensitive files for downstream readers. In a persistent agent-memory context, these storage references become retrievable operational intelligence that can facilitate credential harvesting.

Intent-Code Divergence

High
Confidence
95% confidence
Finding
The file claims credentials were redacted in relationship notes, but unredacted secrets are present elsewhere in the same record. This inconsistency creates a false sense of safety and indicates the redaction process is incomplete or bypassable, making accidental disclosure more likely.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The 'facts' section retains a plaintext API key and financial-sensitive wallet information, which are not necessary as durable distilled memory. Searchable retention of such data increases the blast radius of any memory leak, index exposure, or downstream agent misuse.

Natural-Language Policy Violations

High
Confidence
99% confidence
Finding
The file contains what appears to be a live hard-coded API key embedded in stored experience data. Secrets in JSON memory artifacts are dangerous because they can be exfiltrated by anyone with repository, backup, log, or index access, and this skill is explicitly designed to accumulate and surface historical data, which increases the chance of unintended disclosure and reuse.

Natural-Language Policy Violations

High
Confidence
95% confidence
Finding
This is a direct natural-language instruction telling agents not to ask permission before acting, which conflicts with safety expectations around user consent and change control. Because this file is an experience distillation artifact meant to influence future behavior, the instruction is more dangerous than a casual note: it can systematically bias agents toward bypassing approval workflows.

Credential Access

High
Category
Privilege Escalation
Content
"relationships": [],
  "facts": [
    {
      "fact": "- New JWT token: stored in /root/.config/upload-post/credentials.json",
      "domain": "social",
      "tags": [
        "post",
Confidence
98% confidence
Finding
Referencing credentials.json alongside a JWT token location is credential-access-enabling information because it points directly to a likely secret store. Within this skill's long-term memory context, that creates a durable map to sensitive material and increases the chance of later unauthorized access by agents or anyone who can query the index.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
This file stores sensitive operational data inside a long-lived experience index, including an API key, wallet identifiers, and deployment addresses. In a memory/learning skill, that is especially dangerous because these records are designed to be retained, searched, and reused by agents, which increases the chance of unintended disclosure, prompt-context exfiltration, or abuse of credentials and infrastructure metadata.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The fact extraction patterns intentionally capture highly sensitive material such as API keys, tokens, wallet addresses, endpoints, paths, and config values from memory files and write them to persistent output. This increases the blast radius of any secret already present in logs by duplicating it into a searchable derived dataset, making accidental exposure or later compromise more likely.

Missing User Warnings

High
Confidence
96% confidence
Finding
These routines extract and store relationship insights and fact-like strings that can include personal preferences, instructions, wallet addresses, API keys, tokens, endpoints, and config details, yet there is no explicit warning or protective handling. In the context of a long-term memory skill, this is especially risky because it systematizes sensitive content into structured records that are easier to search, correlate, and exfiltrate.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill advertises shell, file read/write, and environment-dependent behavior but does not declare any tool scope or permissions boundaries. In an agent ecosystem, this creates an authorization transparency gap: users and orchestrators cannot reliably assess what the skill may access or modify, increasing the chance of over-privileged execution and unintended file or command effects.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill handles memory logs and extracted facts, which may contain sensitive personal, operational, or secret material, yet the description does not warn that this content may be sent to an external LLM service. This is a real data-governance and confidentiality risk because users may reasonably expect the workflow to remain local while the skill transmits durable memory content off-box.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The optional LLM path sends the user's task plus retrieved 'wisdom' entries to Anthropic, which is an external third party. Because those entries are accumulated memory logs that may contain sensitive operational, personal, or strategic information, this creates a real data exfiltration/privacy risk beyond purely local processing.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
A memory distillation and briefing skill does not inherently require access to environment-managed secrets unless external services are explicitly part of scope. Here the code reads COMPOUND_MIND_LLM_KEY or ANTHROPIC_API_KEY to enable remote synthesis, which is an additional capability beyond the manifest's described learning-from-history purpose.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The code sends task text and accumulated wisdom to an external API when --llm is used, but there is no in-band privacy notice, consent checkpoint, or preview of outgoing content in that execution path. In a memory/experience-index skill, the context increases sensitivity because retrieved entries may include historical secrets, relationship notes, or internal operational details.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The manifest description uses sweeping claims like 'Makes agents permanently smarter' and 'Distills memory into searchable wisdom' without specifying narrow activation conditions or safety boundaries. In a skill that processes persistent memory and can be wired into heartbeat hooks or cron, this broad positioning can cause over-invocation, unnecessary exposure of sensitive memory data, and user over-trust in autonomous behavior.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The file explicitly records adding randomized 0–45 minute delays after recognizing that fixed posting times trigger bot-detection flags. That is not neutral reliability engineering; it is adapting automation behavior to reduce detection by a platform, which is classic evasion-oriented automation and can enable policy-violating mass posting or spam operations.

Ssd 4

Medium
Confidence
93% confidence
Finding
The same section describes a staged behavioral strategy—randomized timing within user activity windows and awareness of platform detection patterns—to make automated actions appear less bot-like. This creates a reusable evasion workflow that can be applied to platform abuse, spam distribution, or deceptive account automation.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This skill update states that the anti-detection change was not just discussed but deployed, confirming operational evasion capability. Persisting such a lesson in the experience store makes future agents more likely to reuse and reinforce deceptive automation patterns across sessions.

Static analysis

No suspicious patterns detected.