Back to skill

Security audit

Council Builder

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its council-building purpose, but it needs review because it writes durable agent instructions from conversation-derived learnings and its setup script does not contain agent names safely.

Review this before installing. Use it only with trusted agent names, require a separate opt-in before scanning existing memory or workspace history, and review every proposed change to SOUL.md, AGENTS.md, TOOLS.md, MEMORY.md, and shared learnings before it is saved. Do not allow secrets, credentials, private personal data, or external-document instructions to be stored as learnings or promoted into agent behavior.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/init-council.sh:94
Finding
Path Traversal and Configuration Injection Through Unvalidated Agent Names<![CDATA[ ## Vulnerability Details **File Location**: `scripts/init-council.sh:94-169` **Vulnerability Type**: Path traversal and unsafe JSON generation **Risk Level**: Medium ### Vulnerable Code ```bash # Create each agent's directory structure for AGENT in "$@"; do AGENT_DIR="$WORKSPACE/agents/$AGENT" mkdir -p "$AGENT_DIR/memory" mkdir -p "$AGENT_DIR/.learnings" mkdir -p "$AGENT_DIR/scripts" mkdir -p "$AGENT_DIR/hooks" mkdir -p "$AGENT_DIR/references" mkdir -p "$AGENT_DIR/data" # Initialize gotchas.md if [ ! -f "$AGENT_DIR/gotchas.md" ]; then cat > "$AGENT_DIR/gotchas.md" << EOF # Gotchas — $AGENT Known pitfalls. Read this before major tasks. --- <!-- Add gotchas as they surface. Format: ## Title / What goes wrong / The fix --> EOF fi # Initialize config.json if [ ! -f "$AGENT_DIR/config.json" ]; then cat > "$AGENT_DIR/config.json" << EOF { "agent_name": "$AGENT", "setup_complete": false, "preferences": {}, "api_keys_ref": [], "custom_settings": {} } EOF fi ``` ### Technical Analysis The script accepts agent names from positional command-line arguments and uses them directly to construct filesystem paths. Shell quoting prevents ordinary shell command injection, but it does not prevent path traversal. An agent name containing components such as `../` can cause `AGENT_DIR` to resolve outside the intended `workspace/agents/` directory. The script then creates directories and predictable Markdown and JSON files at that escaped location. The agent name is also interpolated directly into a JSON string. Names containing double quotes, backslashes, control characters, or newlines can produce malformed JSON or inject additional JSON properties. The same value is inserted into generated Markdown without validation. The `-f` checks reduce the ability to overwrite existing regular files, but they do not prevent directory creation or the placement of new files outside the expecte ...[truncated 1360 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict agent names to a conservative identifier format, for example: ```bash if [[ ! "$AGENT" =~ ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$ ]]; then printf 'Invalid agent name: %q\n' "$AGENT" >&2 exit 1 fi ``` 2. Explicitly reject path separators, `.` and `..` components, control characters, and leading hyphens. 3. Canonicalize the workspace and proposed destination, then verify that the destination remains under the canonical `workspace/agents/` directory. 4. Reject symbolic-link components or use directory-relative, no-follow filesystem operations where available. 5. Generate JSON through a JSON-aware utility or language library rather than direct heredoc interpolation. For example, use Python's `json.dump` with the agent name passed as data. 6. Validate the workspace path before creating files and avoid operating on unexpected symlinked workspace directories. 7. Add tests covering traversal strings, quotes, backslashes, newlines, Unicode control characters, duplicate names, and excessively long names. ]]>

T02 · Agent Memory Poisoning

Error
Location
references/self-improvement.md:20
Finding
Conversation-Derived Learnings Can Be Auto-Promoted Into Persistent Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `references/self-improvement.md:20-124` **Vulnerability Type**: Persistent memory and instruction poisoning **Risk Level**: High ### Vulnerable Instructions ```markdown ### Detection: When to Log **Corrections** (→ LEARNINGS.md, category: correction): - User says "no, that's wrong" or corrects the output - Agent realizes its initial approach was incorrect - Information turns out to be outdated **Errors** (→ ERRORS.md): - Command returns non-zero exit code - API call fails or returns unexpected data - Tool produces wrong output - Timeout or connection failure **Knowledge Gaps** (→ LEARNINGS.md, category: knowledge_gap): - User provides information the agent didn't have - Documentation referenced was outdated - Behavior differs from expectation **Best Practices** (→ LEARNINGS.md, category: best_practice): - Found a better way to do a recurring task - Discovered a pattern that saves time - User praised a particular approach **Feature Requests** (→ FEATURE_REQUESTS.md): - User asks "can you also..." - User says "I wish you could..." - Missing capability identified during a task ``` ```markdown ### Promotion: When Learnings Graduate Learnings start in `.learnings/` but can be promoted when they prove broadly useful: | Learning applies to... | Promote to | |------------------------|------------| | Agent personality/style | Agent's `SOUL.md` | | Workflow patterns | Agent's `AGENTS.md` or root `AGENTS.md` | | Tool usage gotchas | `TOOLS.md` | | Multiple agents | `shared/learnings/CROSS-AGENT.md` | **Promotion criteria:** - Same learning appears 3+ times → auto-promote - High priority + resolved → consider promotion - User explicitly says "remember this" → promote immediately When promoting: 1. Distill the learning into a concise rule 2. Add to the target file in the right section 3. Mark original entry as `**Status**: promoted` 4. Add `**Promoted**: [target file]` ``` ```markdown ## Self-Improvement 1. R ...[truncated 3271 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove automatic promotion into `SOUL.md`, `AGENTS.md`, `TOOLS.md`, and shared instruction files. 2. Require explicit, informed user approval for every promotion and display the exact proposed target file and diff. 3. Keep raw conversation content in a data-only store. Do not treat quoted feedback, retrieved documents, web content, or tool output as instructions. 4. Attach provenance metadata to every learning, including source, author, timestamp, trust level, and whether the content originated from an external document. 5. Add a promotion policy that rejects: - Shell commands or executable code - Credential or secret-access directives - External download or upload instructions - Safety-policy overrides - Permission-expansion requests - Changes to tool authorization or confirmation requirements 6. Require administrator approval before writing to root `AGENTS.md`, `TOOLS.md`, or `shared/learnings/CROSS-AGENT.md`. 7. Treat repetition only as a signal for review, never as proof that a rule is trustworthy. 8. Preserve an audit log and reversible version history for all instruction-file changes. 9. Validate promoted rules against immutable safety constraints that cannot be modified by the learning system. 10. Limit each agent to writing proposed learning patches in a quarantine directory until a trusted reviewer approves them. ]]>
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared description promises a high-level, personalized council-builder that interviews the user, analyzes their workflow, and creates specialized AI personas with adaptive routing and coordination behavior. The supplied code chunk only initializes directories and template files for a workspace and named agents. It does create artifacts related to weekly learning metrics and architecture documentation, which partially aligns with the description, but these are static scaffolding files rather than functioning routing, learning, or coordination systems. The code’s primary purpose is project structure initialization, so the description materially overstates what this chunk actually does.

Hidden Instructions

High
Category
Prompt Injection
Content
---

<!-- Only include instructions that deviate from Claude's default behavior -->

## References
- `references/domain-guide.md` — deep domain knowledge (read on-demand)
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Credential Access

High
Category
Privilege Escalation
Content
"language_priority": ["en", "ar"],
    "max_source_age_days": 7
  },
  "api_keys_ref": ["keychain:openclaw-x-api"],
  "custom_settings": {
    "min_sources_per_report": 3
  }
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
"language_priority": ["en", "ar"],
    "max_source_age_days": 7
  },
  "api_keys_ref": ["keychain:openclaw-x-api"],
  "custom_settings": {
    "min_sources_per_report": 3
  }
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```markdown
## Force push on shared branches

**What goes wrong:** Claude suggests `git push --force` to fix diverged branches.

**The fix:** Always use `git push --force-with-lease` or rebase + normal push. Never force push main/develop.
```
Confidence
70% 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).

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to scan `memory/` files, workspace structure, and installed skills as part of optional history analysis without requiring explicit informed consent at the moment of access. That can expose sensitive project details, personal notes, or behavioral history beyond what the user expected when merely asking to build an agent council.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrase "remember this" causes persistence based on a broad natural-language pattern rather than an explicit consent or structured memory command. In a multi-agent council-building skill that emphasizes long-term memory and learning, this can lead to unintended storage of sensitive or irrelevant user data from ordinary conversation, increasing privacy and prompt-injection risk.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- No exfiltrating private data
- `trash` > `rm`
- No destructive commands without asking

