Please visit our companion website https://www.husncanary.com for an interactive, visual experience.
This research white paper from Ehab Hussein, IOActive Principal Artificial Intelligence Engineer and Mohamed Samy, IOActive Senior AI Security Consultant, presents the Husn Canaries defense-in-depth framework, a new standard for protecting organizational assets.
AI-powered coding assistants such as OpenAI Codex, Claude Code, GitHub Copilot, and similar tools are increasingly embedded in everyday software development workflows. While these systems can improve productivity, they also introduce a new class of governance and security challenges. Once source code leaves an organization via (for example) exfiltration, contractor access, or personal devices, organizations lack reliable visibility into whether and when that code is subsequently analyzed by cloud AI providers.
Existing solutions emphasize client-side enforcement approaches: IDE extensions, browser controls, network proxies, lifecycle hooks, and endpoint agents. However, these measures can be bypassed and provide no visibility into external attackers who paste stolen repositories into AI tools outside the organization’s perimeter.
We propose using Husn Canaries, a centralized detection and policy service in which organizations register hard-to-notice patterns already present in their codebases (e.g., tokens or comments, regular expressions, and intentionally placed signatures). Participating AI providers call the Husn API during code indexing and request handling. When Husn identifies pattern matches, it returns policy decisions (e.g., allow with logging, require approval, or block) and emits tamper-resistant alerts back to the organization.
Our contributions are as follows:
- A threat model for AI coding assistant misuse that covers internal developers, external contractors, and external attackers operating with stolen code.
- The design of a provider-side, pattern-based architecture that detects AI usage on sensitive code regardless of client configuration or user identity.
- A working proof-of-concept implementation using the Model Context Protocol (MCP) and Claude Code, demonstrating real-time enforcement and alerting.
- A discussion of limitations, security properties, and deployment considerations for multi-provider adoption.
By shifting detection to AI providers and leveraging hard-to-remove in-code patterns, Husn Canaries turns the AI ecosystem into a distributed early-warning surface for sensitive code.
A video demonstration of this concept can be found below
