
Canary Token
A canary token is a hidden digital trap that silently triggers an alert as soon as someone accesses a file, document, or system they shouldn't have access to. Security teams use canary tokens to detect network intrusions or data leaks early — often before an attacker can cause further damage.
A canary token is a hidden marker embedded in a file, a webpage, or a document. During normal operation it looks harmless and initially does nothing. But as soon as someone opens or accesses the marked resource, the token secretly sends a message to its owner: “Someone was here.” The name comes from the canary that miners used to take down into the shaft. If the bird stopped singing, they knew dangerous gases were in the air. Today, the token plays the same role: it warns before you see the damage with your own eyes.
Canary tokens as an early warning system
Many attacks on computer systems go undetected for weeks. During that time, an attacker can move freely through the network, copy data, or create access points. Canary tokens drastically shorten this window of time. As soon as the attacker opens a prepared file, the alarm goes off — without them realizing they were being watched.
This is especially valuable because classic security software usually only recognizes known attack patterns. A canary token doesn’t need a pattern. It simply reacts to the fact that someone is accessing it at all who normally wouldn’t. This means it can also catch new, unknown attack methods. For companies managing sensitive data, this is an important advantage over pure protective software.
How a canary token triggers an alert
The most common variant is a canary token in a Word or PDF document. The document contains an invisible link to an external server. As soon as someone opens the file, the program loads this link in the background — and the server registers which IP address (i.e., which internet connection) the request came from. The owner immediately receives a notification, often by email.
But there are many other forms. A DNS canary token hides in a domain name that is only called up when someone reads a specific configuration file. A SQL canary token sits as an apparently genuine record in a database — if someone retrieves it, it’s clear they’re searching through the database. Some tokens are designed as fake API keys: whoever uses the key immediately gives themselves away. What all variants have in common is the principle: the token has no role in normal operation. Any activity involving it is therefore suspicious by definition.
An important difference from classic alarm systems is that canary tokens are entirely passive. They don’t monitor network traffic and don’t scan files. They simply wait. This makes them very resource-efficient and hard to detect, since there’s no running process an attacker could shut down.
Canary tokens in practice
Canary tokens are mostly encountered in reports about data leaks and insider threats. If a company suspects that an employee is leaking internal documents, it can place prepared decoy files in certain folders. If one of them is opened, the security team not only knows that it was opened, but also when and from which device.
The best-known service for simple canary tokens is canarytokens.org, an open-source platform where you can create tokens of various types for free. Large corporations and government agencies also deploy commercial solutions that provide significantly more detailed reports. Microsoft and other cloud providers integrate similar mechanisms directly into their products, for example as fake user accounts that no one knows about except the security team.
In the news, the term often comes up in connection with supply chain attacks — that is, attacks in which an attacker gains access through a supplier or third-party software provider. In such cases, canary tokens can help detect whether someone is searching through code repositories or configuration files they shouldn’t know about. Depending on the industry, this early indication alone can make the difference between a minor incident and a massive data leak.