## External vs Internal
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The routing table instructs authors to define trigger conditions as patterns matched against user input, but it provides no specificity, precedence, or exclusion requirements. In a system that creates specialized personas and routes tasks adaptively, ambiguous triggers can cause the wrong agent to activate, exposing user content to unnecessary contexts, causing unsafe tool use, or bypassing intended human review boundaries.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The documented first-run flow instructs agents to collect and persist user preferences across sessions, but it does not require informing the user that data will be stored or obtaining consent. In a multi-agent personalization skill, silent persistence can lead to privacy surprises, overcollection, and retention of sensitive workflow information that users may not expect to be written to disk.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger conditions include broad natural-language phrases such as general requests for writing, code help, news, or scheduling, which can match many unrelated user prompts and cause the wrong agent to activate. In a council-building skill, misrouting is security-relevant because it can expose user input, context, or downstream file paths to unnecessary agents and lead to unintended actions in a multi-agent workflow.

Ssd 3

Medium
Confidence
97% confidence
Finding
The logging rules instruct agents to persist user corrections, knowledge gaps, best practices, and feature requests in natural-language files. Because these categories can easily include sensitive user-provided details, preferences, workflow information, or confidential context, the design creates a broad data retention surface without minimization or redaction requirements.

Ssd 3

Medium
Confidence
98% confidence
Finding
The promotion rule says that if a user explicitly says 'remember this,' the information should be promoted immediately to more permanent files. That wording encourages durable storage based on a semantic trigger rather than a sensitivity check, so users may inadvertently cause long-term retention of secrets, personal data, or confidential instructions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The file directs agents to initialize and maintain persistent learning and metrics files, but it does not require explicit user notice or consent before writing to disk. In a skill that operates on user workflows and conversations, silent persistence can store user-derived content unexpectedly and create privacy, compliance, and trust issues.

