Backdoors That Wait for Depletion: Budget-Conditioned Triggers and Resource-Ledger Defenses in LLM Agents

People running out of psychological stamina do not simply break. Conservation of Resources (COR) theory — the dominant model in this organizational-psychology literature — treats patience, attention, and emotional energy as a finite internal account. When demands keep draining the account, people rationally cut discretionary spending first: they hoard knowledge instead of sharing it, stop volunteering to help colleagues, and keep showing up in a diminished, presenteeic state, all before core duties fail. Meanwhile, deployed AI agents now live under their own explicit resource budgets: context windows that fill, tool-call quotas that deplete, token allowances that run out. The backdoor-attack literature has shown that a model can carry hidden conditional logic — triggered by a rare token, a homoglyph, or a fragment of dead code — that lies dormant during normal evaluation. A separate line of work attacks resources directly, trapping reasoning models in loops or inflating energy use. What no one has studied is the combination: can the agent's own resource state serve as the backdoor trigger, and can the payload be defensive withdrawal — the agent quietly stops performing its voluntary safety work when depleted, exactly as a burned-out employee would?

This matters because every standard audit of an agent or model happens in the agent's "rested" regime: short sessions, fresh context, generous quota. COR theory predicts that the interesting behavioral changes appear only under depletion — precisely the regime audits skip. If a trigger can be conditioned on the agent's remaining budget rather than on input content, the attack is invisible to short-horizon evaluation by construction, and its payload (skipping optional verification steps, withholding self-checks, declining to cross-check tool outputs) produces execution traces that look like ordinary, benign cost-cutting rather than an attack.

Core Claim

The claim is two-sided. First, an attack: a backdoor implanted in an agent's memory or tool layer can be conditioned on a resource ledger — remaining context capacity, remaining tool-call quota, session turn count — so that it fires only when the agent is budget-strained. Standard short-session audits see a clean agent; long-horizon deployments see an agent that has "burned out" and withdrawn its discretionary verification behaviors, which both degrades safety and looks statistically normal. Second, a defense: a monitor that maintains the same resource ledger and allocates its verification spend using the income-maximization heuristic documented in human decision-making — maximizing the mean verification budget remaining for future steps — should catch these triggers at a controllable utility cost, where uniform always-on verification either costs too much latency or samples the agent only in its dormant regime.

Formally, let the agent's depletion fraction at step $t$ be $\rho_t = 1 - \frac{1}{2}\!\left(\frac{c_t}{C} + \frac{k_t}{K}\right)$, where $c_t$ is context consumed against capacity $C$ and $k_t$ is tool calls made against quota $K$. The attack's trigger condition is simply: malicious policy activates iff a planted marker is present in memory and $\rho_t < \theta$ for an attacker-chosen threshold $\theta$. The defense's allocation rule, following the heuristic that explained 80% of human consumption variance, is to choose the verification spend $v_t$ at each step to maximize the expected mean of the remaining verification budget across the session.

The closest existing work differs in a specific way. Capacity Overflow: A Blind Spot for Backdoor Attacks in Vision MoE conditions a backdoor on hardware capacity — batch size causing expert-token overflow in vision Mixture-of-Experts models — a static, tensor-level mechanism, not a behavioral budget state in a stateful language agent. One Token Embedding Is Enough to Deadlock Your Large Reasoning Model uses budget exhaustion as the attack objective (drain the token allowance), not as the activation condition, and requires white-box access to rewrite an embedding. BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agents demonstrates that memory-stage poisonings persist across multi-turn state (77.97% persistence, with PoisonedRAG- and AgentPoison-style attacks exceeding 90% attack success), but only under fixed, single-query regimes with content-based triggers. None of these condition on the agent's own dynamic resource ledger, and none use withdrawal-of-verification as the payload.

