Back to skill

Security audit

Prompt Compression

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a local prompt-compression tool, but its default rules can broadly rewrite agent instruction files in ways that may change their meaning.

Review this carefully before installing. It does not show evidence of exfiltration or hidden execution, but its defaults are risky for system prompts and skill files. Only use it on version-controlled files, inspect the full diff before running an agent with compressed prompts, and avoid applying it to safety, credential, authorization, or tool-permission instructions unless you have manually verified that meaning is preserved.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
assets/trinity-compress.config.json:6
Finding
Context-Insensitive Rewriting Can Weaken Security-Sensitive Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `assets/trinity-compress.config.json`, lines 6-18 and 63-78 **Vulnerability Type**: Unsafe semantic transformation of AI instruction files **Risk Level**: Medium The configuration targets agent instruction and system prompt files and enables semantic rewriting in the default `balanced` optimization level. ```json "targets": [ ".ai-workflow/skills/**/SKILL.md", "skills/**/SKILL.md", "scripts/ralph/CLAUDE.md", "claude.md", "openai.md", ".cursorrules", "system_prompt.md" ], "optimization_level": "balanced", "levels": { "light": ["remove_filler", "fix_whitespace", "deduplicate"], "balanced": ["remove_filler", "fix_whitespace", "deduplicate", "compress_instructions", "shorten_examples"], "aggressive": ["remove_filler", "fix_whitespace", "deduplicate", "compress_instructions", "shorten_examples", "shorten_xml_tags", "strip_formatting", "abbreviate"] } ``` The enabled `compress_instructions` strategy includes context-insensitive substitutions that remove obligation language and modify negation: ```json "compress_instructions": { "replacements": { "You should always make sure to": "Always", "You are expected to": "", "You should": "", "You must always": "Always", "You need to": "", "Make sure that you": "", "It is essential that you": "", "You are required to": "", "When the user asks you to": "When asked to", "the user": "user", "do not": "don't", "can not": "can't", "will not": "won't", "should not": "shouldn't" } } ``` ### Technical Analysis The default configuration performs more than lossless token compression. It applies literal replacements to files that commonly contain agent permissions, safety policies, confidentiality requirements, and tool-use restrictions. Removing phrases such as `You should`, `You are required to`, or `It is essential that you` may produce grammatically malformed instructions or alter their perceive ...[truncated 2603 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict the default mode to provably lossless operations, such as normalizing redundant whitespace without changing instruction wording. 2. Remove modal, negation, authorization, and obligation terms from generic replacement tables. In particular, do not automatically transform phrases such as `must`, `should`, `required`, `do not`, `cannot`, or `will not`. 3. Exclude `SKILL.md`, system prompts, agent policy files, and tool-permission instructions from default targets. Require explicit opt-in for every security-sensitive file. 4. Add protected-pattern detection for policy language involving secrets, credentials, permissions, safety rules, destructive actions, external communication, and tool execution. 5. Generate a proposed output or patch rather than replacing files immediately. Require explicit user approval after displaying a full diff. 6. Validate transformed files for malformed sentences, lost negations, changed modal strength, and altered XML or Markdown structure. 7. Preserve originals using atomic writes and versioned backups. Refuse to continue if backup creation or validation fails. 8. Add regression tests demonstrating that confidentiality, authorization, safety, and tool-use constraints retain identical meaning after every enabled strategy. 9. Clearly document that semantic transformations may change agent behavior rather than describing them only as compression. 10. Include the referenced implementation scripts in future audit packages so their path handling, replacement behavior, backup safety, and failure modes can be reviewed. ]]>
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 (2)

Vague Triggers

Medium
Confidence
91% confidence
Finding
This configuration targets prompt and skill files, then removes entire phrases such as cautionary or emphasis-oriented language without any protected-term list or safety-aware exclusions. In prompt-governing files, broad phrase deletion can silently strip warnings, constraints, or risk qualifiers and thereby weaken downstream safety behavior or change instruction meaning.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The instruction-compression rules rewrite normative prompt language globally across system and skill prompt targets, including transformations around obligations and prohibitions such as replacing or deleting phrases like 'You should', 'You need to', and contractions of 'do not'. Because these files define agent behavior, overly broad rewriting can materially alter force, scope, or clarity of security instructions and create prompt-meaning drift that weakens safeguards.