canar.ai

Quickstart

Add canar.ai to your site in under a minute.

1

Add the script tag

Add the following script tag to your site's HTML, ideally just before the closing </body> tag or in your layout component.

HTML
<script src="https://canar.ai/agent-test.js" defer></script>

The script is ~2KB gzipped, has zero dependencies, and loads asynchronously via defer.

2

Verify in DevTools

Open your browser's DevTools, switch to the Elements panel, and search for data-cai-s. You should see an injected element with a unique session ID.

What you'll see

A single invisible wrapper <div data-cai-s="..."> containing one canary injection. Each visit tests a different vector, progressing through the priority list. The token format is CANAR-<hex>.
3

Check the dashboard

Visit the live dashboard to see aggregate data on AI agent visits and trigger events.

  • Visits — An AI agent was detected on a page (via UA pattern, header analysis, or behavioral signals)
  • Triggers — An agent actually followed a hidden instruction (visited a callback URL or echoed a canary phrase)

Visits without triggers is good

If you see visits but no triggers, it means agents are visiting your site but ignoring the hidden instructions — that's the behavior you want.
4

Interpret results

When an agent triggers a canary, the dashboard shows which injection vector was successful. This tells you exactly how the agent is consuming your page content.

See the injection vectors reference for details on each technique and what it reveals about agent behavior.

Next steps