shannon README

项目的 README,来自 github.com/KeygraphHQ/shannon。合并为一个 markdown 文件:README.md。

[!NOTE] Git worktrees, run limits and OpenAI cyber access checks: scan a worktree directly, tune scans for slow model endpoints, and catch missing OpenAI access before a scan starts.

Shannon, AI Pentester for Web Apps and APIs, by Keygraph

KeygraphHQ%2Fshannon | Trendshift

Shannon is an autonomous, AI pentester for web applications and APIs.

It analyzes your source code, identifies attack paths, and executes real exploits to prove vulnerabilities before they reach production. No exploit, no report.

This repository is Shannon: the full open-source agent, run locally from your command line.

Launch Shannon

npx @keygraph/shannon@latest

The interactive launcher will guide you through setup and your first pentest.


Join Discord      Visit Keygraph.io


[!TIP] AI agents and LLMs: start with llms.txt for a concise map of this repository, or use llms-full.txt for the README and docs combined into one file.

Table of Contents

What is Shannon?

Shannon is an autonomous AI pentester developed by Keygraph. It performs security testing of web applications and their underlying APIs by combining source-code analysis with live exploitation.

Shannon analyzes your web application's source code to identify potential attack vectors, then uses browser automation and command-line tools to execute real exploits against the running application and its APIs. Only vulnerabilities with a working proof-of-concept are included in the final report.

Shannon is the agent. This repository is Shannon, the open-source pentester you run yourself. The same Shannon also powers Keygraph's commercial editions, Pro and Enterprise. See Editions for how Shannon compares with Pro, Enterprise, and the Community Program.

Why Shannon Exists

Thanks to tools like Claude Code and Cursor, your team ships code non-stop. But your penetration test? That happens once a year. This creates a massive security gap. For the other 364 days, you could be unknowingly shipping vulnerabilities to production.

Shannon closes that gap by providing on-demand, automated penetration testing that can run against every build or release.

Why "Shannon"?

It's named after Claude Shannon, the father of information theory. At its core, pentesting is an information problem: every probe reduces uncertainty about a system's state. The best tools maximize the signal gained from every request, turning those bits of knowledge into an exploit path.

Also, we wanted you to be able to say, "Hey Claude, run Shannon" to find all the security flaws in your vibe-coded app.

Not a replacement for human pentesters

Shannon is built to work alongside expert pentesters and red teamers, not replace them. Great pentesters understand the business, chain attacks in ways nobody anticipated, and bring years of judgment that current models can't match.

Shannon solves a different problem: there is far more software to test than security teams have time to cover. Critical systems get periodic expert assessments, while the long tail of internal apps, APIs, and fast-moving services rarely gets tested at all.

Shannon shifts pentesting left into the software development lifecycle (SDLC). Use it to run exploitation-backed tests against staging environments and releases at the cadence they actually ship, and save expert human time for the risks that need someone who knows the organization.

Shannon in Action

Shannon running an autonomous pentest

These reports are from Shannon OSS scans of Photoview 2.4.0, one of the applications in Doyensec's comparison of Aikido and XBOW. We ran Shannon against the same application version and evaluated its results separately. Read the Doyensec study and our Shannon follow-up comparison for the methodology, limitations, costs, and results.

Model Report SARIF
DeepSeek v4 Flash View report SARIF
Grok 4.6 View report SARIF
Claude Opus 5 View report SARIF

Quick Start

Prerequisites

Run Shannon

[!WARNING] Shannon actively executes exploits. Run it only against applications and environments you own or have explicit written authorization to test. Do not run Shannon against production systems.

# Configure credentials with the interactive wizard.
npx @keygraph/shannon@latest setup

# Run a pentest against a source-available target.
npx @keygraph/shannon@latest start \
  -u https://your-app.com \
  -r /path/to/your/repo

Shannon pulls the worker image from Docker Hub, starts the required local infrastructure, mounts the target repository read-only inside an ephemeral worker container, and writes results to a local workspace.

For source builds, authenticated scans, provider-specific setup, and platform notes, see Documentation.