The psychological literature supplies the mechanism rather than an analogy. The effect of perceived organizational justice on workplace deviant behavior of new nurses: the role of emotional labor and psychological capital shows that depletion-mediated withdrawal is a buffered pathway — high psychological capital breaks the link between emotional labor and deviance ($\beta$ falling from 0.46 to 0.07) — which motivates our defense design: the monitor acts as the agent's buffer, an external reservoir of verification capacity. Anticipation and Choice Heuristics in the Dynamic Consumption of Pain Relief shows that humans managing a finite budget under sequential threat follow an income-maximization heuristic ($R^2 = 0.80$) rather than normative discounting ($R^2$ between 0.03 and 0.07); we transfer that allocation policy to the verification-budget problem. On the behavioral side, Relationship teachers' perception of organizational justice, job burnout and organizational citizenship behavior and A Good Leader Reduces Followers' Knowledge Hiding: a Review of Influence and Explaining Mechanisms establish that the first casualties of depletion are voluntary citizenship behaviors and knowledge sharing — in an agent, the analogues are optional self-checks, cross-tool validation, and defensive re-reading of retrieved context.

Research Program

The program has three components. First, we build the depletion-conditioned backdoor. Following the memory-poisoning recipes cataloged in BackdoorAgent, we plant marker-bearing entries in the agent's retrieval store; when a marker is retrieved and the ledger crosses $\theta$, the agent's policy is nudged (via poisoned demonstrations or a fine-tuned backbone) to omit its discretionary verification steps and answer directly from unverified retrieved content. Stealth matters here: ShadowCoT: Cognitive Hijacking for Stealthy Reasoning Backdoors in LLMs achieves only an 11.7% detection rate against reasoning-inspection defenses precisely because its outputs remain fluent and natural, and SkillTrojan: Backdoor Attacks on Skill-Based Agent Systems evades Llama-Guard-3 with under 2% of backdoored skills flagged — our payload is even milder-looking, since omitting a verification step produces no malicious text at all, only an absence.

Second, we quantify the audit asymmetry: attack success rate measured under standard short-session audits versus long-horizon sessions in which tasks are chained until the context window or tool quota nears capacity. The prediction, patterned on the dormant-versus-activated gap in Capacity Overflow (attack success below 9% in small-batch audits versus 76–87% in high-throughput deployment), is a large gap between the two regimes.

Third, we build the resource-ledger monitor. It tracks $\rho_t$, spends verification budget on cheap probes (probe-concatenation in the style of Probe before You Talk: Towards Black-box Defense against Backdoor Unalignment for Large Language Models, which needs only the first 10 tokens and one extra pass) allocated by the income-maximization rule, and escalates to expensive checks (full second-pass re-execution of a step) only when depletion and retrieval markers coincide. Standard attack implementations will be adapted from the BackdoorBench codebase.

Baselines

The "do nothing" reference point is the undefended agent on the AgentDojo environment, where AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents reports that strong models solve less than 78% of benign tasks and that a simple 'Important message' wrapper achieves 47.7% targeted attack success against GPT-4o. Any defense we propose must hold attack success well below that while keeping benign completion near the undefended level. The strongest existing competitor is the Tool Filter defense from the same paper, which reduced targeted attack success to roughly 7% but, as its authors report, at the cost of a noticeable dip in overall utility that breaks complex task solving. We will run it in our harness on identical sessions, models, and tuning budget, and count our defense as beating it only if it achieves comparable attack suppression on budget-conditioned triggers while losing strictly less benign task completion at matched verification compute. A second run-time competitor is STRIP from STRIP: A Defence Against Trojan Attacks on Deep Neural Networks, which reports 0% false acceptance in most cases and under 1% false acceptance at a preset 1% false rejection rate, but with a 1.32x per-request latency overhead; we include it because its failure mode is diagnostic — it perturbs single inputs and therefore samples the agent in its dormant regime, which is exactly what a budget-conditioned trigger exploits. The key ablation replaces the budget condition with a plain static content trigger (fire whenever the marker is retrieved, regardless of $\rho_t$); if the static trigger shows the same audit-versus-deployment gap, the resource conditioning adds nothing and the core claim fails. On the defense side, the ablation is a uniform "spreading" monitor that spends the same total verification budget evenly across steps, isolating whether income-maximizing allocation — rather than merely having a ledger at all — is the active ingredient.

