LIVE
All stories ›
AI IN LIFENEWS
Tools & AppsBusiness & DealsAI ModelsSocietyChips & ComputeResearchSafety & SecurityRegulation & PolicyRobotics OpenAIAnthropicGoogle & DeepMindAlibaba / QwenxAIMetaByteDance
HomeAnthropic › TOOLS
TOOLS

Cain: AI pentest agent spans six cloud providers

Built on the Claude Agent SDK, the open-source Cain agent ships 46 read-only tools and audits AWS, Azure, GCP plus three Chinese clouds.

Cain: AI pentest agent spans six cloud providers
Symbolic image: an open server rack in a test lab, monitors showing an abstract node graph alongside it, while someone plugs in a console cable.

In short

Cain is an open-source agent built on the Claude Agent SDK that runs authorized penetration tests across six cloud platforms using 46 strictly read-only tools.

At a glance

  • Runs on the Claude Agent SDK; a pi bridge adds OpenAI, Gemini, DeepSeek and OpenRouter, and needs Node.js 20 or newer.
  • 46 built-in tools, all read-only; POST, PUT, DELETE and aws rm/mv/cp calls are rejected before they execute.
  • Clouds covered: AWS, Azure, GCP, Alibaba Cloud, Tencent Cloud, Huawei Cloud.
  • The target lives in scope.yaml; a PreToolUse hook blocks any tool call aimed outside it.
  • Apache-2.0 license; 915 stars, 201 forks and 324 commits at the time the repo was read.

Cain is an open-source agent built on the Claude Agent SDK that runs authorized penetration tests across six cloud platforms using 46 strictly read-only tools. The repository, published by cdxiaodong, positions the agent against real engagements rather than practice labs: the stated targets are business-logic flaws, authentication chains and cloud misconfigurations.

The read-only promise is enforced in code

The 46 tools are grouped into recon, scan, verify, post and report. Each carries its own blacklist of dangerous flags, and the project states that write, exploit and persistence operations — POST, PUT, DELETE, aws rm/mv/cp and similar — are rejected before execution. Scope is not a line in a prompt: the target is written into scope.yaml, and a PreToolUse hook blocks any tool call whose target falls outside it. That moves the boundary decision from the model to the configuration file.

Discovery and validation never share context

Findings are produced in one agent session and judged in a separate one, with no shared context, so a result cannot confirm itself. Verdicts come back as structured output with four states. The pipeline is fixed — recon, then test, then report — and state is kept in workspace files, so an interrupted run can resume. Credentials are redacted before anything is written to disk.

Why the Chinese clouds matter here

Coverage spans AWS, Azure, GCP, Alibaba Cloud, Tencent Cloud and Huawei Cloud, and the project treats the last three as its distinguishing feature: most offensive tooling stops at the big three. A dedicated module builds a privilege-escalation graph for IAM and RAM, mapping identities to escalation actions to targets, exports it as DOT or JSON, and walks it with breadth-first search. Claude is the default backend; the pi bridge routes to OpenAI, Gemini, DeepSeek, OpenRouter or an Anthropic-compatible gateway, and recon and test phases can use different providers and models.

The benchmark is self-reported

Reports in the repository, dated August 26, 2026 and August 31, 2026, score the agent against the vulnerable-terraform test set:

Test caseExpectedDetectedFalse positives
Public OSS bucket110
Over-granted RAM policy220
RAM user with AdministratorAccess550

That is three cases and eight expected findings in total, measured by the project against templates it selected — not a comparison with competing scanners and not a third-party assessment.

What could not be checked

The repository was the only readable source for this report: there is no independent coverage and no external audit. So it remains unverified whether the read-only guards hold up in production environments, how much the finder-validator split actually cuts false positives, and how the agent performs outside its own test templates. Star, fork and commit counts are a snapshot from the moment of reading and keep moving. The project is explicit about the one condition that is not technical: use it on your own systems, or under written authorization.

◈ AI-GENERATED REPORT · SOURCES LINKED

FAQ

Which models and providers can Cain use?

Claude is the default via ANTHROPIC_API_KEY. The optional pi backend, which requires Node.js 20 or newer, routes to OpenAI, Gemini, DeepSeek, OpenRouter or an Anthropic-compatible gateway, and recon and test stages can be pointed at different models.

Is it safe to point Cain at production systems?

The design leans that way — all 46 tools are read-only, write calls are blocked, and scope.yaml plus a PreToolUse hook confine the target — but none of that has been verified outside the project's own reports, so treat a production run as untested.

Have Cain's benchmark results been independently verified?

No. The 1-of-1, 2-of-2 and 5-of-5 detections with zero false positives come from reports the project published itself, measured against the vulnerable-terraform templates.

Sources

More reports