Back to skill

Security audit

Agent Workspace Hygiene

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed workspace cleanup helper that inventories generated files and requires user confirmation before archiving or deletion.

Install only if you want an agent to help inventory and clean generated workspace artifacts. Review the proposed paths before approving archive or deletion actions, and treat reports as potentially sensitive because they can include local project paths and filenames.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · evals/evals.json (reported line 19)May include surrounding context.

json
"should_trigger": true
  },
  {
    "query": "Clean up agent-generated logs and screenshots. Do not touch databases or .env files.",
    "should_trigger": true
  },
  {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · evals/trigger_evals.json (reported line 11)May include surrounding context.

json
"should_trigger": true
  },
  {
    "query": "Clean up agent-generated logs and screenshots. Do not touch databases or .env files.",
    "should_trigger": true
  },
  {

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/workspace_inventory.py (reported line 82)May include surrounding context.

python
PROTECTED_NAMES = {
    ".git",
    ".env",
    ".env.local",
    ".env.production",
    ".env.development",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/workspace_inventory.py (reported line 83)May include surrounding context.

python
PROTECTED_NAMES = {
    ".git",
    ".env",
    ".env.local",
    ".env.production",
    ".env.development",
    "id_rsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/workspace_inventory.py (reported line 84)May include surrounding context.

python
".git",
    ".env",
    ".env.local",
    ".env.production",
    ".env.development",
    "id_rsa",
    "id_ed25519",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/workspace_inventory.py (reported line 85)May include surrounding context.

python
".env",
    ".env.local",
    ".env.production",
    ".env.development",
    "id_rsa",
    "id_ed25519",
}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill explicitly instructs the agent to run shell commands and read workspace contents, but it does not declare any tool scope such as permissions or allowed-tools. That creates an authorization gap where a host system may permit broader command execution or file access than the skill actually needs, increasing the chance of unintended workspace inspection or destructive cleanup actions if the skill is invoked.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Several positive trigger examples use broad, natural phrases such as 'Help me identify temporary files' and 'Before handoff, tidy the workspace' that can overlap with ordinary repository-assistance requests. In a trigger-eval file, this can train or validate the skill to activate too eagerly, causing unintended cleanup-oriented behavior in contexts where the user did not clearly request workspace artifact inventory or archiving.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/workspace_inventory.py (reported line 122)May include surrounding context.

python
def run_git(root: Path, args: list[str]) -> str | None:
    try:
        result = subprocess.run(
            ["git", "-C", str(root), *args],
            check=False,
            stdout=subprocess.PIPE,

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script emits detailed workspace paths, filenames, modification times, git status, and size information in JSON/report output. In an agent skill context, that metadata can expose sensitive local project structure, ignored files, secret-adjacent filenames, or private artifacts to downstream consumers or logs even though file contents are not read.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.