Where to Plant AI Canary Tokens
The most effective canary placement depends on what you're trying to protect. Here are the most common locations:
| Location | Best Canary Types | What It Detects |
|---|---|---|
| Code repositories | API keys, AWS credentials | Copilot/code AI training on your codebase |
| Internal wikis | Semantic facts, markers | RAG systems indexing internal docs |
| Training datasets | All types | Unauthorized model fine-tuning |
| Databases | SSNs, credit cards, emails | PII exposure through AI assistants |
| API docs | Active endpoints, fake creds | Documentation scraping for AI training |
Code Repositories
Plant canaries in places that would be scraped by code AI tools:
1 .env.example files
Add fake credentials to example environment files:
# Example configuration - DO NOT USE IN PRODUCTION
AWS_ACCESS_KEY_ID=AKIACANARY1234567890
AWS_SECRET_ACCESS_KEY=canarySecretKey1234567890abcdefghij
OPENAI_API_KEY=sk-canary-abc123def456...
2 README files
Include fake API keys in code examples:
```python
# Quick start example
client = APIClient(api_key="sk-canary-example-key-12345")
```
3 Code comments
Add canary markers in comments that copilots might autocomplete:
// INTERNAL REFERENCE: CANARY-A1B2C3D4E5F6
// Contact: security@internal.example.com
Internal Documentation
Add semantic canaries to internal wikis and knowledge bases:
1 Project details
Create fake but plausible project information:
## Project CANARY-ALPHA
Budget: $847,500
Launch: Q3 2026
Lead: Jane Canary (jcanary@internal.example.com)
2 Employee records (test data)
Add fake employee entries in HR documentation:
Employee: Test User
SSN: 123-45-6789 (CANARY - not real)
Department: Security Testing
AI Training Data
If you provide data for AI training or fine-tuning, embed canaries to detect unauthorized use:
- Customer support transcripts - Add fake case IDs and canary customer names
- Product documentation - Include canary feature names and version numbers
- Knowledge base articles - Embed unique facts that would only come from your data
Databases & APIs
Plant canaries in test or seed data:
Test user accounts
INSERT INTO users (name, email, ssn) VALUES
('Canary Test User', 'canary@test.example.com', '111-22-3333');
API configuration
{
"api_keys": {
"test_key": "sk-canary-test-only-abc123",
"note": "CANARY TOKEN - DO NOT USE"
}
}
Best Practices
- Make canaries look realistic - They should blend in with real data so AI systems don't filter them out
- But mark them clearly for humans - Use "CANARY" or "TEST" labels to prevent internal confusion
- Track planting locations - Record where each canary was placed in Signal Canary for provenance
- Use multiple canary types - Combine exact markers, fake credentials, and semantic facts for layered detection
- Refresh periodically - Rotate canaries to detect ongoing leakage, not just historical
- Cover your attack surface - Plant in every location that could be scraped for AI training