Back to skill

Security audit

ai-code-optimizer

Security checks for vulnerabilities and agentic risk

Overview

This code-optimization skill is not malicious, but it broadly tells agents to automatically modify code without clear confirmation or scope limits.

Install only if you are comfortable with an agent using broad optimization requests to change source files. Ask for suggestion-only review or a diff before applying changes, especially for authentication, security, infrastructure, or production code.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Confidence
89% confidence
Finding
The invocation phrase 'Optimize the code in src/app.js' is broad and maps to a common natural-language request without clear activation boundaries or safety constraints. This increases the chance of accidental triggering in ordinary conversations, causing the skill to analyze or modify files when the user did not intend to invoke this specific capability.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill states it will 'apply improvements' automatically, but it does not warn users that their files may be modified or require explicit confirmation before changes are written. In an agent setting, this can lead to unintended file edits, corruption of working code, or silent modification of sensitive source files when a user only expected analysis or suggestions.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The example trigger phrases are generic requests like 'Optimize my Python script for speed' and 'Refactor this code for better readability', which are common prompts a user may say in many contexts. Without explicit boundaries, the skill may activate unintentionally and perform code transformations or file operations beyond what the user expected.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The package description is overly broad and promises automatic code optimization without defining scope, limits, approval requirements, or safety constraints. In an agent skill that may modify code, vague triggering and authority boundaries can lead to unintended refactoring, unsafe changes, or abuse through prompt interpretation that exceeds the user's intent.

Static analysis

No suspicious patterns detected.