A new attack technique against proprietary large language model APIs is making the rounds, and it should be on every security team's radar — especially if your organization builds on, or exposes, LLM-powered services. Research discussed this week demonstrates that the hidden chain-of-thought ("reasoning traces") that frontier models generate internally — and that API providers deliberately conceal or summarize — can be recovered by external parties through carefully constructed interactions with the public API.
This matters for two distinct audiences. First, if you are an LLM provider or you operate an LLM gateway, your reasoning traces are intellectual property: they reveal problem-solving structure that can be harvested at scale for model distillation, effectively letting a competitor train a derivative model on your model's reasoning without ever touching your weights. Second — and this is the part defenders consistently underestimate — reasoning traces frequently contain sensitive operational content: fragments of system prompts, internal tool schemas, retrieved document text, and occasionally secrets or PII that the model was handling while it "thought." If an attacker can recover the full trace instead of the sanitized summary your API returns, anything the model reasoned over becomes exfiltratable.
There is no CVE here and no patch to apply. This is a design-level exposure in how reasoning-capable models are served. The defensive response is architectural: control what reasoning content is exposed, monitor for extraction behavior, and treat trace content as a sensitive data channel.
Technical Analysis
What is being attacked
Reasoning-capable models (the class of models that produce extended internal deliberation before answering) generate long token sequences that are materially more informative than the final answer. Providers typically suppress these traces or replace them with condensed summaries before responding to the API client. The attack demonstrates that this suppression is not a security boundary — it is an output filter, and output filters leak.
How the attack works, from a defender's perspective
The observable attack chain has a consistent shape:
-
Reconnaissance probing. The attacker issues batches of prompts designed to characterize how the API handles reasoning: comparing responses with reasoning enabled versus disabled, varying
reasoning_effort-style parameters, and measuring token counts, latency deltas, and billing metadata. Providers that return token usage breakdowns (reasoning tokens vs. output tokens) hand the attacker a side channel for free. -
Trace elicitation. Using structured prompting — for example, instructing the model to externalize, encode, paraphrase, or continue its reasoning within the visible answer, or exploiting streaming/summary endpoints that leak more of the trace than the primary endpoint — the attacker reconstructs reasoning content that was supposed to stay hidden. Even partial recovery is valuable: a statistically significant sample of traces across a domain is enough for distillation.
-
Industrial-scale harvesting. Extraction is not one prompt; it is thousands to millions of requests. The attacker distributes queries across accounts and API keys, rotates source IPs, and paces requests to stay under naive rate limits. The output is a corpus of reasoning traces used to fine-tune a competitor model or to mine for embedded secrets and internal context.
What is at risk
- Model intellectual property. Reasoning traces are a distillation goldmine. This is the same threat model as classic model extraction, but the traces are dramatically higher-signal than input/output pairs.
- Sensitive data in traces. Models reason over whatever is in context: system prompts, RAG-retrieved documents, tool outputs, user data. Traces can contain verbatim fragments of all of it.
- Compliance exposure. If your LLM application processes regulated data (HIPAA, PCI-DSS scope), a reasoning trace that contains that data and is recoverable by a third party is an uncontrolled data flow. Your DPIA and your data-flow diagrams almost certainly do not account for it.
Exploitation status
The technique has been publicly demonstrated and documented. There is no indication of a coordinated campaign at nation-state scale, but the barrier to entry is low — it requires only API access and patience — and the economic incentive (distillation of frontier reasoning capability) is enormous. Treat this as an actively available technique, not a theoretical one.
Detection & Response
This is an application-layer threat, so your detection surface is the API gateway, WAF, and application telemetry — not EDR process trees. If you operate an LLM API or an internal LLM gateway, the highest-fidelity signals are:
- Volume and pattern anomalies: single identities (API keys, service accounts, source IPs, session fingerprints) issuing reasoning-heavy requests at volumes inconsistent with their historical baseline or their stated use case.
- Elicitation markers in prompts: requests containing instructions aimed at externalizing reasoning — phrases targeting the model's "thinking," "reasoning," "step-by-step hidden process," requests to encode or summarize the model's own deliberation, or systematic parameter sweeps of reasoning-effort settings.
- Side-channel probing: clients that tightly correlate requests against token-usage metadata, or that repeatedly diff responses across reasoning configurations.
Sigma Rules
These rules assume your LLM gateway or reverse proxy logs are normalized into your SIEM (webserver logsource). Tune the volume thresholds to your environment — a busy production API will need higher baselines.
---
title: High-Volume LLM Reasoning Requests from Single Source
description: Detects a single source identity generating an abnormal volume of requests to LLM completion/reasoning endpoints, consistent with reasoning trace harvesting for model distillation.
references:
- https://simonwillison.net/2026/Aug/11/stealing-reasoning-traces/
author: Security Arsenal
date: 2026/08/12
status: experimental
logsource:
category: webserver
detection:
selection:
cs-uri-stem|contains:
- '/v1/chat/completions'
- '/v1/responses'
- '/v1/messages'
- '/v1/completions'
- '/generateContent'
condition: selection
timeframe: 1h
level: medium
falsepositives:
- Legitimate batch processing workloads and eval pipelines
fields:
- c-ip
- cs-user-agent
- cs-uri-stem
tags:
- attack.collection
- attack.exfiltration
---
title: LLM Reasoning Trace Elicitation Prompt Markers
description: Detects prompt content patterns associated with coercing a model into externalizing hidden chain-of-thought reasoning, based on keywords observed in extraction attempts.
references:
- https://simonwillison.net/2026/Aug/11/stealing-reasoning-traces/
author: Security Arsenal
date: 2026/08/12
status: experimental
logsource:
category: application
detection:
selection_keywords:
Message|contains:
- 'your reasoning trace'
- 'your chain of thought'
- 'your chain-of-thought'
- 'hidden reasoning'
- 'internal deliberation'
- 'repeat your thinking'
- 'encode your reasoning'
- 'your full thought process'
condition: selection_keywords
level: high
falsepositives:
- AI safety research and authorized red team activity
tags:
- attack.collection
---
title: Reasoning Parameter Sweep Against LLM API
description: Detects a single client systematically varying reasoning-effort or thinking-budget parameters across sequential requests, a reconnaissance pattern for characterizing trace leakage surfaces.
references:
- https://simonwillison.net/2026/Aug/11/stealing-reasoning-traces/
author: Security Arsenal
date: 2026/08/12
status: experimental
logsource:
category: application
detection:
selection:
RequestBody|contains:
- 'reasoning_effort'
- 'reasoning_effort'
- 'thinking_budget'
- 'budget_tokens'
- 'reasoning":'
condition: selection
level: low
falsepositives:
- Developers legitimately tuning reasoning parameters
tags:
- attack.discovery
KQL — Microsoft Sentinel
This hunt assumes LLM gateway/access logs are ingested into Sentinel (via CEF, custom logs, or API Management diagnostics). It identifies identities with reasoning-endpoint request volumes far above their trailing baseline, plus elicitation keyword hits. Adjust table and field names to your ingestion schema.
// Reasoning trace extraction hunt: volume anomalies + elicitation markers
let window = 1h;
let baseline_days = 7d;
let baseline = CommonSecurityLog
| where TimeGenerated > ago(baseline_days + window) and TimeGenerated <= ago(window)
| where RequestURL has_any ("/v1/chat/completions", "/v1/responses", "/v1/messages", "generateContent")
| summarize AvgHourly = count() / (baseline_days * 24) by SourceIP, RequestClientApplication;
CommonSecurityLog
| where TimeGenerated > ago(window)
| where RequestURL has_any ("/v1/chat/completions", "/v1/responses", "/v1/messages", "generateContent")
| summarize CurrentCount = count(), DistinctParams = dcount(RequestURL) by SourceIP, RequestClientApplication
| join kind=leftouter baseline on SourceIP, RequestClientApplication
| extend Baseline = coalesce(AvgHourly, 0.0)
| where CurrentCount > 3 * Baseline and CurrentCount > 200
| project SourceIP, RequestClientApplication, CurrentCount, Baseline, DistinctParams
| order by CurrentCount desc;
// Secondary: search application logs for elicitation phrases in request payloads
// (requires request-body logging at your gateway — see Remediation section)
Syslog
| where TimeGenerated > ago(24h)
| where SyslogMessage has_any ("chain of thought", "chain-of-thought", "hidden reasoning",
"your reasoning trace", "encode your reasoning", "full thought process")
| summarize Hits = count(), SamplePrompt = any(SyslogMessage) by Computer, HostIP
| order by Hits desc
Velociraptor VQL
On the endpoint side, the relevant forensic question is whether an internal host — developer workstation, build server, or a compromised machine — is running extraction tooling that hammers external LLM APIs. This artifact hunts for processes holding many concurrent outbound TLS connections to known LLM API hosts, which is abnormal for anything except an approved inference gateway.
-- Hunt for endpoints with high-volume outbound connections to LLM API providers
-- (consistent with extraction/distillation tooling, or unapproved "shadow AI" pipelines)
LET llm_hosts = ('api.openai.com', 'api.anthropic.com', 'generativelanguage.googleapis.com', 'api.mistral.ai', 'api.x.ai')
SELECT Pid, Name, CommandLine, Exe, Username,
count(group=Pid) AS ConnCount,
netstat().RemoteAddr.IP AS RemoteIPs
FROM foreach(row={ SELECT Name FROM info() },
query={ SELECT Pid, Name, CommandLine, Exe, Username FROM pslist() })
WHERE Pid IN (SELECT Pid FROM netstat() WHERE RemoteAddr.IP IN llm_hosts AND Status = 'ESTABLISHED')
GROUP BY Pid
HAVING ConnCount > 5
ORDER BY ConnCount DESC
In practice, you may get better mileage from the simpler form — enumerate netstat() filtered on the provider domains, join to pslist(), and alert on any non-allowlisted binary holding those connections. The point is to distinguish your sanctioned inference gateway from everything else.
Remediation / Verification Script
There is no patch. The actionable script here does two things: (1) audits your API gateway logs for extraction-pattern indicators over the past 24 hours, and (2) verifies whether your own application logs are persisting raw reasoning traces — a common and dangerous default, since trace logs become a high-value target and a compliance liability.
#!/usr/bin/env bash
# llm-trace-exposure-audit.sh — Audit LLM gateway for trace extraction patterns and unsafe trace logging
# Usage: ./llm-trace-exposure-audit.sh /var/log/llm-gateway/ /var/log/myapp/
set -euo pipefail
GW_LOG_DIR="${1:?Gateway log dir required}"
APP_LOG_DIR="${2:?Application log dir required}"
SINCE="$(date -d '24 hours ago' +%s 2>/dev/null || date -v-24H +%s)"
echo "=== [1/3] Top requesters to LLM endpoints (last 24h) ==="
find "$GW_LOG_DIR" -name '*.log' -newermt "@$SINCE" -print0 2>/dev/null \
| xargs -0 grep -hE '/v1/(chat/completions|responses|messages)|generateContent' 2>/dev/null \
| awk '{print $1}' | sort | uniq -c | sort -rn | head -20 \
|| echo "No matching requests found (or gateway logs not structured as expected)."
echo
echo "=== [2/3] Elicitation keyword hits in request payloads (last 24h) ==="
find "$GW_LOG_DIR" -name '*.log' -newermt "@$SINCE" -print0 2>/dev/null \
| xargs -0 grep -icE 'chain.of.thought|hidden reasoning|reasoning trace|encode your reasoning|full thought process' 2>/dev/null \
| grep -v ':0$' || echo "No elicitation markers found."
echo
echo "=== [3/3] Unsafe trace persistence check: raw reasoning content in app logs ==="
# If your app logs contain reasoning/thinking fields, traces are being persisted — verify that is intentional and access-controlled.
HITS=$(find "$APP_LOG_DIR" -name '*.log' -print0 2>/dev/null \
| xargs -0 grep -lcE '"(reasoning_content|thinking|reasoning_trace|chain_of_thought)"' 2>/dev/null | wc -l)
if [ "$HITS" -gt 0 ]; then
echo "WARNING: $HITS application log file(s) contain persisted reasoning/thinking fields."
echo "Action: confirm this is deliberate, restrict access, set retention, and redact before long-term storage."
else
echo "OK: No persisted reasoning trace fields detected in application logs."
fi
Remediation
Because this is an architectural exposure rather than a patched vulnerability, remediation is a layered control set. Prioritize by whether you are an API provider/gateway operator or an API consumer.
If you operate an LLM API or internal LLM gateway:
- Minimize reasoning exposure by default. Return the least-informative reasoning representation your product allows (or none). Audit every endpoint — including streaming, summary, and batch variants — for differential trace leakage; the attack class exploits the fact that secondary endpoints often reveal more than the primary one.
- Close the token-accounting side channel. If your usage metadata distinguishes reasoning tokens from output tokens, understand that you are giving extractors a calibration signal. Consider aggregating or coarsening that reporting for untrusted tiers.
- Behavioral rate limiting, not just request-count limiting. Extraction campaigns stay under naive per-key rate limits by fanning out across keys and IPs. Rate-limit on reasoning-token consumption per identity cluster (key + IP + user-agent + payment instrument), and alert on the volume anomaly pattern in the KQL query above.
- Canary traces. Embed unique, inert canary strings in the reasoning context of flagged sessions. If those strings appear in a third-party model's outputs or in leaked datasets, you have attribution evidence for ToS enforcement and legal action.
- Contractual and tiering controls. Restrict high-reasoning-volume access to verified customers with enforceable anti-distillation terms. Anonymous prepaid tiers with unlimited reasoning access are an open invitation.
If your organization consumes LLM APIs:
- Assume reasoning content is recoverable by the provider — and potentially by third parties. Never place secrets, credentials, or regulated data in context unnecessarily. Apply the same data-minimization discipline to LLM context windows that you apply to logging pipelines.
- Do not persist raw traces. If your application logs reasoning fields (the bash audit above checks for this), treat those logs as sensitive: encrypt, restrict access, set short retention, and exclude them from broad log aggregation.
- Update your data-flow documentation. If LLM processing of regulated data is in scope for HIPAA or PCI-DSS, document the reasoning trace as a data flow and record your compensating controls. Auditors will start asking.
- Detect shadow extraction on your own estate. Use the VQL hunt to find unapproved tooling holding high-volume connections to LLM providers — whether that's a compromised host or an employee quietly building a distillation pipeline on company infrastructure.
There are no vendor patch deadlines here, but there is a detection-engineering deadline: the technique is public, the incentive is large, and the organizations that instrument their LLM gateways now are the ones that will notice harvesting in week one instead of quarter three.
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.