[!TIP] Prefer to use a subscription instead of API credits?

  • OpenAI Codex: The latest version of Shannon supports ChatGPT Plus and Pro subscriptions. Follow the OpenAI Codex subscription setup guide to get started.
  • xAI (Grok): xAI models have recently started refusing cyber-security workloads, so xAI subscriptions are unsupported for now. See the xAI subscription guide for details.
  • Claude Code: The latest version of Shannon supports Claude Pro and Max subscriptions, through a claude setup-token OAuth token or a Pi login. Follow the Claude Code subscription setup guide to get started.

Key Capabilities

CI/CD Integrations

Shannon can run continuously against deployed staging and development environments through official integrations for GitHub Actions and GitLab CI/CD.

Both integrations:

A code-analysis hypothesis does not fail the pipeline. Severity gates count only findings with status: exploited.

GitHub Actions

name: Shannon Pentest

on:
  workflow_dispatch:

permissions:
  security-events: write

jobs:
  pentest:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Run Shannon
        uses: KeygraphHQ/shannon-action@v1
        with:
          url: https://staging.example.com
          api-key: ${{ secrets.SHANNON_AI_API_KEY }}
          fail-on-severity: high
          upload-sarif: true

The Action defaults repo to the checked-out GitHub workspace. It uploads one artifact containing the security assessment reports and SARIF, plus a separate run artifact containing scan and agent logs. Enabling upload-sarif publishes supported findings to GitHub code scanning.

Requirements:

See the Shannon GitHub Action documentation and GitHub Marketplace listing.

Editions

Edition What it is Price
Shannon (open source) This repository. A complete autonomous pentester you run yourself, locally or in CI/CD, against an application whose source code you have. Well suited to individual developers and small teams. Open source under AGPL-3.0. You pay only your own model costs.
Community Program Keygraph Pro at no cost, for U.S.-based 501(c)(3) nonprofits and for seed or pre-Series-A startups with 20 or fewer active developers. $0 in cloud service fees while you qualify.
Pro Keygraph's cloud-hosted edition, managed by Keygraph, with every module included. $50 per active developer per month.
Enterprise Everything in Pro, self-hosted in your own environment or fully air-gapped. Custom.

See keygraph.io/pricing for current prices and the full feature table.

Pro, Enterprise, and the Community Program are powered by an enhanced, enterprise-grade version of the Shannon engine, and all three add:

No source code? Use the Blackbox Pentester.

Compare Shannon, Pro, and Enterprise in detail →

Architecture

Shannon combines multi-stage security code analysis with live reconnaissance and exploitation:

flowchart TD
    S["Source code"] --> EXISTING["Recon + vulnerability analysis"]
    S --> SAST["Agentic security code analysis"]

    EXISTING -- "Pentest candidates" --> REC["Finding reconciliation<br/>(merge + deduplicate)"]
    SAST -- "SAST candidates" --> REC

    REC -- "Reconciled exploitation queue" --> EXP["Exploitation agents"]
    APP["Running application"] --> EXP

    EXP -- "Exploit demonstrated" --> REPORT["Reporting<br/>PDF · Markdown · SARIF"]
    EXP -- "No exploit demonstrated" --> DROP["Discard"]

    REPORT --> CICD["CI/CD gate"]

Stage by stage:

  1. Recon and vulnerability analysis explores the running application, ties runtime behavior back to the source, and runs specialized agents across Injection, XSS, SSRF, Authentication, and Authorization.
  2. Agentic security code analysis maps the application's architecture, trust boundaries, exposed interfaces, dependencies, data flows, and high-risk assets, then opens targeted investigations against them.
  3. Finding reconciliation merges both streams of candidates, deduplicates the overlap, and groups what remains into an exploitation queue.
  4. Exploitation agents attempt real proof-of-concept attacks against the running application.
  5. Validation throws out every candidate Shannon can't demonstrate.
  6. Reporting produces PDF and Markdown reports with the evidence attached, plus structured JSON and SARIF for downstream systems.

Only live-validated vulnerabilities become Shannon pentest findings or count toward CI/CD severity gates.

