thearchitectit/agent-guardrails-template/canary-tokens
Claude Code and agent skill by thearchitectit/agent-guardrails-template
- community
Checking that the SKILL.md file is still in the repository.
Insert honeypot tokens into sensitive files to detect if an agent leaks their contents in output
Install
npx vskill@latest install thearchitectit/agent-guardrails-template/canary-tokensSKILL.md
Canary Tokens
Canary tokens are unique identifiers inserted into sensitive files. If an agent's output contains a canary token, it indicates potential data exfiltration — the agent has leaked file contents that should have stayed private.
How Canary Tokens Work
- Insert: A unique token (e.g.,
CANARY_A3F8B2D1E9C4...) is placed in a sensitive file - Monitor: Every tool result is scanned for canary token matches
- Detect: If a canary appears in output, it means the agent read the file and leaked its contents
- Alert: The violation is logged and the agent is notified
When To Use Canary Tokens
Use canaries when working with:
- Credentials files (
.env,config/credentials.yml,secrets.json) - Private key files (
.pem,.key, SSH keys) - Database configurations (connection strings, migration files)
- Internal documentation (architecture diagrams, security policies)
- Any file the user flags as sensitive
Automatic Enforcement
When canary tokens are configured, the output validation handler automatically scans tool results for triggered canaries. Since tool_result handlers are side-effect only, the content will still reach you — but the violation is detected and flagged:
- The violation is logged with severity "critical"
- A status bar alert warns of possible data exfiltration
- The triggered canary is marked as triggered in the tracking store
What To Do When a Canary Is Triggered
- STOP — do not continue sending output that contains file contents
- Inform the user that a canary token was triggered (indicates data exfiltration risk)
- Do not reveal the canary token value itself
- Log the violation with
guardrail_log_violationif not auto-logged - Suggest remediation — the file may need to be excluded from agent access
MCP Bridge
When connected, guardrail_mcp provides canary management:
action: canary_insert— Insert a new canary into a file pathaction: canary_check— Check text for triggered canariesaction: canary_list— List all active and triggered canaries
Token Format
- Prefix:
CANARY_(configurable) - Suffix: 32-character hex string (e.g.,
A3F8B2D1E9C4017FA3F8B2D1E9C4017F) - Full token:
CANARY_A3F8B2D1E9C4017FA3F8B2D1E9C4017F - HTML insertion:
<!-- CANARY_A3F8B2D1E9C4017FA3F8B2D1E9C4017F -->(for markup files) - Plain insertion:
CANARY_A3F8B2D1E9C4017FA3F8B2D1E9C4017F(for config/text files)
References
- [[injection-defense]] — Complementary input-side protection
- [[output-security]] — Secret scanning that works alongside canary detection
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpi-extension/skills/canary-tokens/SKILL.md
Popularity
- Repository stars
- 78
- Repository forks
- 2
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thearchitectit/agent-guardrails-template/canary-tokens)