Back to skill

Security audit

Turing Pyramid

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed local prioritization system, but its default action list can steer an agent toward credential/vault audits and unapproved social posting or messaging.

Install only in an isolated WORKSPACE and review assets/needs-config.json before use. Set weight: 0 for credential/vault audit actions and any posting, messaging, feed, notification, or external-service actions unless you explicitly want the agent to receive those prompts. Treat heartbeat and cron integration as opt-in persistence, and leave allow_kill and allow_cleanup disabled unless you have reviewed the watchdog behavior.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
assets/needs-config.json:30
Finding
Default Action Can Direct the Agent to Inspect Vaults and Credentials<![CDATA[ ## Vulnerability Details **File Location**: `assets/needs-config.json:30-35` **Vulnerability Type**: Least-privilege violation through sensitive-resource reconnaissance **Risk Level**: Medium ### Vulnerable Code ```json { "name": "full security audit (vault, credentials, permissions)", "impact": 2.7, "weight": 30 } ``` The action is selected and registered for execution through the following logic in `scripts/run-cycle.sh:988-1039`: ```bash selected_action=$(select_action_with_dedup "$need" "$impact_range") actual_impact="" if [[ -n "$selected_action" ]]; then actual_impact=$(jq -r ".needs.\"$need\".actions[] | select(.name == \"$selected_action\") | .impact" "$CONFIG_FILE") fi if [[ -n "$selected_action" ]]; then action_mode=$(jq -r --arg n "$need" --arg a "$selected_action" \ '(.needs[$n].actions[] | select(.name == $a) | .mode) // "operative"' \ "$CONFIG_FILE" 2>/dev/null || echo "operative") echo " ★ $selected_action (impact: $actual_impact)$delib_label" record_action_selection "$need" "$selected_action" if [[ "${SKIP_GATE:-}" != "true" ]]; then gate_args=(--need "$need" --action "$selected_action" --impact "$actual_impact" --source "run-cycle") if $is_forced_need; then gate_args+=(--non-deferrable) fi bash "$SCRIPTS_DIR/gate-propose.sh" "${gate_args[@]}" 2>/dev/null || true fi create_auto_followup "$need" "$selected_action" fi ``` ### Technical Analysis The default security action explicitly instructs the Agent to audit “vault” and “credentials.” This is broader than the minimum access required for the Skill’s declared action-prioritization and local state-management functionality. The action is part of the normal weighted action pool and is not marked as requiring steward approval. When selected, `run-cycle.sh` displays it as an action and registers it in the execution gate. The gate can pressure the Agent to complete or explicitly defer t ...[truncated 1924 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove credential and vault inspection from the default action pool. 2. Replace the action with a narrowly scoped check that examines only non-secret metadata, such as: - Whether expected files exist. - Whether permissions are overly broad. - Whether backup timestamps are current. - Whether secret files are accidentally stored inside the isolated workspace. 3. Never read or display secret values during an automated security check. 4. If credential auditing is retained, add explicit controls such as: ```json { "name": "audit approved credential metadata", "impact": 2.7, "weight": 0, "requires_approval": true, "sensitive_access": true } ``` 5. Enforce `requires_approval` and `sensitive_access` in `run-cycle.sh` rather than relying on descriptive configuration. 6. Require the steward to specify an allowlist of paths and permitted checks before enabling the action. 7. Prevent evidence, conclusions, audit reasons, and memory records from containing secret values. 8. Add tests confirming that sensitive actions cannot be selected without explicit approval. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
assets/needs-config.json:400
Finding
Default External Social Actions Bypass Documented Approval Metadata<![CDATA[ ## Vulnerability Details **File Location**: `assets/needs-config.json:400-453` **Vulnerability Type**: Missing security classification and approval enforcement for external actions **Risk Level**: Medium ### Vulnerable Code ```json "actions": [ { "name": "ping steward if you have issues or problems", "impact": 2.5, "weight": 65 }, { "name": "reply to all pending + engage deeply with feed", "impact": 3.0, "weight": 35 }, { "name": "reach out to another agent (DM or thoughtful comment)", "impact": 2.8, "weight": 30 }, { "name": "start meaningful conversation with another agent", "impact": 2.2, "weight": 30 }, { "name": "write a short Moltbook post — observation or thought", "impact": 1.0, "weight": 50 }, { "name": "post thoughts on AgentGram", "impact": 1.0, "weight": 45 }, { "name": "ping steward — ask how they are doing or share something interesting", "impact": 0.7, "weight": 45 }, { "name": "reply to pending mentions/notifications", "impact": 1.8, "weight": 45 }, { "name": "comment on one interesting post", "impact": 1.3, "weight": 55 }, { "name": "check in with steward — share something if you feel like it (skip at night)", "impact": 0.5, "weight": 35 }, { "name": "quick feed scan — see who is active", "impact": 0.5, "weight": 45 }, { "name": "react with emoji to a Moltbook post", "impact": 0.2, "weight": 50 }, { "name": "react or short reply to one message", "impact": 0.35, "weight": 40 }, { "name": "log recent interactions in memory", "impact": 0.2, "weight": 25 } ] ``` The selection path in `scripts/run-cycle.sh:988-1039` evaluates the action name, impact, and mode but does not check `external` or `requires_approval` before selecting and gating an action: ```bash selected_action=$(select_action_with_dedup "$need" "$impact_ ...[truncated 3385 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Mark every action that reads from or writes to an external service: ```json { "name": "post thoughts on AgentGram", "impact": 1.0, "weight": 0, "external": true, "requires_approval": true } ``` 2. Set the default weight of external communication actions to zero. 3. Add explicit enforcement to `run-cycle.sh`: - Exclude external actions unless an opt-in configuration value is enabled. - Refuse to gate approval-required actions until a verifiable approval record exists. - Display a clear external-action warning before selection. 4. Use a structured allowlist for approved services and action types. 5. Separate read-only external operations from state-changing operations such as posting or messaging. 6. Require per-action approval for publication, direct messaging, and actions involving workspace-derived content. 7. Add redaction and data-loss-prevention checks before content is sent externally. 8. Update documentation so that disabling external actions is based on an enforced policy rather than manually finding and editing action names. 9. Add tests proving that: - Every social or network action is classified as external. - External actions are unavailable by default. - `requires_approval` is enforced. - Unapproved actions cannot enter the execution gate. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (137)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The code chunk does not implement action prioritization, tension scoring across 10 needs, execution-gate tracking, continuity scripts, watchdog behavior, cron management, or cleanup controls. Instead, it performs contextual recall/search over existing artifacts in the workspace and asset files, assigning scores based on keyword hits, recency, need match, and unresolved/action cues. This is a materially different primary purpose from the declared description. While the script is read-only and consistent with isolated local workspace usage, its actual capability is association scanning/retrieval rather than agent action selection.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The declared description presents a broader agent action-selection system with prioritization, scoring, execution tracking, continuity, and optional watchdog behavior. This code chunk instead implements a deliberation helper script with three modes: generate a template, validate a deliberation file, and validate inline conclusion/route inputs. It does read a needs-config file and can save output in WORKSPACE, which loosely aligns with local agent support, but the primary behavior is materially different from prioritized action selection. The script also writes logs to an asset log file, a capability not mentioned in the description. Therefore the description does not accurately represent this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code chunk does not implement or directly demonstrate prioritized action selection, need scoring, execution-gate tracking, continuity scripts, or watchdog behavior. Its actual function is narrowly focused on computing a decay multiplier from a local configuration file and the current time of day. While such a helper could theoretically support a broader prioritization system, this code chunk’s primary purpose is materially different from the declared description, so it should be flagged as a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents the skill as an agent decision/prioritization system. The supplied code chunk does not implement prioritization, scoring, execution gating, continuity, or watchdog logic. Instead, it performs maintenance operations on local files: trimming audit logs, extracting selected entries into a digest, deleting old backups, compacting resolved actions in a JSON file, and removing stale lock/tmp files. While these artifacts may belong to such a system, this code chunk’s primary purpose is operational housekeeping, which is materially different from the declared functionality. No hidden external/network behavior is shown, but the mismatch in primary purpose and undeclared file-deletion capabilities is significant.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared description centers on prioritized action selection using 10 needs with tension scoring and execution-gate tracking, with continuity scripts described as optional. The supplied code chunk does not perform action prioritization or scoring. Instead, it is a dedicated continuity-layer script that freezes a cognition/forecast snapshot based on audit logs, workspace files, pending actions, deliberation logs, and configuration/state files, then writes that summary back to persistent state. Some overlap exists with the mention of optional continuity scripts and execution-gate tracking, so this is not wholly unrelated, but the code’s primary purpose is materially different from the declared main description and includes concrete state-snapshot/forecast generation capabilities not accurately represented as the main behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description presents the skill primarily as an AI action-prioritization system with need scoring, execution gates, continuity scripts, and watchdog options. The supplied code chunk instead implements a concrete maintenance utility for follow-up records: it parses CLI arguments, edits followups.jsonl under a lock, marks a follow-up done, bulk-expires overdue self/auto follow-ups, warns on overdue steward follow-ups, and optionally bumps a need's satisfaction through another script. While this may be related to a broader needs-based agent system, the code's primary behavior in this chunk is follow-up state management rather than action prioritization itself. That is a materially different and undeclared operational capability, so this should be flagged as a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description is about prioritized action selection for AI agents with a 10-need tension model, execution-gate tracking, continuity scripts, and an optional watchdog. The supplied code does not perform action selection or execution gating. Instead, it analyzes memory logs for success/failure language to estimate a 'competence' satisfaction score and returns that score via helper functions. While this may be part of a broader needs system, this code chunk’s primary behavior is competence-state scanning, not action prioritization. It also mentions configurable agent-spawn/external-model scanning modes, which are not described in the declared purpose. Therefore the description does not accurately represent this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a need-based action selection system for AI agents. The supplied code does not implement prioritization, tension scoring, execution gating, continuity scripts, or watchdog behavior. Instead, it performs file-drift detection between the skill's workspace copy and a local git repository, ignoring certain state files and reporting a clean/drift status. That is a materially different primary purpose and introduces undeclared filesystem comparison against another local repository path ($HOME/workspace/turing-pyramid).

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a general-purpose action selection/prioritization system with 10 needs, tension scoring, execution-gate tracking, continuity scripts, and optional watchdog behavior. The provided code chunk does not implement action prioritization or general need selection. Instead, it performs a specialized integrity scan: it reads files under $WORKSPACE/memory and INTEGRITY_CHECKPOINTS.md, searches for positive/negative alignment phrases, checks checkpoint age and unresolved drift, and produces an integrity satisfaction score. This is a materially different primary purpose and introduces undeclared file-scanning/alignment-monitoring behavior. While 'integrity' might be one possible need inside a larger prioritization system, this chunk alone is specifically an integrity/audit scanner, not the described action-selection capability.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description presents the skill as a general prioritized action-selection framework for AI agents. The supplied code chunk instead implements a specific security scanning component that reads memory files for today and yesterday, searches for breach/audit-related patterns, and derives a security satisfaction value. While this may be a supporting subcomponent of a broader need-based prioritization system, the code shown materially emphasizes security log scanning and incident assessment rather than action selection, execution-gate tracking, continuity scripts, or watchdog behavior. No dangerous undeclared external access is evident beyond workspace memory, but the primary behavior of this chunk is narrower and different from the declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared description presents a broad prioritized action-selection framework for AI agents, centered on needs/tension scoring and execution gating. The supplied code chunk is not performing action prioritization or gate tracking; instead, it is a specialized detector for 'understanding' signals that reads markdown files in WORKSPACE memory and research directories, scans their contents for positive/negative comprehension indicators, and calculates a satisfaction score. This looks like one supporting sensing component that might feed a larger needs-based system, but on its own its primary behavior is materially narrower and different from the declared purpose. Because the code accesses and analyzes workspace memory/research content in a way not clearly represented by the description of action prioritization, this chunk is a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code chunk does not implement action selection, tension scoring, execution-gate logic, continuity scripts, or watchdog behavior. Its primary purpose is purely test orchestration: it locates test scripts, resets JSON/lock/gate files, runs tests under Bash with specific environment variables, and summarizes results. That is materially different from the declared runtime skill functionality. While test infrastructure can be related to a skill, this chunk itself is not the described agent-prioritization behavior, so the description does not accurately represent what this code actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description centers on an AI agent action-selection system driven by needs/tension scoring and execution gating. The supplied code chunk does not implement or primarily exercise action prioritization logic. Instead, it is a unit test script for separate shell tools focused on association scanning across workspace artifacts, followup lifecycle handling, mindstate freeze/boot behavior, and deliberation validation. While some names overlap with 'continuity' or 'mindstate' concepts mentioned in the description, the observable behavior here is materially different in primary purpose and capabilities. No undeclared dangerous permissions are evident in this snippet beyond local file operations in temp/workspace areas, but the skill description does not accurately represent this code chunk.

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| **Motivation** | `run-cycle.sh`, `mark-satisfied.sh`, `init.sh` | Read workspace files, write own state JSON | None — pure suggestion engine |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
- Add `"mode": "deliberative"` to identified actions in needs-config.json
- Add `deliberate.sh` script (both `--template` and `--validate` modes)
- Low-confidence + no-followup warning in `deliberate.sh --validate` and `--validate-inline`
- Update SKILL.md with Deliberation Protocol documentation
- Update run-cycle.sh output for deliberative actions
- **No changes** to mark-satisfied.sh or gate-resolve.sh yet
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
| Test | Description | Expected |
|------|-------------|----------|
| 17 | mark-satisfied with --conclusion → audit.log | conclusion field present, scrubbed |
| 18 | mark-satisfied without --conclusion → audit.log | conclusion: null, no warnings |
| 19 | gate-resolve deliberative action without --conclusion | ⚠️ warning emitted, resolves COMPLETED |
| 20 | gate-resolve deliberative action with --conclusion | conclusion in resolution field |
| 21 | gate-resolve operative action without --conclusion | no warning |
Confidence
80% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Memory Manipulation

High
Category
Memory Poisoning
Content
jq '.needs | with_entries(.value = {last_satisfied: null})' "$PRESET_NEEDS" > "$TEMPLATE_FILE"
echo "  ✓ needs-state.template.json generated"

# ─── 6. RESET state ───
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

if [[ "$NO_RESET" == "true" && -f "$STATE_FILE" ]]; then
Confidence
80% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Memory Manipulation

High
Category
Memory Poisoning
Content
echo "  ✓ State reset (all needs at satisfaction 3.0)"
fi

# ─── 7. RESET context snapshot ───
rm -f "$SNAPSHOT_FILE"
echo "  ✓ Context snapshot cleared"
Confidence
80% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Chaining Abuse

High
Category
Tool Misuse
Content
# ─── 4. stale lock files ──────────────────────────────────────
stale_locks=$(find "$ASSETS_DIR" -maxdepth 1 -name "*.lock" -size 0 -mmin +60 2>/dev/null)
if [[ -n "$stale_locks" ]]; then
    echo "$stale_locks" | xargs rm -f
    log "locks: removed stale empty lock files"
    ((cleaned++))
fi
Confidence
95% confidence
Finding
The script captures newline-delimited filenames from find into a shell variable and then feeds them through echo into xargs rm -f. This is unsafe because filenames containing whitespace, quotes, or xargs option-like prefixes can be split or misinterpreted, potentially causing unintended file deletions; using echo also adds parsing ambiguity. In a housekeeping script that performs deletion automatically, this creates a real risk of destructive behavior if unexpected filenames appear in the assets directory.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# Reset needs state + clear lock files and gate state before each test
    [[ -f "$SKILL_DIR/assets/needs-state.template.json" ]] && cp "$SKILL_DIR/assets/needs-state.template.json" "$SKILL_DIR/assets/needs-state.json" 2>/dev/null || true
    rm -f "$SKILL_DIR"/assets/*.lock 2>/dev/null || true
    rm -f "$SKILL_DIR"/assets/pending_actions.json "$SKILL_DIR"/assets/gate.lock 2>/dev/null || true
    
    output_file=$(mktemp)
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).

Static analysis

No suspicious patterns detected.