detonate

module
v0.4.1 Latest Latest
Warning

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

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

README

detonate

Test your MCP server or Agent Skill before you publish it.

Detonate runs your target in a locked sandbox, plants fake credentials where a thief would look, and reports what it actually did — with a CI-gateable exit code and SARIF for the GitHub Security tab.

License Stars Version Last Commit

0.x software. It installs, it runs, and it finds real things, but it has bugs, false positives, and false negatives. A no_findings result is not a security certification. Use disposable targets, never supply real secrets, and read the disclaimer before running dynamic scans.


Install

One static binary. No Python environment, no Node, no API key, and it never calls out to a service.

Download a binary — Linux, macOS, or Windows — from the releases page, extract it, put it on your PATH, and verify it against checksums.txt.

# macOS / Linux
VERSION=$(curl -sSL https://api.github.com/repos/m4vic/detonate/releases/latest | grep '"tag_name"' | head -1 | cut -d'"' -f4)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')
curl -sSL "https://github.com/m4vic/detonate/releases/download/${VERSION}/detonate_${VERSION#v}_${OS}_${ARCH}.tar.gz" | tar xz
sudo mv detonate /usr/local/bin/
# With Go 1.25+ installed
go install github.com/m4vic/detonate/cmd/detonate@latest
# From source
git clone https://github.com/m4vic/detonate && cd detonate
go build -o detonate ./cmd/detonate

Then check the machine:

detonate doctor

Docker is needed to execute a target, not to use detonate. Prompt, skill, and MCPB manifest analysis read text rather than run it, so they work with no container runtime at all. doctor tells you which scans your machine supports.

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

See it work in one minute

Two fixtures ship with the repo. One steals; one behaves. Both are probed identically — that pairing is the point, because a scanner that only ever alarms tells you nothing.

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

./detonate dynamic testdata/thief  --cmd "python /target/server.py" --no-install
./detonate dynamic testdata/honest --cmd "python /target/server.py" --no-install

The thief:

  RISK: dangerous  (2 finding(s))
  COMPLETENESS: complete

  [FINDING] 1  [CRITICAL] tool "read_file" returned the contents of /home/detonate/.ssh/id_rsa
     evidence : planted secret /home/detonate/.ssh/id_rsa returned base64-encoded
                (nonce b6b4f5d63c3d52f44d00a51c920543a6)
     observed : +4ms during probe:baseline
     source   : decoy

That nonce is the whole argument. It is 128 bits, generated for that one run, and it exists nowhere else on earth. It came back base64-encoded, so the tool read the file and re-encoded it — it was not echoing our input. There is no benign explanation to argue about, and nothing here rests on a model's opinion.

The honest server exits 0 under the same probes, and says what it proved rather than only reporting an absence:

  RISK: no_findings
  - planted 6 credential decoys in the sandbox; none were returned by any tool

Use it in CI

name: detonate
on: [push, pull_request]

permissions:
  contents: read
  security-events: write   # so findings reach the Security tab

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: m4vic/detonate@v0

That scans on every push, fails the job on findings, and publishes SARIF so results appear in Security → Code scanning and inline on pull requests. The released binary's checksum is verified before it runs.

Input Default What it does
target . Path or git URL to scan
mode static static never executes the target; dynamic runs it in a Docker sandbox
version latest Pin a release for reproducible CI
fail-on findings findings (exit 3), incomplete (also exit 4), or never
Exit codes

These are frozen. A pipeline can gate on them.

Code Meaning
0 clean — something was assessed and nothing was found
1 the scan itself broke
2 usage or environment problem
3 findings
4 nothing was learned about the target, or --fail-incomplete and coverage was short

1 and 3 are deliberately distinct: a pipeline must be able to tell a detonate bug from a real finding in your code.


Commands

detonate static  <file|folder|git-url>    # never executes the target; no Docker
detonate dynamic <file|folder>            # runs it in a sandbox
detonate report  <bundle-dir>             # re-render a saved result offline
detonate doctor                           # check the machine

detonate static --help                    # options and exit codes for one mode

Useful flags: --format json|sarif, --out FILE, --save, --path SUBDIR (for a monorepo), --fail-incomplete, --cmd "…" and --no-install (to scan a server you have already built).

Scanning a server you did not write
detonate static https://github.com/anthropics/skills --path skills/pdf

If detonate cannot tell what a repository is, it says so and prints the exact commands to try — a repo of packages gets a --path suggestion per package.

For a pre-built server, mount it and name the command. The folder appears at /target inside the sandbox:

detonate dynamic ./my-server --cmd "node /target/dist/index.js" --no-install

What's new in 0.4

  • Credential decoys. The sandbox is furnished with plausible SSH keys, cloud credentials, a .env, a .netrc, a GitHub token, and shell history — each carrying a unique 128-bit nonce. A tool that returns one has leaked a credential, and the nonce is printed in the evidence.
  • A bounded proven-negative. A clean scan asserts what it proved rather than only reporting an absence.
  • Nested input schemas are probed. Payloads reach strings inside arrays and objects, not only top-level parameters. On the official MCP memory server this took tools with a reachable attack surface from 3 of 11 to 10 of 11.
  • The sandbox stops taking the blame. A tool that fails because egress is denied, or because the root filesystem is read-only, is reported as unsupported naming the restriction — not as a broken tool. Accusing a working server of being broken is a false positive like any other.
  • A scan that assessed nothing no longer exits 0. Four real community MCP servers returned not_assessed and exited clean; a pipeline reads 0 as "safe to merge". They now exit 4.
  • MCP tool-metadata analysis. Instruction injection, concealment, tool shadowing, pseudo-system markup, invisible Unicode tag smuggling (decoded into the evidence), and bidi overrides. Deterministic, no model involved.
  • A GitHub Action, a total scan budget (15 min default), and --help for every subcommand.

0.4.1 fixes three false-positive generators found by the first corpus run against real registry servers: a dead connection reported once per remaining tool, a two-digit template marker that matched timestamps, and a shadowing rule that flagged honest sequencing documentation. One 682-tool server went from 949 findings to 4.

Full detail in the changelog.


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 the language the target happens to be written in.

It also means a finding is a fact rather than a suspicion. The file 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 pipeline.


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
Credential exfiltration planted decoys matched on the way out, plain, base64, or hex
Tool metadata injection, concealment, shadowing, invisible Unicode, bidi overrides
Sandbox controls egress denied, read-only root, non-root, capability/PID/memory policy
Rug pulls tool-description hashes diffed against an advancing baseline
Pagination follows every tools/list cursor with loop detection and hard 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

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


How it works

TARGET       clone or mount it, read-only
   |
FETCH        separate container, network ON, scripts disabled; Python accepts
             wheels only and Node VCS/local sources are rejected
   |
BUILD        network OFF, non-root
   |
DETONATE     network OFF, read-only root, all capabilities dropped,
             no-new-privileges, non-root, memory and PID caps,
             credential decoys planted in the sandbox home
   |
PROBE        call schema-reachable tools with hostile arguments, diffed
             against a benign baseline call
   |
ASSESS       independent risk + completeness over evidence and scenarios

Risk and completeness are kept independent on purpose. "We found nothing" and "we could not look" are different facts, and collapsing them is how a scanner tells you something is safe when it simply failed.


Honest limitations

  • No findings is not proof of safety. Reports separate risk from completeness and list every scenario outcome. Read both.
  • Tools that need the network cannot be behaviourally probed. The sandbox denies egress on purpose, so a tool calling an external API is reported as unsupported naming the restriction — not as a finding.
  • Tools that need to write may not be probed either. The root filesystem is read-only, so a server that persists state can fail on a valid call. Reported the same honest way.
  • 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 policy drops every capability, sets no-new-privileges, and refuses root: defence in depth, because the boundary is not absolute.
  • Static mode reaches roughly a third of targets. It needs an MCPB manifest.json to read an inventory. Measured on real community servers, most ship none — so static mode correctly returns "not assessed" and exit 4 rather than a clean-looking result. Dynamic mode is the answer for those.
  • Startup and invocation are observed; syscalls are not. eBPF-level tracing would close that gap and is not built.
  • Safe acquisition is intentionally conservative. Registry-backed Node packages and wheel-only Python requirements are supported. Source distributions, recursive requirements, VCS/local Node dependencies, and network-dependent build hooks produce acquisition_unsupported rather than relaxing the boundary. Use --no-install --cmd for a pre-built server.
  • Servers that shell out to system binaries may not start. The images are slim, so a server needing git fails on a missing executable. The error names the cause.

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
27 real tool descriptions from official MCPB examples 0

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 warns you never to commit private keys, is not an attack.

False negatives get the same treatment. Script discovery once looked only at a skill's top level, so Anthropic's own docx skill — 15 Python files under scripts/ — was reported as 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.

Measured results against real targets are recorded in COMPATIBILITY.md, including the failures.


Status

0.x. Flags and report fields may still change within a minor version; breaking changes are named in the changelog. Exit codes are frozen and covered by a test that fails loudly if anyone moves one.

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

Docs

  • Architecture — what the code does today, module by module
  • Plan — what "done" means, and what is deliberately not being built
  • Compatibility — measured results against real targets, including what failed

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.
bundle
Package bundle writes an opt-in, bounded record of a Detonate scan.
Package bundle writes an opt-in, bounded record of a Detonate scan.
cli
Package cli is detonate's command-line surface.
Package cli is detonate's command-line surface.
decoy
Package decoy furnishes the sandbox with a plausible developer machine.
Package decoy furnishes the sandbox with a plausible developer machine.
dockertest
Package dockertest gates the tests that need a real Docker daemon.
Package dockertest gates the tests that need a real Docker daemon.
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.
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.
staticinv
Package staticinv recovers a target's tool inventory without running it.
Package staticinv recovers a target's tool inventory without running it.
target
Package target models what detonate scans.
Package target models what detonate scans.
termsafe
Package termsafe strips terminal-control sequences from target-controlled strings, so a scanned tool cannot inject ANSI styling or cursor movement into scanner output — whether rendered live or replayed from a saved bundle.
Package termsafe strips terminal-control sequences from target-controlled strings, so a scanned tool cannot inject ANSI styling or cursor movement into scanner output — whether rendered live or replayed from a saved bundle.
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.
toolscan
Package toolscan inspects MCP tool metadata for poisoning.
Package toolscan inspects MCP tool metadata for poisoning.
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