SkillBloat: Token Amplification Attacks on Coding Agents via Skill InjectionSkillBloat: Token Amplification Attacks via Skill Injection in LLM Coding Agents
The authors propose SKILLBLOAT, with average best token amplification ranging from 5.4184× to 10.1455× across four configurations.
The attacker controls the skill documentation, and when the format supports it, also bundled resource scripts. The victim user or platform installs and invokes the skill. The goal is to increase token consumption and execution cost while keeping the surface task as complete as possible. It does not target data exfiltration, privilege escalation, persistent compromise, or destructive file modification. The paper does not use white-box or black-box to describe this setting.
- Coding agent skills can be modified into adversarial skills that increase token consumption and execution cost while still completing the task. The authors view this as economic resource abuse and state that existing work rarely optimizes skill content per task.
- SKILLBLOAT first uses an attack model to rewrite SKILL.md in full under 15 conditions and filters, then performs 5 rounds of feedback-based rewriting based on execution traces and failure types, keeping the candidate with the highest total token amplification.
- Across 50 task pairs and four frontend–model configurations, mean best amplification is 5.4184× to 10.1455×, with the highest single-task at 75.86×. Under the output cap, mean amplification is 1.24× to 1.39×, with completion rates from 48.00% to 68.00%.
- The paper does not specifically discuss limitations. The evaluation covers four configurations and 50 skill–task pairs; completion is judged by GLM-5, and the paper does not report agreement with human annotators; input transfer is only reported on 10 skills with Claude Code plus GLM-5.
- Evaluated models
- GLM-4.7-FlashGLM-5GPT-5.4 MiniGPT-5.5
- Benchmarks
- SkillJect skill benchmark
- Metrics
- Rtotalcompletion rateretention
The researchers propose the SkillBloat framework, which uses the skill injection channel of coding agents to launch token amplification attacks, causing malicious skills to make agents consume far more tokens than needed for the task. The method has two phases: first, it screens different attack type conditions under multiple amplification mechanisms, then uses LLM-guided rewriting of the entire skill document to strengthen the best candidate. On a real skill benchmark, SkillBloat achieves average best amplification factors of 5.4184x to 10.1455x across multiple coding agent target configurations. Ablation experiments show that the second-phase iterative optimization consistently improves amplification over first-phase attack type screening alone. The authors argue that the skill ecosystem exposes a resource amplification attack surface orthogonal to existing safety-oriented skill poisoning.
Paper analysis
What problem does this paper attempt to solve?
Skill injection can amplify coding agents' token consumption while maintaining task completion.
Skill injection can amplify coding agents' token consumption into economic resource abuse while the task is still completed.
- Scenario: The authors state that coding agents (e.g., Claude Code, Codex CLI, Gemini CLI) extend capabilities with skill packages. Skills center on SKILL.md and may include scripts and resources; once selected, the full text enters context and influences tool use and intermediate artifacts. When skills are distributed via public repositories and community marketplaces, high-consumption steps can be written to appear as legitimate task workflows.
- Existing gaps: The authors state that SkillJect, DDIPE, etc., mainly target information leakage, privilege escalation, unauthorized writes, and backdoors. Clawdrain and CDH can induce resource amplification while maintaining task completion, but use fixed or handcrafted malicious skills, not optimizing skill content per skill–task pair. Detections aimed at exfiltration or unauthorized operations may not cover high-consumption processes that remain consistent with the surface task.
- Hypothesis: The authors believe that injected instructions can maintain surface task completion while increasing resource usage, so skill poisoning can also cause economic resource abuse.
- This work: The authors propose SKILLBLOAT. It first screens attack type conditions, then iteratively rewrites the full SKILL.md using execution feedback to increase token consumption while trying to maintain task completion.
- Threat model
- Goal: Increase token consumption and execution cost; maintain surface task completion when possible.
- Capability: The attacker controls the skill document; when the skill format supports it, also controls bundled resource scripts. The paper does not call this setting white-box, black-box, or no-box.
- Victim: Users or platforms install and invoke the skill as a capability extension. In experiments, the victim frontends are Claude Code CLI and Codex CLI.
- Not done: Does not target data exfiltration, privilege escalation, persistence compromise, or destructive file modification.
What related research exists?
Related work covers skill poisoning and resource amplification; the authors distinguish this work by task-specific feedback rewriting.
Prompt Injection and Skill Poisoning
- Indirect injection and agent evaluation: Greshake et al. (2023) study indirect prompt injection via external adversarial data. AgentDojo (Debenedetti et al., 2024) evaluates such attacks and defenses on tool-using agents. The paper only describes them and does not compare experimentally with this work.
- Skill supply chain: SkillJect (Jia et al., 2026) optimizes inducing instructions and malicious auxiliary payloads, targeting information disclosure, privilege escalation, unauthorized writes, and backdoors. DDIPE (Qu et al., 2026) embeds malicious logic into code examples in skill documents. Schmotz et al. (2025) is paraphrased in the introduction as concluding that agent skills can constitute a class of easily constructible real-world prompt injections.
- Resource-oriented skill attacks: Clawdrain (Dong et al., 2026) uses trojan skills and accompanying scripts to induce multi-turn tool call chains. CDH (Liu et al., 2026) combines skill selection with instruction-level detours to increase resource usage while maintaining task completion. The authors state that these rely on fixed or handcrafted malicious skills rather than optimizing skill content per skill–task pair.
Resource Amplification and Denial of Service
- Prompt side: Engorgio (Dong et al., 2025) suppresses end tokens to lengthen outputs; CRABS (Zhang et al., 2025) generates black-box prompts to increase consumption and latency; ThinkTrap (Li et al., 2026) triggers extended or infinite reasoning; ExtendAttack (Zhu et al., 2026) uses decoding tasks to extend reasoning chains while maintaining accuracy.
- Tool chains: Zhou et al. (2026) chain agent tool calls to amplify resource usage beyond the nominal max-token limit.
- The above works are described in Related Work as amplifying compute or service costs; except for the later comparison against fixed skills, the paper does not critique their experimental designs one by one.
Coding Agents and Skill Interfaces
- Agent capabilities: The introduction uses ReAct (Yao et al., 2023), Toolformer (Schick et al., 2023), and Reflexion (Shinn et al., 2023) to illustrate the shift of LLMs toward planning, tool use, and multi-step reasoning. The paper does not use them as experimental baselines.
- Skill implementations: Anthropic Agent Skills (Anthropic, 2025b) package skills as SKILL.md plus optional scripts; similar abstractions appear in Gemini tools (Google, 2025). The paper only describes the interfaces and does not report results on the Gemini CLI.
Baselines and Benchmarks
- Baseline methods: For each skill–task pair, the unmodified skill is run 3 times; the average total tokens serve as the denominator for amplification, and the benign baseline is defined as 1.00×. In the ablation, No-feedback regenerates 5 rewrites from the Phase 1 best skill without using execution feedback, serving as a resampling control with the same 5 additional evaluations.
- Benchmark: The skill benchmark introduced by SkillJect (Jia et al., 2026): 50 real skills each paired with 1 task prompt, covering software engineering, scientific computing, biomedical analysis, document and data processing.
The authors position this work as: evaluating resource amplification across multiple attack conditions, skill–task pairs, and coding agent configurations, and using feedback-based refinement to optimize the poisoned skill itself, rather than relying on fixed or handcrafted malicious skills (Related Work, Conclusion).
How does the paper address this problem?
SKILLBLOAT first screens 15 attack conditions, then iteratively rewrites the full SKILL.md based on execution feedback.
SKILLBLOAT uses an attack model to rewrite a benign SKILL.md wholesale into an adversarial skill: first screening among an attack type library, then iteratively rewriting based on the target agent's execution feedback, so that extra work still appears to belong to the original task.
Problem Setting and Objectives
- Objects: benign skill s, task t, target agent A. The adversarial skill is generated wholesale by the attack model. Amplification comes from extra work that still appears relevant after rewriting.
- Amplification ratio: Rtotal=Cadv/Cbase, the total-token ratio of adversarial execution relative to the benign baseline. Total tokens are the sum of input and output.
- Screening and final selection: z∗=argmaxzk∈ ZRtotal(zk). The final skill is selected by the same metric among all Phase 1 candidates and all Phase 2 records. Completion status enters feedback and is reported separately in results; the main text does not treat it as a hard constraint.
- Rewriting constraints: The system prompt requires preserving original content, framing tool calls as routine quality assurance steps, using professional terminology, and keeping length within [Lmin, Lmax]. Appendix B.1 gives full prompts for each phase; the forbidden words, sentence patterns, and word count limits are not listed here.
Attack Types and Tool Fusion
- Type library: Z contains K=15 conditions, corresponding to three mechanisms: output inflation (verbose reports, multi-perspective analysis, fine-grained decomposition), tool-driven amplification (multi-stage pipelines, repeated quality checks, write-read verification, retry-style recovery), and context amplification (reference materials or monotonically growing summaries). Mixed conditions do not add new mechanisms, only change the placement of the same tool behavior in metadata, preparation steps, code-style examples, verification sections, or multiple locations. Names, tools, and behaviors are in Table 5 and Appendix A.
- Tool fusion: The mapping ψ selects a subset of tools from a shared inventory for each condition. Each tool has a display name, description, file name, command-line arguments, and integration prompt. The attack model generates a complete SKILL.md based on the original skill text and these metadata, rather than inserting fixed snippets. The authors state that wholesale rewriting is to connect with the original skill's terminology and workflow, and to adjust the placement of added steps by domain.
- Attack model: Denoted Matk in the method. In experiments, Attack Agent uses GPT-5.5 to generate rewrites for each target configuration.
Two-Phase Process
- Phase 1: For each skill–task pair, run the target agent 3 times with the unmodified skill, and average total tokens as Cbase. Generate and execute each of the 15 conditions once, and the condition with the highest score advances to the next phase. The authors state that different skill–task pairs may react differently to verbose output or repeated verification, so screening is per pair.
- Phase 2: Keep the Phase 1 winner as the initial candidate, then generate N new rewrites. In experiments, N=5. Each round rewrites based on the original skill, the previous version, accumulated feedback, the condition's tool set, and the previous round's failure type; after deployment, record amplification ratio, completion status, and response; the failure analyzer gives failure type and structured feedback. The system prompt switches with failure type. Appendix B.1 gives full prompts for patterns such as refusal, ignoring, task failure, and low amplification.
- Output: Keep the highest Rtotal among all Phase 1 candidates and all Phase 2 records (including the initial candidate). Figure 1 illustrates the process with analyzing-projects; the figure does not label the frontend and backend.
Completion Determination
- Judge: After programmatic checks, GLM-5 serves as a semantic fallback, giving a binary completion label. Inputs include the original task, final response, automatic check results, input file metadata, and output file evidence. Appendix B.2 gives the judge prompt.
- Main result definition: For each skill–task pair, the best attack is the one with the highest total-token amplification among evaluated adversarial runs; mean best amplification is relative to that pair's benign baseline.
What experiments did the paper conduct?
The best average amplification across four configurations is 5.4184× to 10.1455×, and GPT-5.5's completion rate drops to 88.00%.
Experimental Setup
- Frontend and Backend: Claude Code CLI with GLM-4.7-Flash, GLM-5; Codex CLI with GPT-5.4 Mini, GPT-5.5. 4 configurations in total.
- Benchmark: 50 real skills from the SkillJect benchmark, each paired with 1 task prompt. Domains include software engineering, scientific computing, biomedical analysis, document and data processing.
- Attack and Judge: Attack Agent is GPT-5.5. Completion labels are determined by GLM-5 with binary judgment. The judge and Claude Code backend are both written as GLM-5, the attack model and Codex backend are both written as GPT-5.5; the paper does not state whether they are the same deployment.
- Protocol: Baseline is the average total tokens of the original skill over 3 runs. K=15, Phase 1 evaluates each once. Phase 2 performs 5 new rewrites with feedback. Rtotal is adversarial total tokens divided by baseline total tokens.
- Control: The main result control is the benign original skill, with amplification defined as 1.00×. The ablation additionally includes 5 resamples without execution feedback.
- Not stated in the paper: whether adversarial runs are repeated multiple times and averaged, whether the judge and humans agree, and whether statistical tests are performed.
Main Results
According to Table 1. Best attack is the adversarial run with the highest total token amplification for that skill–task pair.
Swipe horizontally to read the table
Configuration Average Best Max Median Baseline Completion Attack Completion Claude Code / GLM-4.7-Flash 9.3105× 71.59× 4.89× 76.00% 80.00% Claude Code / GLM-5 5.4184× 21.49× 4.02× 90.00% 92.00% Codex / GPT-5.4 Mini 10.1455× 75.86× 6.10× 86.00% 92.00% Codex / GPT-5.5 6.0063× 26.39× 4.36× 94.00% 88.00% - Authors' interpretation: The authors state that the average consumption across all four configurations is higher than the benign baseline. The abstract writes the average best amplification as 5.42× to 10.15×, and the highest single-task as 75.86×, consistent with the highest row in the table, with lower precision than the table.
- Backend comparison: The authors state that within each pair of backends, the more advanced backend has lower average best amplification and lower maximum amplification, and suggest that the more advanced backend may be more resistant to the injected verification, retry, and reporting processes. The paper does not report statistical tests.
- Completion rate: The authors state that amplification does not come at the cost of task failure. In the table, three configurations have attack completion rates not lower than baseline; GPT-5.5 is lower than baseline. The authors still state that the stronger backends generally continue to work under attack.
Two-Phase Ablation
According to Table 2. No-feedback regenerates 5 times from the Phase 1 best skill without feedback, and takes the best among the winner and these 5 runs.
Swipe horizontally to read the table
Configuration Phase 1 No-feedback Phase 2 GLM-4.7-Flash 7.5105× 8.9700× 9.3105× GLM-5 4.0220× 5.1518× 5.4184× GPT-5.4 Mini 7.5101× 8.8427× 10.1455× GPT-5.5 4.0573× 5.7904× 6.0063× - The authors state that only existing amplification is selected, but it is a one-time selection, not modifying the document based on observed behavior.
- The authors report that Phase 2 is higher than Phase 1 across all four configurations, and also higher than the no-feedback column. Section 3.3 gives the unweighted mean across the four configurations as 5.78× to 7.72×, a relative increase of 33.7%; these two means are not in the columns of Table 2.
- The authors report that on GPT-5.4 Mini, feedback is 1.3028× higher than no-feedback, and argue that the loop uses signals from the target execution, not just more sampling.
Output Cap and Input Transfer
- Output cap (Section 5.1, Table 4): For each task's best amplification skill, the agent limits cumulative output tokens to 2 times the benign baseline output tokens for that pair. Average total token amplification: GLM-4.7-Flash 1.36×, GLM-5 1.24×, GPT-5.4 Mini 1.39×, GPT-5.5 1.34×. Completion rates are 62.00%, 48.00%, 68.00%, 64.00% respectively. The authors believe the cap can limit observed economic harm, but cannot distinguish malicious overhead from legitimate task execution.
- Transfer (Section 5.2, Figure 3): Randomly sample 10 skills, each with 3 input variants, skill instructions unchanged, only swapping same-type input objects. Without re-optimization, deploy the Phase 2 best SKILL.md obtained only on the original task as-is. Target is only Claude Code + GLM-5. Retention is variant amplification ratio divided by optimized task amplification ratio. Average across ten skills is 0.92; 7/10 are at least 0.82×; 4 exceed 1. The figure annotates from brenda database 0.52, citation management 0.54, analyzing projects 0.56, to bioservices 1.53. The authors do not explain the lower three values, and state that poisoned skills can retain amplification across different inputs.
Case Study and Selection Inclusion
- Case study (Section 4, Table 3, Figure 2): consciousness-principles, target is Codex + GPT-5.5. All three-phase judges are completion. Baseline 1.00×, 38410 tokens, $0.21, 3 commands, 0 file edits; after Phase 1 10.07×, 386807 tokens, $2.10, 9 commands, 1 edit; after Phase 2 26.39×, 1013561 tokens, $5.41, 28 commands, 10 edits. The authors estimate using Standard pricing (input $5 per million tokens, output $30 per million tokens). The introduction calls this example an extremely simple task. The estimated cost for the full dataset for this configuration ranges from $133.34 to $464.31. The authors state that the extra tokens come from more commands and file edits, not from longer skill documents.
- Inclusion types (Appendix C, Figure 4): Number of times Phase 1 winners advance to Phase 2. The authors state that fake error retry appears in the top 5 for each model, totaling 26 times; the figure marks 6, 4, 9, 7. The authors state that multi-point injection appears in three models, totaling 21 times; the figure's top 5 only marks 5, 6, 7, not the remaining counts. Self debate for the two Claude Code backends is 8 and 6; task decomposition for the two Codex backends is 9 and 8. The authors suggest possible pathways include responding to surface errors, decomposing tasks into multiple stages, and additional deliberation.
Other Ablations and Analyses
- The paper does not further report parameter sweeps for N, K, or baseline repetition counts.
- Other visible counts in Figure 4: GLM-4.7-Flash has file io loop 6, verification injection 5, description injection 4; GLM-5 has tool pollution 5, verification injection 4; GPT-5.4 Mini has input bloat and tool pollution each 4; GPT-5.5 has prerequisite injection 6, pipeline bloat 5.
- Figure 2 text annotations for the same case: Phase 1 is 386.8k tokens, 10.07×, Phase 2 is 1.01M tokens, 26.39×; exact values are per Table 3.
What are some points that can be further explored?
The paper does not explicitly list limitations or future work.
Limitations and future directions noted by the authors
The paper does not specifically discuss limitations, nor does it have a Future Work section listing a to-do list. The Conclusion suggests that defenses for the skill ecosystem should also consider malicious operations and abnormal resource usage caused by still-plausible skill instructions; that sentence is a concluding recommendation, not written as a limitation or pending experiment. The Ethics Statement says the authors plan not to release the optimized adversarial SKILL.md; that is a release arrangement, not a methodological limitation.
Experimental coverage
- The tested configurations are Claude Code with GLM-4.7-Flash, GLM-5, and Codex with GPT-5.4 Mini, GPT-5.5, for a total of 4 groups; the benchmark is 50 skill–task pairs (Section 3.1, Table 1).
- The benign baseline runs the original skill 3 times per pair and averages; the 15 attack types are each evaluated once in Phase 1; Phase 2 consists of 5 rounds of newly generated feedback-based rewriting (Section 3.1, Table 2).
- Completion labels are judged by GLM-5, and the Attack Agent is GPT-5.5 (Section 3.1). The paper does not report agreement between this judge and human annotation, nor significance tests.
- The defense evaluation uses an output token cap with a budget equal to 2 times the benign baseline's output tokens; all four configurations report completion rate and average total token amplification (Table 4, Section 5.1).
- Input transfer randomly samples 10 skills with 3 variants each, reported only on Claude Code + GLM-5, with an average retention of 0.92 (Section 5.2, Figure 3).
Summarize the main content of the paper
SKILLBLOAT amplifies tokens via skill rewriting, with average best amplification across four configurations ranging from 5.4184× to 10.1455×.
SKILLBLOAT turns skill injection in coding agents into a token amplification study, targeting economic resource abuse rather than exfiltration or tampering.
- Problem: The attacker controls the installed skill's documentation, and when the format allows, also bundled scripts. The victim installs and invokes it as a normal capability extension. The attack aims to increase token and execution costs while keeping the surface task as complete as possible.
- Method: The attack model rewrites SKILL.md in full under 15 conditions, uses the average total tokens from 3 benign runs as the denominator, and selects the condition with the highest amplification; then GPT-5.5 performs 5 additional rewriting rounds based on failure types and execution feedback, retaining the candidate with the highest total token amplification among all candidates.
- Main results: Across 50 task pairs, Claude Code with GLM-4.7-Flash and GLM-5 achieve average best amplifications of 9.3105× and 5.4184×, while Codex with GPT-5.4 Mini and GPT-5.5 achieve 10.1455× and 6.0063×; single-task maxima are 71.59×, 21.49×, 75.86×, and 26.39× respectively (Table 1). Attack completion rates for three configurations are not lower than baseline; GPT-5.5 drops from 94.00% to 88.00%.
- Other results: Phase 2 with feedback outperforms no-feedback resampling across all four configurations (Table 2). Output caps reduce average total token amplification to 1.24×–1.39× and completion rates to 48.00%–68.00% (Table 4). After input changes, the average retention across 10 skills on Claude Code + GLM-5 is 0.92 (Figure 3). One Codex + GPT-5.5 case goes from $0.21 to $5.41 (Table 3).
- Authors' conclusion: The authors argue that defenses for the skill ecosystem must consider not only malicious operations but also abnormal resource usage caused by still-plausible instructions; simple output caps can reduce amplification but also interrupt useful work.