detonate

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0

README

detonate

This project is constantly evolving and is currently not production-grade. Detonate can have bugs, false positives, and false negatives. A no_findings result is not a security certification. Use disposable test targets, never provide real secrets, and read the full disclaimer before running dynamic scans.

Run untrusted AI tools in a sandbox and report what they actually do, not what their manifest claims.

You install an MCP server from GitHub. It runs on your machine, with your permissions, and your AI assistant calls its tools automatically. Nobody reads the code first.

Many scanners stop at manifests or source. detonate also runs supported targets in a disposable container, calls schema-reachable tools with hostile input, and reports the evidence it can collect.

detonate: discovered 1 tool(s):
    [mcp] read_file: Read the contents of a file.

  ----------------------------------------------------------------
  RISK: dangerous  (1 finding(s))
  COMPLETENESS: complete
  ----------------------------------------------------------------
  Coverage: 2/2 scenario(s) completed

  1. [CRITICAL] tool "read_file" leaked data via path-traversal
     evidence : root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin
     observed : +2ms during probe:path-traversal on read_file
     source   : probe-response

That is the real content of /etc/passwd, returned by the tool, because detonate asked it for ../../../../etc/passwd. The manifest said "Read the contents of a file." A static scanner reports it clean.

Why not just use a static scanner

Most MCP scanners read the manifest, pattern-match the source, and ask a model what it thinks. Detonate does that too — and then runs the thing.

Reads manifests and source Executes the target and probes its tools
Static and LLM-based scanners yes no
detonate yes yes

The distinction is not academic. Published measurement of static MCP analysis found it scored 100% on Python and 0% on JavaScript, while dynamic analysis of the same corpus scored 100% across every language (arXiv:2603.21641). Detonate speaks to a running server over the MCP protocol and never parses target source, so its coverage does not depend on which language the target happens to be written in.

It also means a finding is a fact rather than a suspicion. /etc/passwd came back or it did not.

No LLM is involved in any verdict. Findings come from deterministic rules over static artifacts and collected runtime evidence. A scanner whose output changes between runs cannot gate a CI pipeline.

Install

Detonate is a single static binary with no runtime to install — no Python environment, no Node, no API key, and it never calls out to a service.

# With Go installed
go install github.com/m4vic/detonate/cmd/detonate@latest

Or download a prebuilt binary for Linux, macOS, or Windows from the releases page, extract it, and put detonate on your PATH. Verify the download against checksums.txt.

From source:

git clone https://github.com/m4vic/detonate
cd detonate
go build -o detonate ./cmd/detonate

Then check the machine is ready:

detonate doctor
detonate v0.1.0  linux/amd64

  [ok]   docker            docker ready
  [ok]   image             python:3.12-slim
  [ok]   image             node:22-slim

  Ready. Try:  detonate ./some-mcp-server

Docker is needed to execute a target, not to use detonate. Prompt and skill analysis read text rather than run it, so they work on a machine with no container runtime at all. doctor says which scans are available when Docker is missing.

What you need

You want to scan You need
A prompt or instruction file nothing but detonate
An Agent Skill's instructions nothing but detonate
An MCP server, or a skill's bundled scripts Docker

Go is only needed if you install with go install. A downloaded binary has no runtime dependency at all — detonate is statically linked, calls no service, and needs no API key.

Run detonate doctor and it will tell you which of the rows above apply to your machine.

The flow

  you paste a target                  detonate ./my-server
  ┌──────────────────┐                detonate github.com/owner/repo
  │ path · URL · file│                detonate ./system-prompt.txt
  └────────┬─────────┘
           ▼
   clone, if it is a URL               read-only; nothing runs yet
           ▼
   work out what it is                 SKILL.md → skill
                                       entry point → MCP server
                                       .txt / .md → prompt
           ▼
   static analysis                     no Docker, seconds
           ▼
   ── dynamic only, and only for servers and scripts ──
           ▼
   install dependencies                separate container, network ON
           ▼
   launch in the sandbox               network OFF, read-only root,
                                       non-root, all capabilities dropped
           ▼
   call every tool with hostile input  compared against a benign baseline
           ▼
   report                              text · JSON · SARIF
                                       exit 0 clean · 3 findings

