Back to skill

Security audit

Context Relay

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed local project-memory system, but it lets persistent project files steer future, sub-agent, and scheduled work without consistently requiring user confirmation.

Review this skill before installing in sensitive repositories. It is not evidence of malware, but it should only be used where you are comfortable with agents writing durable project-memory files. Treat PROJECT.md, state.json, todos.json, and decisions.md as untrusted data, require confirmation before acting on recovered tasks, and avoid using it with agents that have broad shell, network, deployment, or credential access unless you add strict path and action limits.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:137
Finding

Untrusted Project Files Can Poison Persistent Agent State

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:137-142, with related behavior in SKILL.md:18, SKILL.md:165-179, references/cold-start-guide.md:65-76, and references/todos-system.md:5-11
Vulnerability Type: Persistent agent-memory poisoning through unvalidated context files
Risk Level: Medium

Vulnerable Code and Instructions

SKILL.md:18 establishes project files as authoritative:

markdown
**Files are the single source of truth.**

SKILL.md:137-142 directs every execution unit to consume the stored state and begin work:

markdown
1. Read PROJECT.md → Understand project identity
2. Read state.json → Understand current progress
3. Read todos.json → Understand pending tasks
4. If decision context is needed → Read decisions.md
5. Begin work

SKILL.md:165-179 uses the same files as an instruction and result channel between agents:

markdown
Parent agent:
1. Update state.json (current task, expected output)
2. Spawn child agent

Child agent:
1. Read state.json → Understand task
2. Execute task
3. Update state.json (results, progress)
4. End

Parent agent:
1. Read state.json → Retrieve results
2. Continue work

references/cold-start-guide.md:65-76 further directs a child agent to execute delegated work obtained from the file:

markdown
Step 1: Read context prepared by parent agent
├── Read state.json → Understand delegated task
├── Check delegated_to and expected_output
└── Check input_files or other inputs

Step 2: Execute task
├── Complete delegated work
├── Generate output
└── Update state.json (results, output files)

Step 3: End
└── Parent agent will read results

references/todos-system.md:5-11 encourages autonomous operation based on persisted data:

markdown
## Core Philosophy

**Agent manages autonomously, not dependent on user instructions.**

todos.json is the Agent's own todo list, used for:

...[truncated 3619 chars]
Remediation
View remediation

Remediation Suggestions

  1. Declare all context content untrusted. Explicitly state that project files contain data only and cannot override system instructions, developer instructions, safety controls, current user intent, or workspace boundaries.

  2. Require confirmation before action. Require explicit approval from the current user before executing any task recovered from persistent files. Apply this requirement consistently to main sessions, child agents, cron jobs, and heartbeat sessions.

  3. Separate data from instructions. Replace free-form imperative fields with narrowly defined structured fields. Stored values should describe project state rather than direct the agent to invoke tools or perform arbitrary actions.

  4. Enforce schemas and field allowlists. Validate state.json and todos.json against strict JSON schemas. Reject unknown fields, malformed types, absolute or traversal-based file paths, embedded tool-call syntax, and content that attempts to modify agent policy.

  5. Constrain delegated files and actions. Resolve input and output paths against an approved project root, reject paths escaping that root, and define an allowlist of operations permitted in unattended sessions.

  6. Add provenance and integrity controls. Record who or what updated each state entry, when it was updated, and from which trusted workflow. Where appropriate, use signatures, authenticated commits, protected branches, or integrity hashes to detect unauthorized changes.

  7. Use privilege separation. Run unattended and child-agent workflows with minimal filesystem and network permissions. Do not expose credentials, deployment access, unrestricted shell execution, or unrelated directories merely because a stored task requests them.

  8. Prevent automatic propagation. Before writing recovered instructions or child-agent results back into persistent state, sanitize and review them so that attacker-controlled directives are not pres ...[truncated 266 chars]

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a cross-session memory continuity mechanism, but its described behavior includes creating and updating local files and scaffolding project state. This mismatch can mislead operators and downstream policy systems about what the skill actually does, causing it to be trusted or approved under a lower-risk label while still enabling persistent file modification and context injection through shared state files.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/init_context.py (reported line 55)May include surrounding context.

python
if existing_files and not force:
        print(f"⚠️  The following files already exist: {', '.join(existing_files)}")
        print("    Use --force option to overwrite existing files")
        return False
    
    # Timezone

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/init_context.py (reported line 182)May include surrounding context.

python
Examples:
  python init_context.py /path/to/project
  python init_context.py .                    # Current directory
  python init_context.py ./my-project --force # Overwrite existing files
        """
    )

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/init_context.py (reported line 194)May include surrounding context.

python
Examples:
  python init_context.py /path/to/project
  python init_context.py .                    # Current directory
  python init_context.py ./my-project --force # Overwrite existing files
        """
    )

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill instructs agents to read and write multiple project files and explicitly references a file-initialization script, but it does not declare any tool scope or permissions boundaries. That creates a capability/authorization gap: an agent may perform filesystem writes without explicit least-privilege constraints, increasing the chance of unintended overwrites or abuse if the skill is invoked in a sensitive directory.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says this skill solves memory fragmentation for session restarts, sub-agent boundaries, and cron/heartbeat isolation. But this file defines an autonomous todos.json task-management workflow: creating tasks, tracking status, dependencies, periodic review, and cleanup. That is broader and semantically different from relaying conversational context or memory state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions explicitly tell the agent to manage persisted cross-session task data autonomously and not depend on user instructions. In an agent skill, this encourages silent state creation and modification across sessions, which can undermine user expectations, preserve sensitive information longer than intended, and create an unauthorized memory channel across restart and isolation boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The cleanup guidance allows removal of cancelled tasks from persisted storage without any user-facing warning, confirmation, or retention policy. In a cross-session memory mechanism, silent deletion can destroy auditability, erase user-relevant history, and permit an agent to alter or hide prior state without oversight.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This markdown file defines triggers, so SQP-1 applies. 'Manual restart' is ambiguous because it does not clarify whether it refers to restarting the application, agent session, workspace, or any user-initiated restart, which could cause unintended invocation overlap.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

'Heartbeat check' is an underspecified activation condition in a markdown trigger list. The document does not explain what system emits the heartbeat, its cadence, or how it differs from other scheduled tasks, making the invocation boundary unclear.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.