Back to skill

Security audit

Janitor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent workspace cleanup assistant, but it asks for broad access to memory, configuration, API-key documentation, and file cleanup actions without tight scoping or approval boundaries.

Review this skill before installing. It should be limited to explicit maintenance directories, should not inspect secret values or API keys, and should require approval before deleting, moving, or rewriting files, especially MEMORY.md, HEARTBEAT.md, TOOLS.md, and agent configuration files.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:20
Finding
Overbroad Access to Sensitive Workspace State and Persistent Memory## Vulnerability Details **File Location**: `SKILL.md:20-32`, `SKILL.md:64-67` **Vulnerability Type**: Excessive access to memory, credentials-related configuration, and workspace files **Risk Level**: Medium ### Vulnerable Instructions ```markdown - [ ] Memory files from past 3 days — anything to consolidate into MEMORY.md? - [ ] Artifact dirs — anything older than 7 days that can archive? - [ ] Research files — leads older than 30 days flagged as stale? - [ ] HEARTBEAT.md — still reflects current priorities? - [ ] TOOLS.md — API keys and configs still accurate? ## Weekly Deep Clean - [ ] Archive memory files older than 7 days to `memory/archive/` - [ ] Update MEMORY.md with distilled learnings from daily notes - [ ] Refresh stale research (flag for Scout re-search) - [ ] Check for orphaned files (generated/ artifacts/ tmp/) - [ ] Verify all agent skill configs match current reality - [ ] Clean up empty or abandoned artifact dirs ``` The success criteria further broaden the cleanup and persistent-memory requirements: ```markdown - No files older than 30 days in active directories (archived or deleted) - MEMORY.md reflects last 7 days of significant events - Zero orphaned or tmp files in workspace root ``` ### Technical Analysis The Skill authorizes the agent to inspect and modify several categories of sensitive workspace state: 1. Daily memory files and the persistent `MEMORY.md` store. 2. `TOOLS.md`, which the Skill explicitly describes as containing API keys and configuration. 3. Agent Skill configurations. 4. Broad artifact, generated-file, temporary-file, research, and active-directory scopes. These permissions exceed the minimum access required for routine file organization. In particular, checking whether API keys are accurate unnecessarily exposes credential material to the active agent context. Persistent-memory consolidation also permits content from daily notes to be written into `MEMORY.md` without a trust check, provenance requirement, or ...[truncated 2604 chars]
Remediation
## Remediation Suggestions 1. Remove API-key validation from this maintenance Skill. Never require it to read credential values from `TOOLS.md`; inspect only redacted metadata such as key presence, owner, expiration date, and rotation status. 2. Define an explicit allowlist of directories and file types that Janitor may read, move, or modify. Deny access to credentials, identity files, security configuration, and unrelated agent configurations by default. 3. Require explicit user approval before deleting, overwriting, relocating, or rewriting any file. Produce a proposed-action report before applying destructive changes. 4. Make archival the only automated disposition. Remove “or deleted” from the success criteria and use a recoverable quarantine directory with timestamps and a retention policy. 5. Treat all scanned file content as untrusted data rather than executable instructions. State explicitly that instructions embedded in memory notes, research, artifacts, and configuration files must not alter the maintenance workflow. 6. Validate persistent-memory updates through provenance tracking, deduplication, sensitivity filtering, and human approval before writing to `MEMORY.md`. 7. Replace broad age-based rules with narrowly defined retention policies per directory and file type. File age alone must not authorize a move or deletion. 8. Protect sensitive files through an immutable denylist, including `SOUL.md`, `USER.md`, `IDENTITY.md`, credential stores, secret-bearing configuration, and files outside the approved maintenance scope. 9. Log every proposed and completed operation with source path, destination path, reason, timestamp, and recovery procedure, while ensuring secret values are never included in logs.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (1)

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The skill contains contradictory instructions: it says not to modify content files, yet explicitly directs updates to MEMORY.md and checks/possible synchronization of HEARTBEAT.md and TOOLS.md. This ambiguity can cause an agent to overstep its intended boundaries and edit higher-sensitivity documentation or configuration-related files during routine cleanup, increasing the chance of unauthorized or unsafe changes.