Google reckons it can tell when an online attack originates from a government, and is to start alerting Gmail users when it happens.
They'll see a warning reading: "We believe state-sponsored attackers may be attempting to compromise your account or computer," and be prompted to change passwords and take other steps to secure their accounts.
The company says it can't reveal how it knows that a particular piece of malware is state-sponsored.
"When we have specific intelligence — either directly from users or from our own monitoring efforts — we show clear warning signs and put in place extra roadblocks to thwart these bad actors," says VP of security engineering Eric Grosse.
"We can’t go into the details without giving away information that would be helpful to these bad actors, but our detailed analysis — as well as victim reports — strongly suggest the involvement of states or groups that are state-sponsored."
The move will be welcomed by human rights groups, who claim they are frequently targeted by governments including those of China, Russia and countries in the Middle East.
It'd be interesting to see, though, whether Iranian utility workers will see the warning when they're hit by the recently-discovered Flame malware - widely believed to have been created by the US and Israeli governments.