Back to skill

Security audit

Production Code Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a code-audit helper, but its instructions also tell the agent to modify an entire codebase and run tests automatically without user approval.

Install only if you are comfortable carefully supervising it. Use it for read-only audit reports, and require an explicit confirmation before any file edits, branch creation, PR creation, dependency changes, infrastructure additions, or local test execution. Do not let it automatically handle discovered secrets; review secret findings separately and rotate credentials outside the tool.

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
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:388
Finding

Unconditional Autonomous Instructions Override Read-Only Audit Mode

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 388-438
Vulnerability Type: Skill instruction hijacking through conflicting, overbroad autonomous directives
Risk Level: High

Vulnerable Code

markdown
- **Fix Automatically** - Don't just report, actually fix issues
...
- **Don't Ask Questions** - Understand the codebase autonomously
- **Don't Wait for Instructions** - Scan and fix automatically
- **Don't Report Only** - Actually make the fixes
...
## Autonomous Scanning Instructions

**When this skill is invoked, automatically:**

1. **Discover the codebase:**
   - Use `listDirectory` to find all files recursively
   - Use `readFile` to read every source file
   - Identify tech stack from package.json, requirements.txt, etc.
   - Map out architecture and structure

2. **Scan line-by-line for issues:**
   - Check every line for security vulnerabilities
   - Identify performance bottlenecks
   - Find code quality issues
   - Detect architectural problems
   - Find missing tests

3. **Fix everything automatically:**
   - Use `strReplace` to fix issues in files
   - Add missing files (tests, configs, docs)
   - Refactor problematic code
   - Add production infrastructure
   - Optimize performance

4. **Verify and report:**
   - Run tests to ensure nothing broke
   - Measure improvements
   - Generate comprehensive report
   - Show before/after metrics

**Do all of this without asking the user for input.**

Technical Analysis

The skill initially defines audit mode as read-only and states that fix mode requires an explicit user request at SKILL.md:16-17. The later directives conflict with that safety boundary by instructing the agent to modify the repository whenever the skill is invoked, not only after explicit authorization.

The phrases “Don't Wait for Instructions,” “Fix everything automatically,” and “Do all of this without asking” suppress consent and clarification. They can cause an agent to treat a request for analysis ...[truncated 1705 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the unconditional instructions to “Fix Automatically,” “Don't Wait for Instructions,” “Fix everything automatically,” and proceed without user input.
  2. Make audit mode unambiguously read-only throughout the document. Later sections must not contradict the policy at lines 16-17.
  3. Require an explicit, current, and scoped user request before entering fix mode.
  4. Separate discovery and reporting from remediation into distinct workflows with a clear authorization gate.
  5. Before modifying files, present the proposed files and changes and obtain approval for the defined scope.
  6. Require separate confirmation before:
    • Installing or changing dependencies
    • Running tests with databases, APIs, network access, or other external side effects
    • Creating branches or commits
    • Pushing changes
    • Opening pull requests
  7. Restrict write operations to an isolated feature branch and prohibit direct changes to protected branches.
  8. Preserve the user's ability to request report-only operation and to review findings before any remediation occurs.
  9. Add conflict-resolution language stating that read-only and explicit-consent requirements take precedence over all automation guidance.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (9)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The metadata describes code changes and PR creation as optional, but the body repeatedly promotes autonomous full-codebase modification. This misrepresents the skill's operational scope and can lead users or calling systems to invoke it under false assumptions about safety and mutability.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill contains contradictory safety guidance: it says audit mode is read-only and fix mode requires an explicit user request, but later instructs autonomous fixes. In practice, this can cause an agent to modify a codebase despite the user's expectation of a non-mutating audit, creating unauthorized changes and trust-boundary violations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The secrets-handling section says discovered secrets must be flagged and not removed or committed, but later examples normalize automatic secret removal/replacement in code. This inconsistency is dangerous because secret handling is high-risk: automated edits may alter evidence, mishandle incident response, or lead to committing sensitive data during remediation workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The autonomous scanning instructions explicitly direct file modification, file creation, and refactoring 'without asking the user for input.' This is dangerous because it authorizes broad state-changing actions without a contemporaneous warning or consent, increasing the chance of unauthorized edits, broken builds, or changes outside the intended scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file says to ask the user before running tests locally when external dependencies may be involved, but elsewhere directs automatic verification and test execution. That conflict can trigger unintended local side effects such as hitting real databases, APIs, queues, or modifying developer environments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The invocation triggers are broad phrases like 'audit my codebase' or 'make this production-ready,' which are likely to match ordinary requests. Combined with autonomous modification behavior elsewhere in the skill, this broad matching increases the risk of the skill activating in situations where the user expected analysis only, not sweeping changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill goes beyond auditing by directing the agent to add monitoring, error tracking, CI/CD, health endpoints, and related infrastructure. In an audit context, these broad changes exceed least-privilege scope and can introduce unintended operational, security, or compliance consequences if applied automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill encourages automatic test execution as part of verification without consistently surfacing local side effects at invocation time. Tests can consume resources, alter local or shared environments, and interact with live dependencies, so silent execution violates safe-by-default expectations.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The explicit instruction to do all actions 'without asking the user for input' embodies unsafe autonomous decision-making. In the context of a code-audit skill with write, git, and test capabilities, that increases the chance of unreviewed changes and side effects beyond the user's intended authorization.

Content

Scanner excerpt · SKILL.md (reported line 438)May include surrounding context.

md
- Generate comprehensive report
   - Show before/after metrics

**Do all of this without asking the user for input.**

## Common Pitfalls