Back to skill

Security audit

Memory Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a memory cleanup tool, but its apply mode can rewrite persistent agent instruction and tool files with limited safeguards.

Review carefully before installing. Use dry-run first, inspect the proposed changes, and only run --apply on trusted workspaces after backing up files. Avoid using it on repositories that may contain symlinks or untrusted AGENTS.md/TOOLS.md content, because apply mode can rewrite files that influence future agent 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
optimize.py:263
Finding

Optimization Operations Can Rewrite Agent Instruction and Tool Configuration Files

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
optimize.py:48
Finding

Workspace-Controlled Symbolic Links Can Redirect Optimizer Writes Outside the Workspace

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly advertises analyzing and auto-fixing memory files, including deduplication and reorganization, but does not clearly warn that these operations can alter or remove user data. In a memory-management context, this is genuinely risky because fuzzy matching and automated restructuring can produce incorrect merges, delete important context, or corrupt long-lived agent state if applied without strong safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Auto-Fix feature is presented as a convenience capability without prominent disclosure of destructive or irreversible outcomes, even though deduplication, re-indexing, and reorganization inherently rewrite memory artifacts. Because these files may contain critical agent context, a mistaken auto-fix can silently degrade behavior, erase provenance, or lose information that is difficult to reconstruct.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's code is purely read/analyze/report oriented: it scans markdown files, computes issues, and optionally writes a report file. The message at L571 tells the user to run python3 optimize.py --apply to fix issues, which implies a companion fixer capability not present in this file and creates an intent/documentation mismatch within the user-facing behavior of this tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file performs direct file modifications through _write_file when --apply is used, including deduplication, reindexing, stale-entry archiving, and structure fixes. Although dry-run mode is the default and status is printed, there is no explicit confirmation step before destructive overwrites, and backups are not enabled by default.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest advertises broad capabilities to analyze agent memory files, detect issues, generate reports, and auto-fix problems without defining scope, limits, or when modification is permitted. In an agent ecosystem, vague capability claims can cause overbroad invocation and unexpected access to sensitive memory data or unintended modification behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description states the skill can 'auto-fix common issues' but does not warn that it may modify user data or require confirmation. This is dangerous because memory files may contain important agent state, and silent or poorly scoped auto-fixes can corrupt, delete, or rewrite information in ways that are hard to detect or recover from.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code performs a file write using the user-provided --output path, which can overwrite an existing file, but the only disclosure appears after the write completes. There is no pre-write confirmation, warning comment/docstring near the operation, or other advance notice in this file that a filesystem modification will occur.

Content

No source excerpt is available for this finding.