You never tell detonate what the target is. A folder with a SKILL.md is a skill, a folder with an entry point is an MCP server, a .txt or .md is a prompt.

If you paste a repository that holds many servers rather than being one, detonate lists the packages inside it and the exact command for each:

$ detonate static github.com/modelcontextprotocol/servers

  This looks like a repository of packages. Scan one with --path:
    detonate static github.com/modelcontextprotocol/servers --path src/everything
    detonate static github.com/modelcontextprotocol/servers --path src/memory
    ...

Use

detonate doctor             check whether this machine can run a scan
detonate static <target>    inspect without executing target code
detonate dynamic <target>   experimental: runs the Docker sandbox path
detonate combined <target>  intentionally unavailable in alpha

Start with static mode on a file, folder, or Git URL. It needs no Docker and returns in seconds:

detonate static ./skills/pdf-extractor
detonate static ./system-prompt.txt
detonate static github.com/owner/repo

Static prompt and skill analysis are the mature paths. Static MCP mode currently records only source and manifest inventory and reports incomplete coverage on purpose — it does not claim an MCP security verdict until source analysis is implemented, because reporting one it cannot support is the failure this tool exists to avoid.

Every mode takes the same options, so a CI job without Docker can still emit SARIF:

detonate static ./skills/pdf-extractor --format sarif --out detonate.sarif

Dynamic mode is a separate verb because it can execute untrusted code inside Docker:

detonate dynamic ./my-server           # MCP server
detonate dynamic ./skills/pdf-extractor # agent skill

detonate works out what the target is. A folder with a SKILL.md is a skill, a folder with an entry point is an MCP server, a .txt or .md file is a prompt.

A package inside a monorepo is reached with --path:

detonate github.com/modelcontextprotocol/servers --path src/memory

The entry point comes from the manifest, so servers with no runnable file on disk are handled: bin/main for Node, [project.scripts] for Python. TypeScript projects whose dist/ is generated at publish time are compiled first, in the install container — including monorepo packages, whose build needs the config they inherit from the repository root.

Or run it with no arguments for the slash-command interface:

detonate
detonate> /static ./system-prompt.txt
detonate> /dynamic ./my-server
detonate> /help

Entering a target without a slash uses static mode. Dynamic mode remains experimental: dependency and build hooks may run as root in the networked acquisition container. Schema-reachable tools are called with adversarial input, and discovered skill scripts are executed without dependency-aware invocation data. --quick opts out of dynamic stages.

If detection guesses the start command wrong:

detonate ./weird-server --cmd "python /target/main.py"

Inside the sandbox your folder is mounted at /target, which is why --cmd uses that path rather than a host one.

Exit codes: 0 completed without a gated issue, 1 error, 2 bad usage or environment, 3 findings, 4 incomplete coverage when --fail-incomplete is enabled.

In CI

--format sarif produces output GitHub code scanning understands, so findings appear as annotations on the pull request diff.

- name: Scan agent dependencies
  run: detonate ./mcp-servers/my-server --fail-incomplete --format sarif --out detonate.sarif
  continue-on-error: true          # let the upload run, then gate on it

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: detonate.sarif

--format json gives the same scan as structured data for anything else. Exit codes are identical across formats, so switching to SARIF for annotations cannot change whether the build passes.

Failures before or during execution still emit the requested JSON/SARIF document. JSON reports place them in failures with a stable phase, code, bounded message, and retryable flag; the failed phase also appears in scenarios, so risk remains not_assessed rather than becoming a false clean result. Current codes are:

Code Phase
fetch_failed repository fetch
runtime_unavailable Docker preflight
acquisition_failed dependency/build acquisition
mcp_start_failed sandboxed server startup
mcp_inventory_failed MCP negotiation or tool inventory
skill_load_failed skill resolution
scan_failed internal execution fallback