Each scan runs in an ephemeral Docker container with an isolated workspace and per-invocation orchestration.

Documentation

Use these guides for operational detail:

Guide Use it for
Source build and CLI commands Cloning, building, common commands, output paths, and local development.
Configuration Authenticated testing, login flows, rules of engagement, and report filters.
AI providers Selecting the model, the supported providers (Anthropic, OpenAI, xAI, AWS Bedrock, and any other Pi-supported provider), and custom LLM gateways.
Platforms and networking Windows/WSL2, Linux, macOS, Docker networking, local apps, and custom hostnames.
Workspaces and resuming Naming workspaces, resuming interrupted scans, and workspace storage.
Safety and limitations Authorized-use requirements, non-production guidance, mutative effects, cost, and model caveats.
Coverage and roadmap Current vulnerability coverage and planned work.
Pro and Enterprise Shannon compared with Pro, Enterprise, and the Community Program: black-box pentesting, SCA and secrets, findings management, fix pull requests, retests, Jira, and deployment.

Safety, Scope, and Limitations

Shannon is not a passive scanner. Its exploitation agents can create users, submit forms, mutate application state, trigger outbound requests, and otherwise affect the target system. Use sandboxed, staging, or local development environments with disposable data.

You are responsible for using Shannon legally and ethically. Do not point Shannon at systems, repositories, or applications you do not own or do not have explicit authorization to test.

Important limitations:

Read the full Safety and limitations guide before running Shannon in a new environment.

License

Shannon is licensed under the GNU Affero General Public License v3.0.

Commercial and enterprise licensing is available for organizations that need different license terms, commercial support, private redistribution, managed-service use, or broader deployment options, including Keygraph Pro and Enterprise.

For commercial licensing, contact [email protected].

Acknowledgements

Thanks to Pi, Playwright CLI, and Mantis.

See THIRD_PARTY_NOTICES.md for licensing and attribution details.

About Keygraph

Keygraph is the company behind Shannon. It also builds Keygraph Pro and Keygraph Enterprise, the commercial editions that close the full AppSec lifecycle and run an enhanced build of Shannon as their pentesting engine.

Community and Support

Community office hours are available for hands-on help with bugs, deployments, and configuration questions.

Join Discord to ask questions, share feedback, and connect with other Shannon users.

At this time, Keygraph is not accepting external code contributions. Issues are welcome for bug reports and feature requests:

Stay connected:

Common Questions

Can I self-host Shannon?

Yes. Shannon runs inside your infrastructure in an ephemeral worker container. It mounts the repository read-only and writes results to a local workspace.

Keygraph never receives your source code and never proxies your model traffic. Your model requests go straight to the provider or endpoint you configure, and they carry source and application context with them. Point Shannon at a locally hosted endpoint and that traffic stays inside your environment too.

Does Shannon support bring your own key (BYOK)?

Yes, always. You provide the LLM credentials Shannon uses to run a pentest, in every deployment, open source and commercial. Shannon sends model requests straight to the provider or endpoint you configure, and Keygraph never proxies them. In self-hosted Enterprise deployments, model requests never touch Keygraph's infrastructure: they leave your environment only to reach the endpoint you configure. In Keygraph Pro, which Keygraph hosts, model requests are routed through Keygraph's LLM gateway.

Does Shannon output SARIF?

Yes. Shannon emits SARIF 2.1.0, the OASIS standard format for static analysis results, alongside structured JSON. Any SARIF consumer reads it: code scanning services, vulnerability management platforms, security dashboards, and CI/CD pipelines. It is written by default on exploit-mode scans; set report.sarif to "false" in your configuration file to opt out.

Which AI providers does Shannon support?

Anthropic, OpenAI, xAI, and AWS Bedrock are built in and configured directly by provider ID. Beyond those, Shannon runs on any provider in the Pi harness catalogue, named the same <provider>:<model-id> way. Any provider can be pointed at a proxy or LLM gateway through a custom base URL, which overrides only the endpoint and keeps that provider's API dialect. A model the catalogue does not carry, such as one a router or gateway serves under its own ID, or a self-hosted model, is described in a custom model configuration file and passed with --models-config. Shannon uses a single unified model setting throughout a pentest.

