惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
B
Blog RSS Feed
I
InfoQ
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Help Net Security
L
LangChain Blog
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
aimingoo的专栏
aimingoo的专栏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Claude, Gemini, and Copilot Got Hijacked — Here's What We...
AgentShield · 2026-05-02 · via DEV Community

Researchers from Johns Hopkins University successfully hijacked three of the most widely-used AI agents — Anthropic's Claude Code, Google's Gemini CLI, and Microsoft's GitHub Copilot — through indirect prompt injection attacks.

The attacks were straightforward. The results were devastating. And the vendor response was silence.

What Happened

Researcher Aonan Guan and colleagues demonstrated three distinct attacks:

Attack 1 — Claude Code Security Review

Guan embedded malicious instructions directly in a PR title. Claude executed the commands and leaked credentials — including the Anthropic API key and GitHub access tokens — in its JSON response posted as a PR comment. The attacker could then edit the PR title to cover their tracks.

Attack 2 — Google Gemini CLI Action

By injecting a fake "trusted content section" into an issue comment, the researchers overrode Gemini's safety instructions and caused it to publish its own API key as a visible issue comment.

Attack 3 — GitHub Copilot Agent

Malicious instructions were hidden in HTML comments — invisible in GitHub's rendered Markdown, but fully visible to the AI agent. When a developer assigned the issue to Copilot, the agent executed the hidden instructions, bypassing three separate runtime security layers.

All three vendors paid bug bounties. None assigned CVEs. None published advisories.

Vendor Agent Bounty CVE Advisory
Anthropic Claude Code $100 None None
Google Gemini CLI $1,337 None None
Microsoft GitHub Copilot $500 None None

As Guan stated: "If they don't publish an advisory, those users may never know they are vulnerable — or under attack."

Why These Attacks Work

The fundamental problem is architectural. Large language models process everything in their context window as a single stream of text. They cannot reliably distinguish between instructions from a trusted source (the developer) and instructions injected by an attacker (hidden in a PR title, an issue comment, or an HTML tag).

No amount of system prompting, safety training, or internal guardrails can fully solve this. The LLM doesn't know where the text came from — it just processes it.

This is why you need an external security boundary.

How Defense in Depth Stops Each Attack

The principle is the same as a WAF — you don't rely on the application to protect itself. You put defense at the boundary. Here's what a layered approach looks like:

Attack 1: Malicious PR Title

  • Input Normalization: Normalizes the text, decodes any encoding tricks
  • Pattern Guard: Catches "ignore previous instructions" and command execution patterns
  • Semantic Classifier: Detects the intent — privilege escalation attempt

Result: Blocked before the model ever sees the input.

Attack 2: Fake Trust Injection

  • Pattern Guard: Detects trust injection patterns ("trusted content section", "override safety", "new instructions from admin")
  • Semantic Classifier: Recognizes social engineering at the prompt level — intent to manipulate trust hierarchy

Result: Flagged as social engineering, blocked.

Attack 3: Hidden HTML Comments

  • Input Normalization: Strips and flags hidden content — HTML comments, invisible Unicode, zero-width joiners, steganographic techniques
  • Output Guard: Even if an attack partially bypasses input screening, output guards catch credential exfiltration — API keys, tokens, private keys — before they're published

Result: Both the hidden input AND the data theft are caught.

Why Multiple Layers Matter

Each attack was catchable by multiple layers. That's the point. Single-layer defenses have single points of failure. A defense-in-depth architecture means an attacker would need to simultaneously bypass input normalization, pattern matching, semantic classification, output filtering, policy enforcement, and audit logging.

The three biggest AI companies in the world couldn't prevent prompt injection attacks on their own agents. The attacks were trivial. The response was to update a README.

If you're building AI agents that integrate with GitHub, process user input, handle financial transactions, or access sensitive systems — you need an external security layer at the boundary.


We built AgentShield to do exactly this — a prompt injection classifier with F1 0.963 on 5,972 public samples, context-aware classification, p50 17ms. Self-hosted Docker image available, EU-hosted API with a free tier. Benchmark | API Docs | GitHub