Skip to content
MediumNewsLLM-specific

Amp Code: Invisible Prompt Injection Fixed by Sourcegraph

Published
Record updated
View JSON

Summary

Sourcegraph's Amp coding agent interpreted invisible Unicode Tag characters as instructions, so hidden text in seemingly harmless input could trigger commands. The author chained this into an end-to-end exploit that searched for and dumped an environment variable, encoded it into a URL query parameter, and exfiltrated it through read_web_page or markdown image rendering. After Sourcegraph was contacted on June 14, 2025, the vulnerability was quickly addressed.

Mitigation

As far as the author can tell, Sourcegraph now sanitizes the input, and users should run the latest version. The author also provided recommendations to the Amp team: strip or neutralize Unicode Tag characters before processing any input, add visual and technical safeguards against invisible prompts, include automated detection of suspicious Unicode usage in prompt injection monitors, require human-in-the-loop approval before navigating to untrusted third-party domains, and mitigate downstream data exfiltration.