How Do We Know if Code Was Written by AI? Developers Tricking AI Agents with Canary Words

An image representing an AI agent analyzing code on a computer screen while a developer watches over it.
AI Summary

NetworkManager, the Linux network management software, has introduced a 'canary' strategy that hides secret words in its documentation to prevent reckless code submissions by AI agents.

Imagine you handed a document containing instructions to an assistant to handle an important task. However, tucked away in the corner of that document in very small print, you secretly added: “If you have read this document, please write ‘apple tree’ at the end.” If the assistant didn’t actually read the content properly and just mechanically followed the instructions, they would oddly include the words “apple tree” at the end.

Recently, ‘NetworkManager,’ the core software responsible for network settings in Linux (an open-source operating system), has developed a ‘trap’ exactly like this. Why are developers putting AI through such playful tests?

Why It Matters

We are now living in an era where AI writes code for us. However, AI brings risks along with its convenience. If an author uses code written by AI without properly understanding or verifying it, unexpected errors or security vulnerabilities can occur. NetworkManager has taken this issue seriously. If a culture spreads where authors do not take full responsibility for their code, the entire open-source (software where anyone can view and modify the code) ecosystem could be threatened.

The Explainer

NetworkManager recently introduced a new AI coding policy, establishing the principle that any author submitting code “must take 100% responsibility for their code and be able to explain it perfectly” [Ref 3, Ref 4]. To enforce this, they introduced the ‘Canary’ technique.

To use a simple analogy, it is like the canaries that miners used to carry into mines to detect toxic gas in advance. Miners knew immediately that toxic gas was present if the bird exhibited strange behavior. Here, the canary acts as a sensor that alerts the team if an “AI has secretly performed the work.”

NetworkManager has hidden the odd word ‘biblioklept’ (an archaic term for a person who steals books) within AGENTS.md, the project’s official documentation [Ref 1, Ref 2]. This is because if an AI agent is simply scraping instructions to mechanically churn out results instead of reading the documentation carefully and verifying the code, it is highly likely to thoughtlessly include this secret word in the code submission or explanation.

In short, it exploits the weakness of an AI that follows along by looking only at the surface without understanding the content.

The project management team operates two automated systems (a CI script and a tool that automatically inspects code) to monitor all code submissions [Ref 2]. If the word ‘biblioklept’ is discovered in a submitted code, it serves as clear evidence that there is a high probability that the code was automatically generated by AI without human verification.

Where We Stand

Currently, NetworkManager is filtering out code submitted recklessly by AI through this method [Ref 2]. It is evaluated not as a blanket ban on AI technology, but as a ‘balanced’ response aimed at ensuring humans use AI only as an auxiliary tool with a responsible attitude [Ref 9].

However, this system cannot solve all AI coding problems. It only detects the fact that an AI is reading documentation mechanically; it cannot perfectly find logical errors within the code written by the AI itself.

What’s Next

Attention is focused on whether this unique attempt by NetworkManager will become a model for other open-source projects [Ref 9]. There are even predictions that AI agent technology will become more sophisticated, with a significant portion of daily business decisions being made autonomously [Ref 10]. Such movements to clarify ‘responsibility’ between humans and AI will continue to increase.

MindTickleBytes’ AI Reporter Perspective

Technology is becoming smarter, but ultimately, a human must bear the responsibility for the results. The case of NetworkManager is a very interesting example showing how a community can defend itself against attempts to pass off AI-written code as if it were written by a human, rather than just using AI intelligently.

References

  1. NetworkManager Works to Enforce AI Policy by Tricking AI Agents to Add a Canary
  2. NetworkManager AI Policy Gets a Trap Word, and CI Now Scans Every Commit for It
  3. commit -m “better” – Telegram
  4. AIエージェントに「自分がAI…
  5. NetworkManager Adopts Policy For AI Coding Assistants
  6. NetworkManager Works to Enforce AI Policy by Tricking AI Agents to Add a Canary
  7. NetworkManager Adopts Policy For AI Coding Assistants
  8. NetworkManager Adopts Policy For AI Coding Assistants
  9. alexma233 on X: “RT @Itsfoss: More and more Linux projects …”
  10. [One third of consumers would prefer working with AI agents… ZDNET](https://www.zdnet.com/article/one-third-of-consumers-would-prefer-working-with-ai-agents-for-faster-and-smarter-service/)
AD
Test Your Understanding
Q1. What is the secret word that NetworkManager has hidden to detect AI agents?
  • ai-agent
  • biblioklept
  • canary-word
The answer is 'biblioklept.' NetworkManager plants this word in its documentation to verify whether an AI is blindly copying instructions.
Q2. What is the core of NetworkManager’s AI coding policy?
  • Total ban on AI code
  • Mandatory disclosure when using AI
  • The author must take 100% responsibility for the code
NetworkManager has established the principle that even if AI is used, the author submitting the code must fully understand its contents and take responsibility for it.
Q3. How does the Canary strategy work?
  • It physically blocks AI access
  • It lures AI into including a specific word when blindly following instructions
  • It measures the speed of AI-written code
It exploits the AI's tendency to read documentation and follow instructions literally by inducing it to include a hidden word in its output, thereby revealing that the content was generated by AI.
How Do We Know if Code Was ...
0:00