What Is Cairn? The AI Pentesting Framework Attackers Use
Cairn is an open source AI pentesting framework that chains autonomous agents toward a goal. Learn how it works, who abuses it and what to log.
Cairn is an open source AI pentesting framework that takes a starting point and a goal written in plain language, then coordinates several AI agents to search for a path between them. Its author built it for defenders and competitions. During 2026 it has appeared in at least two documented intrusion campaigns, including the one in which agents found and exploited a MONAI Label zero-day against university servers. This article explains how the framework works, why attackers adopted it and what its activity looks like from the target's side.
What is Cairn?
Cairn is a general purpose problem solving engine published on GitHub by a developer known as oritera. It treats penetration testing as a search through an unknown state space: the origin is a target address, the goal is a condition such as getting a shell, and the path between them is what the agents have to find.
The project's own README says it defines no roles and no workflows. It was validated at the second edition of the Tencent Cloud Hackathon AI Penetration Testing Challenge, where the team reports solving all 54 problems and finishing third in a field of 610 teams. The README adds that the full pipeline came online for the first time on race day, with no domain specific tooling, no retrieval augmentation and no predefined agent roles. That detail matters for defenders: the capability did not come from a curated exploit library. It came from general models given a search structure.
How does Cairn work?
Cairn keeps a shared board of facts, intents and hints. Worker agents read the whole board, decide what to explore next, carry out that exploration and write the result back as a new fact, repeating until the goal is marked complete or the operator stops them.
The README describes three primitives. A Fact is a confirmed finding, such as an open port, an identified framework or a parameter that accepts traversal sequences. An Intent is a declared direction of exploration that nobody has executed yet. A Hint is human judgment injected at any time, which agents absorb on their next read of the board. Workers run an observe, orient, decide, act loop and coordinate only through the board. There is no direct agent to agent messaging.
Three task types cover everything. Bootstrap attempts to solve the problem directly when a project starts. Reason reads the full graph and decides whether the goal is met and what should be explored next. Explore claims one intent, executes it and reports one fact. The same worker code runs all three.
The deployment has three parts. The Cairn Server holds the graph. The Dispatcher reads it, schedules tasks and starts a worker container per project, with several agents running concurrently inside. Supported worker backends are Claude Code, Codex and Pi, and a local mode lets workers reuse whatever model CLIs are already logged in on the host, so the operator needs no API keys in the configuration. Under the default Docker Compose setup the server listens on port 8000. The framework supplies the search discipline; the operator supplies the model.
Why do attackers use Cairn?
Attackers use Cairn because it converts a one line goal and a target list into hours of unattended, adaptive attack activity for the price of a model subscription. The operator does not need to know the techniques, because the agents choose, try and discard them on their own.
Amazon Threat Intelligence's November 2026 report shows what that looks like. The operator wrote variations of "obtain shell access" and supplied university IP addresses. Against an unauthenticated Redis instance, the agents ran 148 sequential actions over roughly 16 hours, working through replication abuse, scripting sandbox escapes, configuration writes and memory corruption, then pivoted to a Log4Shell probe on a neighbouring service, a server-side request forgery in a co-located Qdrant instance and credential sprays against PostgreSQL and SSH. Against a GPU server, a separate six hour operation built a list of about 80 real usernames from faculty directories, lab pages, archived sites and papers, then tested more than 30,000 credential combinations against SSH, an admin dashboard, network storage, a VPN and the campus portal. Both failed. Against a MONAI Label server, the agents mapped the API and reached arbitrary file write in about 11 minutes.
Gambit Security documented a different, financially motivated operator using Cairn in September. The Register reports at least 105 attacks and at least 27 companies compromised to varying degrees, including a Fortune 500 hospitality company and a major US airline. Amazon's conclusion is that the framework is now in use for both espionage and crime.
One more point from Amazon's case: the operator left the Cairn server itself on the internet with no authentication, which is how investigators read the entire campaign history. Operators of these tools are often careless about their own infrastructure, and exposed control panels are a real detection opportunity for researchers.
What Cairn activity looks like to a defender
- Long, unbroken sessions against one service. The Redis operation ran 16 hours without a pause, cycling through the published techniques for that service in order. Human attackers take breaks and change targets; agents keep going.
- Lateral pivots across co-located services. When one path fails, the board still holds every fact about the host, so the next intent targets a neighbouring service: a Java application, a vector database, a database login.
- Username lists that match your public directory. The GPU server spray used names scraped from faculty pages and academic papers. If your authentication logs show failures against real accounts in the order they appear on your website, that is agent reconnaissance.
- API enumeration followed by parameter testing. The MONAI Label compromise started with identifying the framework and mapping endpoints. Bursts of requests to many distinct API paths from one client, followed by PUT requests with odd parameter values, are the pattern.
- No working hours. Timestamps in the executed scripts were set to China Standard Time, but the sessions ran continuously, so time of day is not a useful filter.
How should defenders respond?
Amazon's advice is to prioritise high confidence detections that trigger automated response, with humans overseeing outcomes rather than approving each action. An agent that reaches file write in 11 minutes will beat a manual triage queue. The practical version for most teams is automated isolation of a host that opens outbound connections to new destinations or produces an authentication failure storm, with a human reviewing the isolation afterwards.
The other half is attack surface. Two of the three operations in Amazon's report failed, against a Redis instance that resisted every technique and a GPU server with no weak credentials. The one that succeeded hit software with authentication off by default running as root. Hardening still works against autonomous agents; they simply find the softest system faster. For the specific case, see how to secure a MONAI Label server, and for the broader pattern, why research lab servers need production security rules.