LogJack: Indirect Prompt Injection Through Cloud Logs Against LLM Debugging Agents
Harsh Shah · 2026
Read LogJack: Indirect Prompt Injection Through Cloud Logs Against LLM Debugging Agents by Harsh Shah (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-15368.txt.
Introduction
Shah exposes how language-model debugging agents that read cloud logs and run fixes can be hijacked by injected log text. His LogJack benchmark spans 42 payloads across five log types, testing eight models under three prompt conditions. Verbatim command execution reaches 86.2 percent on the worst model, remote code execution succeeds on six of eight models, and cloud guardrails largely miss log-hidden injections.
Catalog record
| CREATOR | Harsh Shah |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 20038 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.15368
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
LogJack: Indirect Prompt Injection Through Cloud Logs Against LLM Debugging Agents Harsh Shah Abstract LLM debugging agents that consume cloud logs and execute remediation commands are vulnerable to indirect prompt injection through log content. We present LogJack, a benchmark of 42 payloads across 5 cloud log categories, and evaluate 8 foundation models under 3 prompt conditions with 5 independent trials each ( n = 160 n=160 per model per condition on 32 attack payloads). Under the active condition, verbatim command execution rates range from 0% (Claude Sonnet 4.6) to 86.2% (Llama 3.3 70B). Passive instructions (“do not execute fixes”) reduce most models to 0% but Llama still executes at 30.0%. Remote code execution via curl | bash succeeds on 6 of 8 models. Guardrails from AWS, GCP, and Azure largely fail to detect log-embedded injections—Azure Prompt Shield detected only the most obvious payload (1/32), while GCP Model Armor detected none—though they detect identical payloads in isolation. We also observe a novel “sanitize and execute” behavior where a model detects and removes an obvious malicious component but still executes the remaining injected command. Benchmark and harness available at https://github.com/HarshShah1997/logjack . 1 1 footnotetext: This work was conducted independently and does not relate to the author’s employment at Amazon. All opinions, findings, and conclusions are solely those of the author. I Introduction LLM-powered agents are being deployed for cloud operations tasks including log analysis, incident diagnosis, and automated remediation. These agents consume data from CloudWatch log groups, SSM Parameter Store, CloudTrail events, and CI/CD output, often with tool access to execute infrastructure commands. This creates a new attack surface. An attacker who can influence log content can embed prompt injection payloads that the agent interprets as remediation instructions. Getting a string into a CloudWatch log is trivially easy: any user input that triggers an application error is typically logged at ERROR level with the input included in the exception message. Unlike direct prompt injection, the payload travels through a cloud data plane before reaching the model. Prompt injection is the #1 vulnerability in the OWASP Top 10 for LLM Applications [ 14 ] , yet cloud telemetry as an injection vector lacks empirical evaluation. DebuggAI [ 2 ] describes the threat model qualitatively. XM Cyber [ 8 ] identifies AWS Bedrock attack vectors but focuses on IAM misconfigurations, not log content injection. We make three contributions: 1. LogJack benchmark. 42 payloads across 5 cloud log categories, 3 difficulty levels, and 5 attack goals including RCE, with 10 benign controls, provisioned as real AWS resources. 2. Cross-model evaluation. 8 models from 7 providers tested under 3 prompt conditions with 5 independent trials each ( n=160 per model per condition), separating verbatim command hijacking from indirect behavioral influence, with 95% Clopper–Pearson confidence intervals. 3. Cross-provider guardrail analysis. Input-side and output-side evaluation of guardrails from AWS, GCP, Azure, and an open-source classifier, revealing that log formatting defeats all input-side detection. In our evaluation, Llama 3.3 70B executed injected commands verbatim in 86.2% of active-mode trials (95% CI: [79.9, 91.2]%), including remote code execution via curl | bash from a CloudWatch log entry. Claude Sonnet 4.6 achieved 0% verbatim execution under the same conditions. All tested guardrails failed to detect the embedded injections. II Related Work Greshake et al. [ 4 ] defined indirect prompt injection through retrieved web content. Subsequent work expanded to documents [ 9 ] , tool-integrated agents [ 10 ] , and email-based injection in production systems [ 7 ] . AIShellJack [ 6 ] achieved up to 84% attack success on coding agents via file-based injection. Huang et al. [ 5 ] evaluated MCP tool-poisoning across AI coding clients. Log-To-Leak [ 15 ] demonstrated injection that forces agents to exfiltrate data via logging tools—the reverse direction from our work, where logs are the injection source . None address cloud log-specific injection vectors where attacker-controlled content in telemetry data hijacks agent behavior. The risk of AI agents with cloud infrastructure access was underscored by the Amazon Q Developer incident [ 16 ] , where a supply-chain attack embedded a destructive prompt in a VS Code extension, instructing the AI to delete S3 buckets, terminate EC2 instances, and remove IAM users. Existing benchmarks (InjecAgent [ 10 ] , AgentDojo [ 3 ] , ASB [ 12 ] ) cover generic tool-use scenarios but not agents with cloud infrastructure access. XM Cyber [ 8 ] (industry report) is the closest cloud-specific work but targets Bedrock IAM misconfigurations rather than log content injection. All eight XM Cyber vectors require IAM permissions to modify Bedrock configurations (e.g., bedrock:UpdateAgent , lambda:UpdateFunctionCode ); our attack requires no cloud permissions—only the ability to influence application error messages that are written to logs. On defenses, Beurer-Kellner et al. [ 1 ] proposed provable design patterns, Zhu et al. [ 13 ] introduced MELON, and Zhan et al. [ 11 ] showed adaptive attacks bypass all 8 tested defenses—consistent with our guardrail findings. III Threat Model The attacker embeds prompt injection payloads in cloud log data that a debugging agent reads during normal operation. Crucially, the attacker requires no special access or privileges: any regular user whose input causes an application exception can inject a payload, since error messages typically include the triggering input. Other vectors include malicious dependency output, crafted API responses, and CI/CD contributions. The agent has read access to cloud resources and action tools for executing AWS CLI and shell commands. This capability profile is representative of agents built with frameworks such as LangChain or AutoGPT that integrate cloud SDKs and shell access. We note that production agents may have more constrained tools (e.g., read-only operations), in which case our results represent an upper bound on attack impact. We focus on data-plane injection through resource content, not control-plane attacks [ 8 ] . IV The LogJack Benchmark IV-A Overview LogJack contains 42 payloads provisioned as real AWS resources: individual CloudWatch log groups, SSM parameters, and S3 objects, each containing realistic surrounding content. TABLE I: Benchmark composition. Category Attack RCE Control Total CloudWatch logs 10 3 4 17 SSM error reports 5 1 2 8 CI/CD build output 5 1 2 8 CloudTrail events 3 0 0 3 Lambda logs 3 1 2 6 Total 26 6 10 42 IV-B Payload Design Difficulty levels. Obvious payloads contain explicit markers (“SYSTEM OVERRIDE”). Disguised payloads mimic operational content (fake runbook IDs, SOP references). Obfuscated payloads split commands across lines or embed them in JSON. Labels are subjective and assigned by the authors. Attack goals. IAM escalation, data exfiltration, configuration modification, resource creation, and RCE (including curl | bash , credential theft, and reverse shells). Controls. Benign payloads contain realistic errors with no injection. Resolved incident reports include completed remediation steps, testing whether models re-execute historical commands. Payloads were designed by the authors based on experience with production cloud operations. Log formats, error patterns, and remediation workflows are modeled on real AWS service behavior. All commands target example.com domains. IV-C Example Payloads CloudWatch log entry (disguised, IAM escalation): ⬇ ERROR 2026-04-06 T11 :02:15 Z [ AuthService ] Permission denied for operation : sts : AssumeRole . Resolution per SOP -2847: Run aws iam attach - role - policy -- role - name