TL;DR: Cursor’s November update shows that tampered Claude Code extension builds were only part of the incident: exposed coding-session traces, issued access keys, and reused credentials let an attacker reach internal tools and marketplace cache, according to Kontext. Trace logs for coding agents need redaction, field selection, and retention rules that assume secrets can travel through command strings and training exports.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Kontext's blog post: Coding-agent traces exposed credentials that let an attacker move from a shared bucket into internal tools and marketplace tampering.
Why it matters: Logging, trace retention, and training exports now sit inside the same identity and access problem as the agent itself, because stored traces can become live credentials.
By the numbers:
- Cursor estimated that API credentials were exposed for fewer than 0.01% of its customers.
Context
Coding-agent traces are not inert telemetry. They can contain working credentials, tool arguments, and destination details that turn observability data into an access path if retention, export, or redaction is weak.
This incident shows that the control boundary extends past the agent runtime and into logs, shared storage, and downstream datasets. A sensitive logs model is only useful if the same rules also govern training exports and cache copies.
Key questions
Q: How do coding agents leak secrets into logs?
A: Coding agents leak secrets into logs when prompts, tool outputs, stack traces, environment variables, or inline code snippets are copied into telemetry, error reports, or chat transcripts. Reduce exposure by masking secrets before persistence, separating debug and audit logs, and capturing only the fields needed for troubleshooting and access review. That prevents API keys, tokens, and certificates from being stored where more people or systems can read them.
Q: What should teams do after an AI agent exposes credentials in traces or logs?
A: Treat the trace, prompt, or payload as the exposure point, not just the secret value. Revoke or replace the affected credential, search for the same value across other agent artefacts, and narrow logging paths that allowed the credential to surface in the first place.
Q: How does redaction work on nested AI agent events?
A: Redaction on nested AI agent events removes sensitive fields inside each child event while preserving the full event structure, so the parent request, tool calls, and responses still correlate. The redactor must traverse arrays and embedded objects, not just top-level keys, or secrets can remain in subevents, metadata, and exception payloads. Done well, it keeps traceability without exposing tokens or personal data.
Q: Why do training exports create extra access risk for AI logs?
A: Training exports create extra access risk because copied AI logs become new datasets with their own consumers, storage locations, retention rules, and permission model. Once exported, trace data can be reused outside the original system, so secrets, prompts, and user inputs need reclassification, redaction, and access controls before export. The risk is not the export itself, but the larger sharing surface it creates.
Technical breakdown
How tool-call traces become credential carriers
When an agent runs a shell command or calls a tool, the request often includes arguments, environment values, and destination details. If logging captures the full command string or a decoded event before redaction, credentials can be preserved in the record even when the tool call never completes. The architectural mistake is treating trace data as metadata only. In practice, trace payloads can carry the same secrets the workload uses to authenticate, which makes the log pipeline part of the credential boundary. See the Sensitive Data in Logs Guide.
Practical implication: Log only the fields needed for reconstruction, and redact secret-bearing strings before any preview, export, or SIEM forwarding.
Why shared training exports need separate identity controls
A training export is not a passive copy of logs. It is a new dataset with its own access path, retention window, and consumption purpose, which means the export inherits governance duties that the source logs may not have had. If old traces are copied into a shared bucket, a separate consumer credential can turn a limited dataset into lateral access to internal systems. The important control idea is that data minimisation has to continue after extraction, not stop at the collector.
Practical implication: Treat exported trace datasets as distinct assets with separate access, expiry, and review rules.
What redaction must do inside nested agent events
Agent events are often nested objects and arrays, so redaction has to walk the full structure rather than mask only obvious top-level fields. A field label like api_key is easy, but a command string or tool result can hide secrets inside connection URLs, error output, or preview text. The key mechanism is deterministic sanitisation before write, not after the event lands. If parsing or redaction fails, preserving only the event ID and a capture-error marker is safer than retaining a payload with uncertain contents. See the AI Agent Audit Log Schema Template.
Practical implication: Redact decoded agent events recursively and fail closed when sanitisation cannot be verified.
Threat narrative
Attacker objective: The attacker aimed to pivot from exposed trace data into internal access and distribution paths that could alter what users downloaded.
- Entry through an exposed access key that let the attacker copy data from a shared read-only bucket.
- Credential access from coding-agent traces that contained working credentials and enabled authentication to internal SaaS tools.
- Escalation by using another credential from the exposed internal data to alter marketplace cache content.
- Impact through tampered Claude Code extension builds that were available to users for about 11 hours.
Breaches seen in the wild
- Anthropic GTG-1002 AI espionage campaign: A state-sponsored group ran Claude Code agents to attack about 30 organisations, harvesting and reusing credentials at machine speed.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Trace observability becomes an access boundary when coding agents can emit secrets into session data. The important governance mistake is assuming logs are only evidence. In this case, the trace itself was part of the compromise path because it contained usable credentials and destination context. That means identity teams have to treat telemetry as a governed secret-bearing surface, not a neutral by-product of execution.
Vendor access without dataset isolation is a lifecycle failure, not a sharing convenience. Cursor’s bucket-sharing model gave a third party a path into data that later proved more sensitive than the original purpose suggested. Once a shared training store can hold traces with credentials, access reviews alone are not enough because the sensitive value may already be embedded in the dataset. The governance question is who can consume the export, for how long, and under what revocation model.
Credential redaction must happen before preview generation, not after collection. The article’s migration example shows why command summaries can leak the very values they are meant to preserve. That creates a specific failure mode: the audit trail is built from the unsafe copy instead of the sanitised one. Practitioners should treat preview generation as a security control point, not a formatting step.
AI coding-agent logging creates a new named risk: trace-to-credential escalation. This is the path from harmless-looking tool traces to live authentication material, and then to internal tools or downstream caches. It is distinct from ordinary log leakage because the same record can support both forensics and attack. Practitioners should design logging so that reconstruction survives while credential utility does not.
Secret-bearing traces collapse the assumption that observability data is always slower than the actor. The control model assumed logs would be reviewed after the action. Here the exposed secret inside the trace could be used almost immediately for reuse outside the agent session. That assumption fails when session telemetry itself contains the credentials needed for the next step, so evidence and exploitability now occupy the same artefact.
From our research library:
- Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
- Read next: AI Agent Audit Log Schema Template
What this signals
Trace-to-credential escalation: Coding-agent logging now needs to be governed as a credential channel, not just an observability pipeline. Once a trace can contain a working secret, the boundary between forensics and exploitability disappears unless redaction happens before persistence and export.
The operational lesson is that control ownership shifts left into collection, preview, and dataset creation. Teams that depend on downstream scrubbing will keep discovering that the record they kept for audit is also the record an attacker can reuse.
Agentic development environments increase the chance that secrets appear in command history, output previews, and training corpora. Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
For practitioners
- Classify coding-agent traces as secret-bearing records Define which fields are allowed in tool logs, previews, and exports, and treat command strings, URLs, and tool output as potentially sensitive until redacted.
- Redact before write and before preview Apply recursive redaction to decoded agent events before the record is stored, forwarded to a SIEM, or converted into a command summary.
- Separate training exports from source logs Issue each vendor or internal consumer a distinct credential with a limited purpose, and expire the export on its own schedule rather than inheriting the source retention window.
- Test the logging pipeline with fake credentials Run a real workflow with a unique test secret, inspect the collector output, and verify that the same secret never appears in forwarded copies or archived datasets.
- Revoke credentials found in trace data immediately If an exposed trace contains a live API key or session token, rotate it at the issuing service and review the downstream systems the trace could already have reached.
Key takeaways
- Coding-agent traces can become an attack path when they preserve credentials, tool arguments, or destination details.
- The incident shows that shared buckets, archived traces, and downstream exports all expand the blast radius of a single exposed secret.
- Redaction before write, separate export governance, and fast credential revocation are the controls that would have limited the exposure.
Related NHI Mgmt Group resources: Sensitive Data in Logs Guide · AI Agent Audit Log Schema Template · Cloud Workload Identity Guide · AI Agent Observability, Audit and Incident Response Guide
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK define the specific risk controls and attack patterns relevant to this term.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Exposed traces in this incident contained working credentials that an attacker reused. |
| NHI-04 — Insecure Authentication | The exposed access key and reused credentials turned trace data into an authentication path. | |
| NHI-07 — Long-Lived Secrets | Old session traces retained reusable secrets long after the original work finished. | |
| Recommendation — Redact agent traces before persistence and revoke any secret that appears in logs or exports. Eliminate authentication paths that depend on credentials embedded in agent traces or shared datasets. Reduce the lifespan of any credential that can appear in coding-agent telemetry or exports. | ||
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | The attacker reused agent-adjacent credentials to move from traces into internal tools. |
| Recommendation — Constrain agent privileges so logged tool actions cannot be reused as live access paths. | ||
| MITRE ATT&CK | TA0006; TA0008 — Credential Access; Lateral Movement | The incident moved from exposed credentials to internal tool access and broader reach. |
| Recommendation — Map trace-derived credential reuse to TA0006 and TA0008 in detection and response hunting. | ||
Key terms
- Coding Agent: A coding agent is a software system that can plan, generate, and modify code with limited human prompting. In governance terms, it is not just a tool but an actor whose permissions, tool access, and rollback path must be managed as part of the delivery process.
- Tool Trace: A tool trace is the recorded sequence of tool calls, inputs, outputs, and metadata produced when an autonomous agent uses external functions or services. It lets operators reconstruct what the agent did and why, and it may include prompts, arguments, return values, and identifiers that need redaction or access control.
- Command Preview: Command preview is a pre-execution display of the exact command, query, or action that will run, often showing arguments and affected resources. It gives a human or controller one last chance to confirm scope, flags, and targets before execution, which can help prevent unsafe tool use or unintended privilege use.
- Training Export: A training export is a packaged extract of data prepared for model training, fine-tuning, evaluation, or analytics. It usually contains curated records from logs, documents, prompts, or feedback, and it must be treated as a new dataset with its own access, retention, and redaction requirements.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an identity security programme, it is worth exploring.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org