<!-- Generated by website/scripts/sync-docs.mjs from docs/quickstart.md. Edit that file, not this one. -->

# Quick start

> Every page of this site: https://dyokto.github.io/mustbreak/llms.txt

Run mustbreak against two local AuthZEN policy decision points built from its own test fixture, one that evaluates a request it must refuse and one that refuses it, then against the MCP client in modelcontextprotocol/go-sdk. It needs Go and runs on loopback; nothing is sent to a service you do not own.

## Install



**Homebrew**

```sh
brew install kanywst/tap/mustbreak
```

**Go**

Needs Go 1.26.0 or later (the `go` line in `go.mod`). Installs to `$(go env GOPATH)/bin`.

```sh
go install github.com/dyokto/mustbreak@latest
```

**Linux and macOS binary**

Pick the archive for your platform from the [releases page](https://github.com/dyokto/mustbreak/releases): `darwin-arm64`, `darwin-amd64`, `linux-amd64` or `linux-arm64`.

```sh
gh release download -R dyokto/mustbreak -p 'mustbreak-*-linux-amd64.tar.gz'
tar xzf mustbreak-*-linux-amd64.tar.gz mustbreak
sudo install mustbreak /usr/local/bin/
```

**Debian and Ubuntu**

```sh
gh release download -R dyokto/mustbreak -p 'mustbreak_*_linux_amd64.deb'
sudo apt install ./mustbreak_*_linux_amd64.deb
```

**Fedora and RHEL**

```sh
gh release download -R dyokto/mustbreak -p 'mustbreak_*_linux_amd64.rpm'
sudo dnf install ./mustbreak_*_linux_amd64.rpm
```

**GitHub Action**

The action downloads the release archive for the runner, checks it against the release's `checksums.txt`, and runs `mustbreak` with `args`. It runs on Linux and macOS runners.

```yaml
- uses: dyokto/mustbreak@v0.1.2
  with:
    version: v0.1.2
    args: as --profile .github/mustbreak.yaml --fail-on must
```



Check it is on your `PATH`. A release binary prints its version; a `go install` build prints `dev`.

```console
$ mustbreak --version
mustbreak version 0.1.2
```

## Get the targets

The two PDPs come from [e2e/pdp](https://github.com/dyokto/mustbreak/blob/main/e2e/pdp/main.go) and the MCP client from [e2e/gosdk-client](https://github.com/dyokto/mustbreak/blob/main/e2e/gosdk-client/main.go). Neither is part of the mustbreak binary, so build them from a clone:

```sh
git clone --depth 1 https://github.com/dyokto/mustbreak
cd mustbreak
```

## A PDP that fails

AuthZEN Authorization API 1.0 §10.1.1 says a PDP must answer 400 to an evaluation request that is missing a required attribute, such as `subject.type`. With `--fail-open`, the PDP evaluates the request anyway:

```sh
go build -o bin/mustbreak-pdp ./e2e/pdp
bin/mustbreak-pdp --fail-open --listen 127.0.0.1:8181 &
```

`mustbreak pdp` sends a complete request first, then the same request with each required attribute left out, then a batch with one broken item. `--fail-on must` makes a failed MUST-level case exit 2:

```console
$ mustbreak pdp --url http://127.0.0.1:8181 --fail-on must
mustbreak 0.1.2: pdp http://127.0.0.1:8181

FAIL   MB-20  MUST      Evaluation missing a required attribute; a batch where one item errors
              6 request(s) with a missing attribute were not refused as required
              - evaluation endpoint http://127.0.0.1:8181/access/v1/evaluation
              - control, complete request: HTTP 200 {"decision":true}
              - without subject.type: HTTP 200 {"decision":true}
              - without subject.id: HTTP 200 {"decision":false}
              - without resource.type: HTTP 200 {"decision":true}
              - without resource.id: HTTP 200 {"decision":true}
              - without action.name: HTTP 200 {"decision":false}
              - control batch, two complete items: HTTP 200 {"evaluations":[{"decision":true},{"decision":true}]}
              - batch with an item missing subject.type: HTTP 200 {"evaluations":[{"decision":true},{"decision":true}]}

1 cases: 0 pass, 1 fail, 0 skip, 0 error
```

None of the five incomplete requests got 400, three of them were allowed, and the broken batch item got `true`. The control request comes first so that a PDP that refuses everything cannot pass.

## The same PDP, refusing

Start it again without `--fail-open`, on another port:

```console
$ bin/mustbreak-pdp --listen 127.0.0.1:8182 &
$ mustbreak pdp --url http://127.0.0.1:8182 --fail-on must -v
mustbreak 0.1.2: pdp http://127.0.0.1:8182

PASS   MB-20  MUST      Evaluation missing a required attribute; a batch where one item errors
              every incomplete request got 400 and the broken batch item was denied
              - evaluation endpoint http://127.0.0.1:8182/access/v1/evaluation
              - control, complete request: HTTP 200 {"decision":true}
              - without subject.type: HTTP 400 missing a required attribute
              - without subject.id: HTTP 400 missing a required attribute
              - without resource.type: HTTP 400 missing a required attribute
              - without resource.id: HTTP 400 missing a required attribute
              - without action.name: HTTP 400 missing a required attribute
              - control batch, two complete items: HTTP 200 {"evaluations":[{"decision":true},{"decision":true}]}
              - batch with an item missing subject.type: HTTP 200 {"evaluations":[{"decision":true},{"context":{"error":{"message":"missing a required attribute","status":400}},"decision":false}]}

1 cases: 1 pass, 0 fail, 0 skip, 0 error
```

The exit status is `0`. `-v` prints the evidence for passing cases too; without it, only fails and errors show it.

## An MCP client

For client cases, mustbreak plays a hostile MCP server, authorization server and OpenID provider on `127.0.0.1:8443`, and runs the client once per attempt with `{url}` replaced by the server's URL. The client here is the go-sdk auth example with the browser step replaced, pinned to go-sdk v1.9.0:

```console
$ go build -C e2e/gosdk-client -o ../../bin/gosdk-client .
$ mustbreak client --run 'bin/gosdk-client {url}'
mustbreak 0.1.2: client http://127.0.0.1:8443/mcp

PASS   MB-01  MUST      Protected resource metadata whose resource is not the URL the metadata was derived from
              the client fetched the metadata and did not use it
PASS   MB-02  MUST      resource_metadata in WWW-Authenticate points to metadata for another resource
              the client fetched the metadata and did not use it
SKIP   MB-12  MUST      Attacker's authorization response delivered to the victim's session
              the client sends a PKCE code_challenge, which protects it against a swapped response (RFC 9700 §4.7.1); a forged state proves nothing here, use --login-url for the two-session test
PASS   MB-13  MUST      Authorization response with the wrong iss, or none when iss is advertised
              the client rejected every response with a wrong or missing iss
SKIP   MB-17  MUST      UserInfo sub that differs from the ID Token sub
              the client does not call the UserInfo endpoint

5 cases: 3 pass, 0 fail, 2 skip, 0 error
```

A `skip` is not a pass: the client lacks the feature the case attacks, or the setup cannot exercise it. Stop the two PDPs with `kill %1 %2` when you are done.

## Your own target

Pick the subcommand by the target's role (`as`, `rs`, `client`, `pdp`) and give mustbreak a profile with the test clients and tokens the selected cases need. [e2e/dex-as.yaml](https://github.com/dyokto/mustbreak/blob/main/e2e/dex-as.yaml) is a working profile for dex. Run it only against your own deployment or a local build.

## Verify a release

Each release has a `checksums.txt` signed keylessly with cosign, an SPDX SBOM per archive, and SLSA build provenance for the archives and packages. Releases up to v0.1.1 were built as `kanywst/mustbreak`: use that name in the identity and `-R` for them.

```console
$ cosign verify-blob \
    --bundle mustbreak-0.1.2-checksums.txt.sigstore.json \
    --certificate-identity-regexp '^https://github.com/dyokto/mustbreak/\.github/workflows/release\.yml@refs/tags/v' \
    --certificate-oidc-issuer https://token.actions.githubusercontent.com \
    mustbreak-0.1.2-checksums.txt
Verified OK
$ sha256sum --ignore-missing -c mustbreak-0.1.2-checksums.txt
mustbreak-0.1.2-linux-amd64.tar.gz: OK
$ gh attestation verify mustbreak-0.1.2-linux-amd64.tar.gz -R dyokto/mustbreak
```

## Next

- [Overview](https://dyokto.github.io/mustbreak/overview/): every case with its spec section and level, the profile format, and what mustbreak does not check
- [Security policy](https://dyokto.github.io/mustbreak/security/): what mustbreak sends and where
- [Contributing](https://dyokto.github.io/mustbreak/contributing/): how a case and its fixture test are written
