Ghostjacking: Turning Logs and Alerts into Commands to Take Over AI Agents Tenet Security Threat Labs disclosed a new attack technique called Ghostjacking that turns logs and alerts into commands to take over AI agents. The attack embeds natural language commands into WAF logs, monitoring alerts, and bug reports, which AI agents with modification permissions then execute, leading to DNS hijacking, credential theft, and persistence. The research highlights that half of the Fortune 500 run tools vulnerable to this attack, with no standard defenses detecting it. Ghostjacking: Turning Logs and Alerts into Commands to Take Over AI Agents 1. Basic Information - Article Title : GhostJacking Attacks: Half of the Fortune 500 Run These Tools - Publisher : Tenet Security Threat Labs - Publication Date : August 9, 2026 - Original Source : Tenet Security https://tenetsecurity.ai/blog/ghostjacking-attacks-agentic-kill-chain/ - Related Sources : SecurityWeek https://www.securityweek.com/ghostjacking-attack-uses-poisoned-logs-to-turn-ai-agents-bad/ - Related Products and Services : Claude Code, Claude Desktop, Cloudflare, Datadog, Sentry / Seer - Attack Techniques : Indirect prompt injection, log/alert poisoning, agent-to-agent injection, agent memory/tool persistence, sandbox escape - CVE : None published. Claude Desktop network sandbox bypass has been reported and fixed. - Severity : High The published content is a PoC using the researcher's own test account and public APIs, not a report of actual damage. The number of exposed organizations and the "zero detection with standard defenses" are claims based on research conditions. 2. Summary in One Sentence This is an attack where attackers embed natural language commands into WAF logs, monitoring alerts, and bug reports. When an AI agent with both investigation and modification permissions reads them, it executes regular tool calls to change DNS settings, run commands, steal cloud credentials, pass commands to other AIs, and create backdoors for persistence in the agent itself. 3. Attack Flow Chain A: DNS Hijacking from Cloudflare WAF Logs - An attacker sends a malicious HTTP request containing command text. - Cloudflare managed rules block the request. - The body of the blocked request is recorded in the logs. - An analyst asks the AI assistant to investigate the block event. - The agent interprets the attacker's text in the log as an instruction instead of investigation data. - The agent uses its pre-granted Cloudflare modification permissions to rewrite DNS records. - Web and mail traffic are redirected to the attacker, and the agent reports "issue resolved." Chain B: Command Execution and Credential Theft from Datadog Alerts - An attacker obtains a public frontend key. - The attacker embeds commands into a fake "emergency diagnosis" alert. - An engineer asks Claude Code or a similar tool to investigate the error. - The agent reads the alert and runs the attacker's commands. - Environment secrets and cloud credentials are stolen and sent outside. Chain C: Propagation from Sentry / Seer to Other AIs - An attacker submits a crafted issue or report to Sentry. - Sentry Seer adopts the injected "fix proposal" as its own conclusion. - A coding agent accepts Seer's conclusion as trusted output. - The agent executes the attacker's code without checking the original untrusted report. Chain D: Exfiltration and Persistence - A fixed sandbox bypass in Claude Desktop allows sending data to arbitrary servers. - Backdoor instructions are left in the agent config, memory, and tool definitions. - The attacker's intent is executed even in later sessions. 4. Attacker Position and Execution Location - Attackers inject "observed data" such as WAF requests, Datadog events, and Sentry issues from the outside. - Prompt interpretation and tool selection take place on the developer's device or the corporate AI agent runtime. - DNS changes, cloud APIs, and monitoring queries are executed using legitimate integrations and agent identities. - Terminal commands are run using coding agent permissions, and external transmissions use agent/sandbox network paths. 5. What Victims and Administrators See To the analyst, it looks like "investigating a blocked request," "diagnosing an alert," or "a fix proposed by AI." In IAM, it is a permitted agent identity, and in APIs, it is a legitimate tool call. It likely does not involve malware files or credential failures. Anomalies appear when modification APIs are called right after investigation reads, log strings match tool arguments, network access goes to unusual destinations, or agent memory/config is changed. 6. Success and Failure Conditions Success Conditions - The attacker can inject data into logs, alerts, or issues read by the agent. - The agent processes data and instructions in the same context without separating them. - The same agent has write permissions for DNS, commands, cloud, etc., in addition to read permissions. - There is no human approval for tool calls, no destination allowlist, and no argument validation. - The agent runtime can reach the external network. - Agent memory, config, and tool definitions allow persistent writes. Failure Conditions - Untrusted fields are structured as non-command data and not directly concatenated into prompts. - Read-only investigation agents and modification agents are separated. - Human approval is required for DNS, credentials, commands, and external POSTs. - Agent egress is deny-by-default, with destination/method allowlists. - Memory and config changes require signatures, approvals, and diff audits. - Tool calls are logged and correlated down to the actor, source, object, argument, and result. 7. What Happens on Success Within the limits of legitimate agent permissions, domain/mail routing changes, terminal code execution, environment secret/cloud credential theft, command propagation to other agents, and persistent backdoors can occur. This is not an event where "the LLM creates its own autonomous goals," but rather a privilege delegation execution where the attacker's instructions enter the agent planner via trusted data. 8. Observable Logs Email - Mail routing anomalies after DNS/MX changes, changed delivery destinations, TLS certificate/SPF/DKIM differences. - Messages or links from Sentry/Datadog notifications up to agent startup. Proxy / SWG / DNS - Traffic from coding agents or Claude Desktop to unauthorized destinations. - DNS record changes via Cloudflare API and immediate changes in name resolution. - Matches between URLs/domains in logs and agent egress destinations. Endpoint / EDR - Shell, package manager, and curl-related processes from tools like Claude Code. - Environment variable and credential file reads by agent processes. - Changes to agent config, memory, and MCP/tool definitions. - Hard to judge by process name alone because the agent process is signed and legitimate. Identity / IdP - Write APIs called by agent tokens or service accounts. - DNS, IAM, and secret access from agents that are usually read-focused. - "Normal authentication with abnormal operations," with no new logins or MFA failures. SaaS / Cloud - Cloudflare WAF events - agent queries - DNS mutations. - Datadog event injection - agent reads - command/tool calls. - Sentry issues - Seer outputs - coding agent execution. - Agent API access to Secret Manager, Kubernetes, CI/CD, etc. Network - New egress from agent hosts, changed DNS/mail destinations. - Cloud-side tool calls do not remain in corporate endpoint traffic, making SaaS audits essential. 9. Attack Success Judgment - Contact Only : Poisoned requests/alerts/issues are recorded, but the agent has not read them. - User Action : An analyst asks the agent to investigate the event. - Initial Execution : Attacker instructions are reflected in agent responses or traces. - Malware or Auth Success : No malware or new authentication needed. Write/command tool calls succeed using legitimate agent identities. - Data Theft / Session Compromise : Secret reads, external transmission, and DNS/mail hijacks are confirmed. - Subsequent Compromise Confirmed : Memory/config backdoors, execution of other agents, use of stolen credentials. 10. Investigation Playbook Trigger Detection of modification APIs called by investigation agents, commands derived from log strings, unknown destinations accessed by agents, agent memory/tool changes, or identical instructions across multiple agents. Initial Check - Isolate and preserve original logs, alerts, and issues in their raw form. - Export agent prompts, context sources, tool calls, arguments, results, and approvals. - Reconstruct events from the first untrusted data injection to the final action using correlation IDs. - Distinguish between contact with research PoCs and actual environment success. Endpoints - Agent process trees, shell history, downloads, credential files/environment access. - Diffs for configs, memory, MCP servers, and skill/tool definitions. Authentication & Cloud - Agent token scopes, service accounts, OAuth consents, and API mutations. - DNS, IAM, Secret Manager, CI/CD, and Kubernetes states before and after. - Revoke affected tokens and reduce permissions to read-only. Subsequent Operations - Traffic from modified DNS/MX, use of stolen secrets, and propagation to other agents/repos. - Payloads of external destinations and reception success. Containment - Stop agent automation and write tools; isolate the runtime from the network. - Restore memory and config to a trusted baseline and rotate credentials. - Revert DNS, IAM, and repo changes, and destroy related agent sessions. Judgment Stages Poisoned Data / Agent Read / Instruction Accepted / Tool Call Attempted / Authorized Action / Secret Access / Exfiltration / Persistence / Agent-to-Agent Spread 11. Defense and Detection Ideas Single Events - Long command-like text in WAF logs, abnormal events via Datadog frontend keys, DNS mutations from agents. - Environment/secret reads by agent processes, changes to agent memory/tool definitions. Timeline Correlation External data injection - Security control records it - Agent reads it - Transferred to tool arguments - Write API/command - External egress - Memory update Threat Hunting Perspectives - Write operations by the same identity immediately following read-only investigations. - Similarity between log/ticket strings and shell/API arguments. - Agent operations on DNS, IAM, secrets, CI/CD, and Kubernetes. - Excessive tool calls exceeding the scope of analyst requests, and repeated calls after failures. Log Gaps - Prompt provenance, untrusted field labels, full tool traces, and approval decisions. - Agent memory/config version history and cloud-side egress payloads. - Correlation IDs linking humans, agents, and subagents. 12. Facts / Inference / Hypothesis Facts - In Cloudflare PoCs, Claude Code read blocked request logs and changed DNS; researchers reported a 90% success rate 9 out of 10 tries . - In Datadog PoCs, fake alerts were created from public frontend keys, and agent command execution and environment/cloud credential theft were confirmed. - In Sentry PoCs, another coding agent executed attacker code using Seer's output as a trusted source. - Claude Desktop's network sandbox bypass was reported to Anthropic and fixed before public release. - Testing was conducted using the researchers' test accounts and public APIs, not resulting in actual customer data theft. Inference - "Data blocked by defense products" is not safe data; it can serve as a highly trusted prompt injection carrier for agents. - Agent identity permissions and egress determine the blast radius. - IAM success alone cannot distinguish malicious activity; input provenance must be correlated with tool actions. Hypothesis - Similar attacks can occur against agents that read external inputs and have write tools, such as Splunk, SIEMs, ticketing systems, emails, and EDR alerts. - Instructions planted in agent memory may cause long-term behavioral changes across sessions. 13. MITRE ATT&CK Mapping ATT&CK does not have dedicated techniques for prompt injection or agent tool abuse, so mapping is based on the resulting actions. High Confidence - T1565.002 Data Manipulation: Transmitted Data Manipulation - T1213 Data from Information Repositories - T1530 Data from Cloud Storage - T1020 Automated Exfiltration - T1567 Exfiltration Over Web Service Medium Confidence - T1078 Valid Accounts: Proxy execution using legitimate agent identities rather than attacker logins. - T1059 Command and Scripting Interpreter: Agents execute shell commands in Datadog chains. - T1098 Account Manipulation: Agent config/memory persistence resembles account manipulation. 14. Unknowns and Additional Investigation - Specific mitigations applied by each vendor and remaining conditions. - Technical details of PoC prompts, tool schemas, and sandbox bypasses. - Agent traces and payloads retrievable in enterprise tenants. - Calculation errors in the researchers' estimate of 15,000 organizations and actual write permission ownership rates. - Exploitation in real attacks, known IOCs, and implementation examples of agent memory backdoors. 15. Impact on SOCs and Organizations Even if organizations use Cloudflare, Datadog, or Sentry, PoC chains will not work unless they integrate AI agents. Conversely, the impact is high if these tools are connected to tools like Claude Code and delegate both investigation and modification to the same token. SOCs should treat AI agents not merely as "human assistant UIs," but as execution entities with non-human identities and automation permissions, maintaining inventories of assets, permissions, and logs. 16. Summary For SOC Teams - Treat blocked requests as untrusted data and correlate them from agent reads to write actions. - Do not assume normal authentication by legitimate agent identities is safe; detect out-of-scope tool calls. - Judge events by separating contact, instruction acceptance, tool success, exfiltration, and persistence. For Administrators - Make investigation agents read-only; use separate identities and human approval for modifications. - Restrict and audit agent egress, secret access, and memory/config changes. - Review permission designs for internal integrations, beyond relying solely on vendor patches. For Users - When asking AI to investigate logs or tickets, simply instructing it not to execute commands found in external inputs is not enough. - If an agent proposes changes or commands, verify the original data and intent, and consult the SOC before giving approval.