What it checks

MCP servers - the danger is code that executes.

Adversarial probes path traversal, command injection, SSRF, template injection, encoding abuse, oversized input: 13 payloads across 7 MCPTox classes
Returned/runtime hints returned content plus target-controlled stderr signatures
Sandbox controls egress denied, read-only root, non-root runtime, capability/PID/memory policy; Docker lifecycle events are not yet wired into verdicts
Install time stdout/stderr signatures from pip install / npm install; not full network/process/filesystem observation
Rug pulls tool-description hashes diffed against an automatically advanced baseline; explicit approval/history is planned
Tool results text, non-text content blocks, structured content, and isError are preserved for deterministic inspection; transcript persistence is not yet implemented
Pagination follows every tools/list cursor with loop detection and hard page/item ceilings

Skills - mostly a large prompt, so the danger is text the agent obeys.

Injection context overrides, concealment instructions, credential access
Permission mismatch declares allowed-tools: [Read] then instructs shell commands
Bundled scripts run one-by-one in the sandbox; dependencies, valid arguments, exit/timeout coverage, and helper-vs-entrypoint classification are incomplete

Prompts - the same instruction analysis, on any text an agent will read.

How it works

TARGET             clone or mount it, read-only
    |
ACQUIRE            separate container, network ON; dependency/build hooks may
                   execute target-controlled code as root in that container
    |
DETONATE           network OFF, read-only root, all capabilities dropped,
                   no-new-privileges, non-root, memory and PID caps
    |
PROBE              call schema-reachable tools with hostile arguments, diffed
                   against a benign baseline call
    |
ASSESS             independent risk + completeness over evidence and scenarios

No LLM is involved in any current verdict. Findings come from deterministic rules over static artifacts and collected runtime evidence. A scanner whose output changes between runs cannot gate a CI pipeline.

Honest limitations

  • Acquisition is not yet a safe build boundary. pip install, npm lifecycle scripts, and npm run build can execute target-controlled code while the acquisition container has network access, a writable root, and uid 0. Current install observation analyzes process output; it is not complete network, process, or filesystem tracing.
  • A container is not a virtual machine. It is a process on the host kernel behind namespaces and cgroups, so a kernel exploit escapes it. That is why the detonation policy drops every capability, sets no-new-privileges, and refuses to run as root: defence in depth, because the boundary is not absolute.
  • No findings is not proof of safety. Successful prompt, skill, and MCP reports separate risk from completeness and list every modeled scenario outcome. Early fetch, runtime, acquisition, startup, and inventory failures now produce structured reports, but the current probe set reaches only part of many schemas. Treat results as prototype evidence, not certification.
  • Tools that need the network cannot be behaviourally probed. The sandbox denies egress on purpose, so a tool that calls an external API (Notion, Slack, a database) fails its probe with a resolver error. This is reported as an unsupported scenario naming which tools need egress, not as a finding — the sandbox working is not a defect in the tool.
  • Startup and invocation are observed; syscalls are not. eBPF-level tracing would close that gap and is not built.
  • Docker is required for everything except prompt files.
  • Servers that shell out to system binaries may not start. The sandbox images are slim, so mcp-server-git fails on a missing git executable. The error names the cause, but the scan does not complete.
  • Monorepo packages that rely on hoisted workspace dependencies still fail. Packages that inherit only a tsconfig are handled; ones that need the root node_modules are not.

Calibration

False positives are why security tools get switched off, so detectors are measured against real, known-good targets before shipping:

Corpus Flagged
59 skills from a public skill pack 4, all verified true
40 Google plugin skills 1, verified true

Earlier revisions flagged 30/59 and 11/12. Both times the cause was the same: measuring capability as if it were malice. A skill that uses an API key, or one that warns you never to commit private keys, is not an attack.

False negatives get the same treatment, and one was worse. Script discovery only looked at a skill's top level, so Anthropic's own docx skill — 15 Python files under scripts/ — was reported as 0 bundled scripts, instructions only. A clean verdict on the reference implementation of the format. An error tells you to look closer; a clean verdict tells you not to bother.

