Amp Code: Invisible Prompt Injection Fixed by Sourcegraph
- Published
- Record updated
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.
Topics
Related items
- LowSignal joins United Airlines, banks in limiting AI agents over customer risksSame vendor · CNBC Technology
- InfoOpenAI and Cisco Unveil AI-Assisted Linux Security Tool to Block Exploits Before PatchingSame vendor · The Hacker News
- InfoOpenAI and Cisco introduce ShirudoSame vendor · OpenAI Blog
- InfoClaude AI can review pull requests and ship fixes on its own nowSame vendor · The Verge (AI)
- InfoA legendary philosopher isn’t buying Anthropic’s consciousness argumentSame vendor · MIT Technology Review