<!-- 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/laissez/llms.txt

Run laissez on loopback in front of a fake GitHub, then send requests through it with curl as an agent: one to a host the policy does not name and one from an agent the policy does not know, both refused at CONNECT, then one that is allowed and gets a GitHub token the agent never held. It needs Go, curl and jq, and no GitHub App, SPIRE or AWS account. Nothing leaves loopback.

## Install



**Go**

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

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

**Linux and macOS binary**

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

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

**Debian and Ubuntu**

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

**Fedora and RHEL**

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



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

```console
$ laissez version
laissez v0.1.0
```

## Start the demo

The fake GitHub and its throwaway keys come from [examples/demo](https://github.com/dyokto/laissez/blob/main/examples/demo/main.go), which is not part of the laissez binary, so build it from a clone:

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

```console
$ go build -o bin/laissez-demo ./examples/demo
$ bin/laissez-demo --dir laissez-demo 2>laissez-demo.log &
$ ls laissez-demo
agent-key.pem
agent.jwt
agent.pem
app.pem
bundle.jwks
bundle.pem
laissez.toml
proxy-key.pem
proxy.pem
stranger-key.pem
stranger.pem
upstream-ca.pem
```

It serves a fake `api.github.com` on loopback and writes into `laissez-demo/` a SPIFFE trust bundle for `example.org`, X509-SVIDs for `spiffe://example.org/agent/coder` and `spiffe://example.org/agent/stranger`, a GitHub App key, and a `laissez.toml` that lists one agent:

```toml
[[agent]]
spiffe_id = "spiffe://example.org/agent/coder"
  [agent.github]
  installation_id = 42
  repositories = ["laissez"]
  permissions = { contents = "read", metadata = "read" }
```

Check the configuration, then start laissez on `127.0.0.1:18443`:

```console
$ laissez check --config laissez-demo/laissez.toml
ok: 1 agent(s)
$ laissez run --config laissez-demo/laissez.toml 2>laissez-demo/laissez.log &
```

## Refused at CONNECT

In the commands below, `--proxy-cert` and `--proxy-key` are the agent's X509-SVID, `--proxy-cacert` trusts laissez's listener, and `--cacert` trusts the CA laissez wrote at start for the hosts where it injects a credential.

The agent `coder` asks for `example.com`, which its policy does not name. laissez answers the CONNECT with 403 and never dials the host:

```console
$ cd laissez-demo
$ curl --silent --show-error --proxy https://127.0.0.1:18443 \
    --proxy-cacert upstream-ca.pem --cacert laissez-ca.pem \
    --proxy-cert agent.pem --proxy-key agent-key.pem \
    https://example.com/
curl: (56) CONNECT tunnel failed, response 403
```

An agent with a valid SVID from the same trust domain, but no `[[agent]]` entry, gets the same 403 for a host that `coder` may reach:

```console
$ curl --silent --show-error --proxy https://127.0.0.1:18443 \
    --proxy-cacert upstream-ca.pem --cacert laissez-ca.pem \
    --proxy-cert stranger.pem --proxy-key stranger-key.pem \
    https://api.github.com/repos/dyokto/laissez
curl: (56) CONNECT tunnel failed, response 403
```

## Allowed, with a credential the agent never held

The same request as `coder`, which also sends an `Authorization` header of its own. laissez mints a GitHub installation token for `laissez` with `contents: read` and `metadata: read`, replaces the agent's header with it, and forwards the request. The fake GitHub echoes back the header it received:

```console
$ curl --silent --show-error --proxy https://127.0.0.1:18443 \
    --proxy-cacert upstream-ca.pem --cacert laissez-ca.pem \
    --proxy-cert agent.pem --proxy-key agent-key.pem \
    --header 'Authorization: token agent-should-not-have-this' \
    https://api.github.com/repos/dyokto/laissez
{"authorization_seen_by_gh":"Bearer ghs_demo_minted_token","host":"api.github.com","path":"/repos/dyokto/laissez"}
```

## The audit log

Every decision is one JSON line in `audit.jsonl`. The minted token is recorded only as the first 16 hex characters of its SHA-256:

```console
$ jq -c '{agent, destination, method, decision, reason, credential_kind}' audit.jsonl
{"agent":"spiffe://example.org/agent/coder","destination":"example.com:443","method":"CONNECT","decision":"deny","reason":"destination not in policy","credential_kind":"none"}
{"agent":"spiffe://example.org/agent/stranger","destination":"api.github.com:443","method":"CONNECT","decision":"deny","reason":"SPIFFE ID not in policy","credential_kind":"none"}
{"agent":"spiffe://example.org/agent/coder","destination":"api.github.com:443","method":"CONNECT","decision":"allow","reason":"intercept","credential_kind":"none"}
{"agent":"spiffe://example.org/agent/coder","destination":"api.github.com:443","method":"GET","decision":"allow","reason":null,"credential_kind":"github-installation-token"}
```

Stop the two background processes with `kill %1 %2`, and remove `laissez-demo/` before running the demo again: the audit log appends.

## 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.

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

## Next

- [How laissez works](https://dyokto.github.io/laissez/design/): identities, GitHub and AWS brokering, the environment an agent needs, and what laissez does not do
- [examples/laissez.toml](https://github.com/dyokto/laissez/blob/main/examples/laissez.toml): every configuration key, for running it against real GitHub and AWS
- [Threat model](https://dyokto.github.io/laissez/threat-model/): what laissez protects against and its known gaps
- [Spec map](https://dyokto.github.io/laissez/spec-map/): the specifications it implements and where it departs from them
