Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The AI Canary Test: Stop Your Assistant From Trusting the Whole Repo

Описание и применение

Тест «канарейка» позволяет проверить, ограничивает ли AI доступ к репозиторию, предотвращая чтение устаревших или ложных файлов и экономя токены.

Задача

AI assistants often read entire repositories, trusting all content, including outdated or false information, leading to incorrect answers and token overuse.

Результат

The canary test reveals whether an AI assistant respects scoped context. By planting a false fact and observing the assistant’s response, developers can enforce token budgets and prevent the assistant from accessing unintended files.

Рабочий процесс

  • 1. Create a hidden file .ai-context/canary.md with a false claim and do not commit it.
  • 2. Ask the assistant a question that can be answered only by reading the canary file to test scope.
  • 3. Build a scoped prompt using scoped-prompt.sh, providing goal, current diff, and whitelisted files within a token budget.
  • 4. Run the script to generate a prompt that excludes the canary file.
  • 5. Send the generated prompt to an OpenAI-compatible endpoint via curl and jq.
  • 6. Verify the assistant responds with uncertainty instead of the false claim.

Доказательства

A canary is a small lie planted in the repo. It lives in a file the assistant should never need.

Источник

Feed the assistant only three things: the goal, the current diff, and whitelisted files.

Источник

  • Дата записи: 2026-09-08T13:45:40.163Z