Can I run Shannon on a local or self-hosted model?

Shannon works with local models served through Ollama, vLLM, or LM Studio, which expose an OpenAI-compatible endpoint, as well as routers such as OpenRouter and LLM gateways such as LiteLLM. A model the harness catalogue does not carry, which most self-hosted models are, is described in a custom model configuration file passed with --models-config; routers and gateways can also be reached with a custom base URL. Capability varies, and a model that does not follow Shannon's instructions or tool-use constraints reliably will produce weaker pentests than a frontier model, so take this path only if you know how your chosen model behaves. See Local and self-hosted models.

Does Shannon actually exploit vulnerabilities, or just scan?

Shannon executes real exploits. It reports a finding only when it has produced a working proof-of-concept, and discards hypotheses it cannot prove. It is a pentester, not a passive scanner.

Built by Keygraph

shannon (KeygraphHQ/shannon)

正在搜索数据库…

这是什么?Shannon 是一个自主运行的 AI 渗透测试工具,它会分析你 Web 应用的源代码,梳理攻击向量,然后对运行中的应用实际执行漏洞利用,在问题进入生产环境之前证明其确实存在——“没有利用证明,就没有报告”。
这只是个漏洞扫描器,还是它真的会攻击我的应用?它不止于扫描:它把源代码分析与通过浏览器和命令行进行的实时漏洞利用结合起来,只有在拿到可用的概念验证(PoC)利用代码之后,发现的问题才会被写入报告。
我该怎么运行第一次扫描?运行交互式命令行启动器(推荐通过 npx 使用);它会引导你完成设置,从 Docker Hub 拉取工作容器镜像,以只读方式把你的目标代码仓库挂载到一次性容器中,并把结果写入本地工作区。
运行之前需要安装什么?需要 Docker 来运行工作容器,需要 Node.js 18+ 来使用 npx 方式,还需要你自己的 AI 服务商 API 凭据(Anthropic、OpenAI、xAI、AWS Bedrock 或兼容的网关)——Shannon 需要你自带密钥。
把它指向任意应用都安全吗?不安全——Shannon 会主动执行真实的漏洞利用,因此只能用于你拥有或获得明确授权测试的应用,绝不能用在生产环境上;而且 Anthropic、OpenAI 等服务商可能会在扫描运行途中,依据其自身的网络安全防护机制中断扫描。
它能在 Windows 上运行,也能在 Mac 和 Linux 上运行吗?可以,文档涵盖了 Windows/WSL2、Linux 和 macOS 的设置方法,并且无论宿主操作系统是什么,每次扫描都在隔离的 Docker 容器中运行。
我的源代码和扫描数据会去哪里?所有数据都留在你自己的基础设施中:目标代码仓库以只读方式挂载到本地一次性容器里,结果写在本地,模型请求则直接从你发送到你选择的 AI 服务商——Keygraph 从不代理这些流量。
Shannon 只是扫描漏洞,还是会真的利用这些漏洞?它比扫描更进一步:利用代理会对运行中的应用实际尝试概念验证攻击,凡是 Shannon 无法真正演示的候选问题,都会在报告之前被剔除。
我可以用本地 AI 模型代替云端 API 吗?可以,除了 Anthropic、OpenAI、xAI 和 AWS Bedrock,Shannon 还支持通过 Ollama、vLLM 或 LM Studio 提供的本地模型。
Shannon 生成的输出能否喂给其他安全工具?它会生成 PDF 和 Markdown 报告,以及结构化的 JSON 和 SARIF 2.1.0 文件;在利用模式扫描中默认启用 SARIF,因此发现的问题可以流入 GitHub 代码扫描。
为什么这个项目叫 Shannon?它以信息论之父克劳德·香农(Claude Shannon)的名字命名,因为渗透测试的本质就是通过每一次探测来减少对系统的不确定性。
大小
95.5 MB
星标
52.5K
时长
1年
提交 · 90 天