Several known wrong answers came from broad text matchers, including matchers over stderr produced by scripts running inside the sandbox. Sandbox enforcement and runtime observation are different guarantees: the former limits a process; the latter is currently incomplete and must be reflected in coverage.

Status

Alpha. It installs, it runs, and it finds real things — but it is 0.x, and flags and report fields may still change within a minor version. Breaking changes are named in the changelog.

What is solid: a clean checkout builds on Linux, macOS, and Windows and CI proves it from git archive rather than from a working tree. Successful scans report risk, completeness, and per-scenario coverage, and common pipeline failures preserve that same contract instead of collapsing into a false clean result.

What is not: acquisition can still execute target-controlled hooks as root with network access, resource budgets are incomplete, cancellation and teardown do not yet have equal failure coverage, and runtime observation leans on target-controlled output. Each is tracked in the roadmap with the version that closes it.

Interfaces stabilize at 1.0, which means the report schema and exit codes are frozen and acquisition is safe — not that every feature is built.

Design and roadmap

The current implementation, target architecture, and verified compatibility results are tracked separately so proposed features are not mistaken for shipped behavior:

Project policies

License

Apache-2.0

Directories

Path Synopsis
cmd
detonate command
Command detonate runs untrusted AI-connected tools in a sandbox and reports what they actually do.
Command detonate runs untrusted AI-connected tools in a sandbox and reports what they actually do.
internal
acquire
Package acquire installs a target's dependencies before it is detonated.
Package acquire installs a target's dependencies before it is detonated.
assessment
Package assessment turns execution evidence into trustworthy scan outcomes.
Package assessment turns execution evidence into trustworthy scan outcomes.
baseline
Package baseline records what a target looked like on a previous scan so changes can be detected.
Package baseline records what a target looked like on a previous scan so changes can be detected.
cli
Package cli is detonate's command-line surface.
Package cli is detonate's command-line surface.
environment
Package environment holds detonate's pre-flight checks.
Package environment holds detonate's pre-flight checks.
fetch
Package fetch acquires a target from a remote source.
Package fetch acquires a target from a remote source.
mcpdriver
Package mcpdriver connects to a real MCP server over stdio and enumerates its tools.
Package mcpdriver connects to a real MCP server over stdio and enumerates its tools.
mcptest
Package mcptest provides a real MCP server for detonate's own tests.
Package mcptest provides a real MCP server for detonate's own tests.
monitor
Package monitor observes what a sandboxed target actually does.
Package monitor observes what a sandboxed target actually does.
probe
Package probe invokes a target's tools with hostile arguments and watches what happens.
Package probe invokes a target's tools with hostile arguments and watches what happens.
report
Package report renders a scan's findings in machine-readable formats.
Package report renders a scan's findings in machine-readable formats.
sandbox
Package sandbox runs untrusted code inside a disposable container.
Package sandbox runs untrusted code inside a disposable container.
scan
Package scan runs one target through the detonation pipeline.
Package scan runs one target through the detonation pipeline.
scenario
Package scenario defines the portable contract for one Detonate test case.
Package scenario defines the portable contract for one Detonate test case.
skill
Package skill reads a SKILL.md directory into the same ToolInfo shape the MCP driver produces, so everything after this point doesn't need to care which input kind it is looking at.
Package skill reads a SKILL.md directory into the same ToolInfo shape the MCP driver produces, so everything after this point doesn't need to care which input kind it is looking at.
target
Package target models what detonate scans.
Package target models what detonate scans.
toolcall
Package toolcall contains the protocol-neutral representation of one MCP tool result.
Package toolcall contains the protocol-neutral representation of one MCP tool result.
toolinfo
Package toolinfo defines the shape both drivers (MCP, skill) normalize into.
Package toolinfo defines the shape both drivers (MCP, skill) normalize into.
trace
Package trace is detonate's evidence model.
Package trace is detonate's evidence model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL