Back to skill

Security audit

04 Agent Stack Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent automation-audit helper, but it asks the agent to inspect sensitive local operational context without clear scope limits or redaction rules.

Review this carefully before installing. It is not trying to exfiltrate data or install code, but a normal run may inspect local scripts, scheduled tasks, API configuration, installed skills, and memory/context files. Use it only with explicit directory and data-category boundaries, and avoid allowing full secret values or private project context to be copied into generated reports.

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:33
Finding
Overbroad Access to Sensitive Operational Context<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 33-74 **Vulnerability Type**: Excessive access to process information, API configuration, installed skills, and persistent project context **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ### 1. Crons — Are they alive and earning their keep? For each launchd agent / cron job / scheduled task: - Is the process actually running? (check PID, plist/cron status) - When did it last fire successfully? - What does it produce? Is that output being consumed by anything? - Is there a newer/better approach that renders this obsolete? **Questions to answer:** - "This cron runs every hour. Has its output file been read in the last 30 days?" - "This watchdog monitors a bot that was killed 2 months ago — is the watchdog still running?" ### 2. Scripts — Dead code? Scan your automation directories for Python/shell scripts: - Last modified date vs last executed date - Scripts referencing killed bots or cancelled APIs - Scripts built for old projects that are now closed - Duplicate scripts doing the same job ### 3. API Keys — Are you paying for something unused? Cross-reference your API inventory against actual script usage: - Any API key configured but never called in the last 30 days? - Any paid subscription that maps to zero active script usage? - Any free-tier key that's been maxed out — is an upgrade worthwhile? Common culprits: data providers, news APIs, notification services, AI APIs at old models. ### 4. Skills — Superseded or never used? Review your installed skills: - Any skill built but never actually invoked? - Any skill replaced by a newer, better version? - Any skill with overlapping functionality that could be merged? ### 5. Memory Files — Stale project context? Review project memory and context files: - Any project memory not updated in 30+ days? - Projects marked "on hold" for 60+ days with no activity? - Contradictions between your main context file and individual p ...[truncated 3061 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit user consent before inspecting each sensitive category, especially API configuration, installed skills, and persistent memory. 2. Restrict scans to user-approved directories, scheduler entries, projects, and configuration files through an explicit allowlist. 3. Inspect API key names, provider identifiers, and usage metadata only. Never read, display, log, or store complete credential values. 4. Add mandatory redaction for tokens, passwords, authorization headers, account identifiers, personal information, and sensitive filesystem paths. 5. Exclude memory and context files by default. Make their inspection a separate opt-in operation with clearly stated scope. 6. Define the precise process and scheduler metadata required for health checks instead of permitting unrestricted system enumeration. 7. Ensure generated reports use restrictive filesystem permissions and contain only the minimum information necessary to support cleanup decisions. 8. Add a pre-write review step that detects likely secrets and removes them before creating `state/stack_audit_YYYY-MM-DD.md`. 9. Separate cron-health, API-cost, and project-context audits into independently authorized operations so that invoking one function does not grant access to every data category. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (2)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The manual trigger says to invoke the skill whenever 'the stack feels bloated' or reliability 'has degraded,' which are subjective conditions without clear boundaries. Combined with broad trigger phrases like 'what's still running?', this can cause unintended activation outside a narrowly defined audit context.

Session Persistence

Medium
Category
Rogue Agent
Content
### 1. Crons — Are they alive and earning their keep?

For each launchd agent / cron job / scheduled task:
- Is the process actually running? (check PID, plist/cron status)
- When did it last fire successfully?
- What does it produce? Is that output being consumed by anything?
- Is there a newer/better approach that renders this obsolete?
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Static analysis

No suspicious patterns detected.