Back to skill

Security audit

Prompt Optimizer Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This prompt-optimization skill is purpose-aligned and locally scoped, with a low supply-chain concern from an unnecessary unpinned test dependency.

Before installing, consider removing pytest from runtime requirements or pinning it in a development-only dependency file. If you use the prompt library, remember that saved prompts are stored locally in plaintext JSON, so do not save secrets, credentials, proprietary prompts, or sensitive personal data unless that local retention is acceptable.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (1)

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Development Dependency Installed as a Runtime Requirement

Content
View full analysis
=7.0.0 ``` `SKILL.md:10-13`: ```yaml install: - id: python-deps kind: python requirements: "requirements.txt" ``` ### Technical Analysis The skill installation configuration automatically installs packages from `requirements.txt`. That file specifies `pytest` using only a minimum version and provides no upper version constraint, exact pin, package hash, or lockfile. `pytest` is used only by the test suite and is not imported by the runtime implementation in `scripts/prompt_optimizer.py`. Installing it as a skill runtime dependency therefore unnecessarily expands the dependency and build-time attack surface. Because the permitted version range is open-ended, installation may resolve to a future release that was not included in this audit. If a permitted package release or one of its transitive dependencies is compromised, malicious package installation or build logic could execute under the account installing the skill. This finding does not establish that the current `pytest` package is malicious; the risk arises from unconstrained future resolution and unnecessary runtime installation. ### Attack Path 1. A user or automation framework installs the skill. 2. The installation metadata in `SKILL.md` directs the package manager to process `requirements.txt`. 3. The package resolver selects any available `pytest` release satisfying `>=7.0.0`, including future unaudited releases and associated transitive dependencies. 4. If a selected release or dependency is compromised, malicious build or installation logic may execute during dependency installation. 5. That logic executes with the filesystem, network, and process privileges of the account performing the installation. This exploitation path is condition ...[truncated 662 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/prompt_optimizer.py (reported line 54)May include surrounding context.

python
if strategy in optimizers:
            return optimizers[strategy](prompt)
        return prompt
    
    def apply_template(self, template_name: str, **kwargs) -> str:
        """应用内置提示词模板"""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares executable Python dependencies and demonstrates library functionality that includes local prompt library persistence, but it does not declare any explicit tool scope or permissions for file read/write behavior. This creates a capability/visibility gap where the runtime may access or modify local files without clear least-privilege boundaries, making the skill harder to review and govern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes a persistent prompt library that stores prompts on local disk, which extends beyond the stated manifest scope of analyzing, optimizing, templating, and scoring prompts. In an agent environment, storing user prompts can capture sensitive data and create an undeclared data-retention surface, especially if users assume processing is transient.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

PromptLibrary accepts a configurable storage_path and then performs unrestricted local file reads and writes through _load and _persist. In a broader agent/runtime context, this can be abused to overwrite or read arbitrary files accessible to the process, which is more dangerous than the skill’s stated prompt-engineering purpose suggests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The save method writes user-provided prompts to disk without any disclosure, warning, or explicit consent flow. Because prompts often contain proprietary instructions, secrets, or personal data, silent persistence creates privacy and compliance risk even if the feature is functionally intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The README explicitly declares the documentation as Chinese/English bilingual, which imposes specific languages rather than offering a user-selectable language or locale preference. Under the policy rule, language constraints should be optional, user-chosen, or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is bilingual and the rest of the document content is primarily Chinese, which imposes a language choice on users without stating that the skill is region-specific or optional by locale. Under the policy criteria, forcing a specific language or locale without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The dependency is specified as pytest>=7.0.0, which allows installation of many future versions and does not ensure a reproducible or reviewed dependency set. While pytest is commonly a development/test dependency rather than production runtime code, unpinned versions can still introduce vulnerable or incompatible releases into the environment.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pytest>=7.0.0

Unverifiable Dependency: pytest has 2 known advisory(ies) (CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
84% confidence
Finding

The manifest references pytest without pinning to a specific version, so it is not possible to verify whether the resolved version includes known advisories. In this skill context, the risk is somewhat reduced because pytest is typically used for testing, but the ambiguity still permits installation of an affected version in CI, development, or packaging workflows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file contains user-visible natural-language strings and documentation in both Chinese and English, but it does not state whether the skill is intended for a specific locale or give users an explicit language choice. This can violate language/locale policy expectations when a skill implicitly forces or assumes a language without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

In teardown, the test unconditionally removes test_prompts.json if it exists. This is a file-deletion operation in a code file, and there is no confirmation prompt, visible disclosure, or explanatory comment in the file indicating that cleanup will delete a local file.

Content

No source excerpt is available for this finding.