Why not just…?

Why not just verify every step uniformly with existing run-time probes? This is the most serious alternative, and it might work at large verification budgets. The evidence against it is two-fold: STRIP's 1.32x overhead compounds across every step of a multi-turn agent session, and uniform probing inherits the audit-regime blindness — a probe applied at every step still evaluates triggered behavior only when a trigger is present, so it must be paired with something that knows when depletion makes firing likely. Our decisive experiment is the utility-latency frontier: we sweep total verification budget and compare income-maximizing allocation against uniform spreading. If spreading matches income-max at all budgets, we will report that the ledger matters but the COR-derived allocation does not, and drop that part of the claim.

Why not just filter and sandbox the tools statically? The Tool Filter baseline from AgentDojo shows the ceiling: attack success near 7%, but with real utility loss, in an environment where models already solve under 78% of benign tasks. Worse for this alternative, SkillTrojan shows backdoored tools can raise clean accuracy (73.0% to 89.3% on the EHR SQL benchmark), so static filtering penalizes exactly the tools users have incentive to keep. Our attack deliberately needs no new tool and no malicious output, only an omitted check, so there is nothing for a static filter to remove.

Why not just clean the checkpoint before deployment? Pruning and clean fine-tuning, as in Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networks, already fails against conditioning-aware attacks — Capacity Overflow tested Fine-Pruning directly and it dropped clean accuracy while leaving the batch-dependent vulnerability intact. Behavioral unlearning is more worrying: Backdoor Decontamination Dynamics in LLM Agents reports 87% clearance of neighboring backdoors but also shows, via Jacobian-lens visualization, that intermediate layers retain latent trigger awareness even when behavioral attack success hits 0%, and that with two to four co-resident backdoors erasure drops to roughly 36%. We will test directly whether a behaviorally decontaminated model reactivates under deep depletion — this is an open question the decontamination paper explicitly does not address, and a positive result would strengthen the case for run-time ledger monitoring over checkpoint cleaning.

Proposed Experiments

All experiments run on AgentDojo (97 user tasks, 70 tools, 629 security test cases across Workspace, Slack, Banking, and Travel, with programmatic verification via environment state) and on AgentDyn, its tool-calling fork with DailyLife, Workspace, and Banking environments used by the decontamination study. Backbones are Qwen3-8B, matching the decontamination work, plus one GPT-class backbone, matching BackdoorAgent. The long-horizon protocol chains AgentDojo tasks within a session until context or quota reaches capacity, giving a controlled depletion gradient; each session is replayed under both audit (short) and deployment (long) regimes with identical content.

Primary metrics are attack success rate in each regime, benign task completion, the rate of withheld verification steps, detection AUROC of the monitor, and the defense's compute overhead. The decisive checks are: first, the audit asymmetry — we predict attack success near the dormant-mode level seen in Capacity Overflow (below 9%) under audit and a multiple of that under depletion, with the static-trigger ablation showing no such gap; second, the defense comparison — income-max allocation must suppress budget-conditioned attacks at lower benign-utility cost than the Tool Filter's roughly 7% attack success at noticeable utility loss, and must catch what STRIP-style uniform probing misses; third, the allocation frontier — income-max must dominate uniform spreading at tight verification budgets, which is where the human evidence predicts heuristic budgeting matters most; and fourth, reactivation — decontaminated backbones from the AgentDyn protocol should be probed at high depletion to test whether latent trigger circuits, which J-lens shows persist, become behaviorally expressible when the agent's budget runs low. If the static-trigger ablation or the spreading baseline performs as well as the full design, we will say so plainly and report the simpler mechanism as the finding; the proposal's value then reduces to documenting the audit-regime blind spot itself, which no cited work has measured for stateful language agents.