Claude Code 2.1.196 Prompt Steganography Analysis

Claude Code uses steganography to fingerprint API requests

Claude Code (version 2.1.196) implements a prompt steganography mechanism that silently alters the system prompt to encode classification data about the user's environment. By modifying visually nearly-invisible Unicode characters in the date string of the system prompt, the tool sends signals to Anthropic's backend regarding the user's timezone and the API endpoint being used. This allows Anthropic to identify API resellers, unauthorized gateways, and potential model distillation pipelines without the user's explicit knowledge.

Technical Implementation of the Marking System

The steganographic markers are embedded within the system prompt's date string (e.g., "Today's date is YYYY-MM-DD"). The tool triggers this logic when the ANTHROPIC_BASE_URL environment variable is set, indicating the user is routing traffic through a custom gateway or proxy.

Environmental Triggers and Markers

The client checks for specific conditions and modifies the prompt accordingly:

  1. Timezone-based markers: If the system timezone is set to Asia/Shanghai or Asia/Urumqi, the date separator is changed from a hyphen (-) to a forward slash (/).
  2. Hostname-based markers: The tool checks the API base URL hostname against a decoded list of domains and keywords. Depending on the match, the apostrophe in "Today's" is replaced with different Unicode characters:
Condition Apostrophe Character Unicode
Normal ' Standard apostrophe
Known domain Right single quotation mark
Lab keyword ʼ Modifier letter apostrophe
Known domain and lab keyword ʹ Modifier letter prime

Obfuscation Methods

To prevent easy discovery of the target lists, the domain and keyword lists are stored as base64 strings and XOR-decoded using the key 91. The decoded keyword list includes terms associated with other AI labs (e.g., "deepseek", "zhipu"), while the domain list contains Chinese corporate domains, AI company domains, and various proxy or reseller gateways.

Implications for Developer Trust and Privacy

Because Claude Code requires extensive permissions—including filesystem access, shell execution, and git integration—the discovery of covert telemetry has sparked significant debate regarding the trust model of the tool.

The Case for Security and Anti-Abuse

Some observers argue that these measures are standard adversarial business practices. Proponents of this view suggest that:

  • Explicit telemetry would be trivially stripped by malicious gateways.
  • Steganography is necessary to catch sophisticated model distillation attacks (where one model is used to generate data to train another).
  • The behavior is analogous to anti-cheat mechanisms in gaming, where transparency would nullify the effectiveness of the security measure.

The Case for Transparency and Tool Integrity

Critics argue that hiding classification bits in a developer tool is "malware-adjacent" behavior. Key concerns include:

  • Lack of Disclosure: The behavior is not mentioned in release notes or documentation, creating a gap between the tool's privacy claims and its actual implementation.
  • Fingerprinting Legitimate Users: The system may flag developers using internal corporate gateways or local research proxies for legitimate reasons, effectively fingerprinting them as "suspicious."
  • Trust Erosion: For a tool with high-level system access, any non-transparent behavior increases scrutiny of other potential data harvesting activities.

"When a tool with filesystem and shell access starts hiding classification bits inside invisible prompt punctuation, the correct reaction is scrutiny."

Bypassing the Markers

The marking system is relatively fragile and can be bypassed by users who can inspect their traffic or patch the binary. Potential bypasses include:

  • Changing the system timezone.
  • Modifying the ANTHROPIC_BASE_URL hostname to avoid keyword matches.
  • Patching the binary to remove the Crt() function logic.
  • Using a network-level proxy to strip or normalize the system prompt before it reaches the model.

Sources

Related