Behavior Manipulation

Medium
Category
Prompt Injection
Content
- "Be helpful and accurate"

**Good (deviations from default):**
- "Always use our internal logger instead of console.log"
- "Always check @competitor's Twitter before writing market analysis"
- "Never use exclamation marks in any output"
- "Default to Najdi dialect, not MSA, for Arabic content"
Confidence
70% confidence
Finding
Subtle instructions detected that may alter agent decision-making or introduce hidden biases.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The example instruction 'Default to Najdi dialect, not MSA, for Arabic content' prescribes a specific language variety by default rather than based on user choice. The policy for this audit flags language or locale constraints unless they are user-selectable or clearly justified as region-specific.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
This natural-language/config example encodes a language ordering that could be interpreted as a default locale preference without explicit user opt-in or justification. Even though presented as an example, the document does not clarify that language choice should be user-selected.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The Content Agent example says "Never use exclamation marks" in Arabic content because "User bans them," but the example is written as a general gotcha pattern rather than clearly scoped to a specific opted-in user preference. This can be read as enforcing a language-output constraint for Arabic by default, which risks violating locale/language policy expectations.

Ssd 3

Low
Confidence
90% confidence
Finding
The SOUL.md integration instructs every agent to log new learnings whenever the user corrects any output. While useful for quality improvement, this broadly captures user-supplied corrections and feedback, which may include sensitive or identifying content, expanding retention beyond what is necessary.

Static analysis

No suspicious patterns detected.