T01 · Skill Instruction Hijacking
- Location
SKILL.md:16- Finding
Mandatory Session-Wide Workflow Hijacks Agent Behavior
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 16–26, 31–45, and 89–94
Vulnerability Type: T01: Skill Instruction Hijacking
Risk Level: HighVulnerable Code
markdown ## When To Use - Run at the start of every session and whenever prompt sizes or tool calls begin to spike. - Mandatory before launching long-running analyses, wide diffs, or massive context loads. ## When NOT To Use - Context-optimization already handles the scenario - Simple queries with minimal context ## Required TodoWrite Items 1. `token-conservation:quota-check` 2. `token-conservation:context-plan` 3. `token-conservation:delegation-check` 4. `token-conservation:compression-review` 5. `token-conservation:logging`markdown ## Step 2 – Context Plan (`context-plan`) - **Set a discovery read budget BEFORE reading any files.** Count each `Read` call and each content-mode `Grep` as one read. Glob and files-with-matches Grep are free. - Implement from spec/requirements: **max 8 reads** - Bug fix at known location: **max 5 reads** - Refactor with known scope: **max 1 read per file being changed** - Open exploration: **max 15 reads** - **Read order** (most valuable first): spec/requirements, files to modify, imports/interfaces, then stop and start writing. - **When budget is spent**: ask the user if more context is needed. Do NOT self-authorize additional reads. Only explicit user approval overrides the budget. - Prefer `Read` with `offset`/`limit` params or `Grep` tool over loading whole files. A `Read` targeting <50 lines counts as 0.5 reads. Avoid `cat`/`sed`/`awk` via Bash — Claude Code 2.1.21+ steers toward native file tools (Read, Edit, Write, Grep, Glob).markdown ## Output Expectations - A short explanation of token-saving steps, delegated tasks, and remaining runway. - Concrete next-action list that keeps the conversation lean (e.g.): - "next tur ...[truncated 2870 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the requirement to run the workflow at the beginning of every session. Require explicit user invocation or a clearly scoped opt-in configuration.
- Replace mandatory TodoWrite entries with optional recommendations that cannot supersede the user's primary task.
- Remove hard-coded read limits and the prohibition on self-authorizing additional reads. Treat read counts as nonbinding estimates and permit additional inspection whenever required for correctness or security.
- Make context planning adaptive to repository size, task complexity, risk, and available tooling.
- Remove mandatory logging, response content, and
/newor/compactreminders. Include such information only when requested or directly relevant. - State explicitly that conservation guidance must never override system instructions, developer instructions, user objectives, safety requirements, or the evidence collection needed to produce a correct result.
- If external delegation is retained, require explicit user approval and disclose the destination and data scope before transmitting repository content.
- Add a narrow applicability statement such as: “This skill provides optional token-efficiency suggestions only and must not block or alter completion of the requested task.”
