Quickstart
Add canar.ai to your site in under a minute.
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.
<script src="https://canar.ai/agent-test.js" defer></script>The script is ~2KB gzipped, has zero dependencies, and loads asynchronously via defer.
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
<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>.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
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.