# Verify an app

Use `caution verify` to prove that a deployed Caution app is running an enclave image built from source and build inputs you can inspect.

## What verification proves

Caution apps are verifiable. As an end user, you can ascertain what software runs inside an enclave before deciding whether to trust it with data.

This is stronger than the common confidential compute guarantee. Many systems can attest that the software currently deployed has not changed since launch. Caution also connects that attested enclave image back to the source code and build recipe used to produce it. If the source is available, you can review the application, EnclaveOS components, startup script, and manifest, then verify that the running enclave matches that review.

Verification does not decide whether source code is safe. It gives you a cryptographic link between the code you reviewed and the enclave serving traffic.

## Inspect attestation in a browser

The public `/verify` page authenticates fresh nonce-bound AWS Nitro evidence and displays its PCR0, PCR1, and PCR2 values without requiring a Caution account. Enter an HTTPS application domain or explicit HTTPS attestation endpoint. The endpoint must allow cross-origin browser POST requests. Use `caution verify --attestation-url <url>` for HTTP or raw-IP endpoints.

Browser attestation does not authenticate the sibling response manifest, reproduce source, establish a STEVE encrypted session, or automatically prove that the enclave is the expected deployment. The current browser verifier does not pin expected PCRs; compare them manually only after obtaining reviewed values through an independent trusted source. Use the CLI from a reviewed checkout for source reproduction and expected-PCR enforcement.

## Before you start

You need:

- The [Caution CLI](<https://git.caution.co/public/platform/src/branch/main/src/cli>) and [Docker](<https://www.docker.com/>) installed
- A deployed Caution app running outside debug mode
- The app's attestation endpoint, or a local Caution deployment state in the app directory
- Access to the source used to build the app, unless you are verifying against a known PCR file

> [!NOTE]
>
> **macOS requires Docker Rosetta support**
>
> On Apple Silicon Macs, enable Rosetta support in Docker Desktop before running `caution verify`. Open Docker Desktop settings, enable **Use Rosetta for x86\_64/amd64 emulation on Apple Silicon**, then apply the change and restart Docker if prompted.

> [!WARNING]
>
> **Debug mode cannot be verified**
>
> AWS Nitro Enclaves zero out PCR values in debug mode. Remove the `debug` block from `caution.hcl` and redeploy before verifying a production app.

## Publish source information

If you operate the app and want third parties to verify it from the remote manifest, include source locations in `caution.hcl` before deploying. This example uses port `3000` only as a placeholder:

```hcl
enclave "main" {
  build {
    app_sources = ["https://git.example.com/example/myapp"]
  }
  network {
    ingress {
      cidr_ipv4 = "0.0.0.0/0"
      port      = 3000
    }
  }
  unit "default" {
    command = "/app/server"
    args    = ["--port", "3000"]
  }
}
```

Caution includes the source URL and commit in the unsigned response manifest used to select reproduction inputs. Trust comes from verifying that the reproduced PCRs match the signed Nitro attestation. Without `app_sources`, third parties cannot independently obtain the app source. Verifiers need an authorized local checkout, source tarball, or Git URL.

Treat manifest metadata as untrusted input, not as proof of publisher identity or source safety. Current CLI verification rejects option-shaped or control-character app source references, malformed manifest commit hashes, and a manifest-supplied local enclave source. These checks do not replace reviewing the source and independently establishing which PCRs and endpoint you expect.

Deploy or redeploy the app after changing source verification settings:

```bash
git push caution HEAD:main
```

## Verify from the app directory

Run the default verification flow from the deployed app's repository:

```bash
caution verify
```

The CLI infers the attestation endpoint from local Caution deployment state. It reads the app commit from the fresh response's unsigned manifest metadata, stages that commit from the local repository, reproduces the build, and verifies the resulting PCR values. If the manifest has no app commit, it stages local `HEAD`. Fetch the manifest commit into your local repository before verifying if necessary; the CLI fails if it cannot resolve that commit locally and does not fetch it or fall back to `HEAD`.

To verify one deployment of the app, such as a candidate before you switch to it, name it:

```bash
caution verify -d 7f3a91c2
```

For this default source-backed command, check out the `Commit` shown by `caution apps get -d 7f3a91c2` first. The CLI rejects a checkout whose `HEAD` differs from the deployment's recorded commit. Explicit `--app-source-url`, `--from-tarball`, and `--pcrs` modes do not require a matching local `HEAD`.

Its trust is saved to `.caution/deployments/<deployment-id>/trusted_hashes.json`. While several deployments run, `caution verify` without `-d` refuses. See [Deploy and roll back updates](<https://docs.caution.co/guides/deploy-updates/index.md>).

Current deployments also pin the Platform framework archive to an exact commit in the response manifest. Source-backed verification uses that deployed pin. A manifestless local build such as `caution apps build` instead queries the configured Platform API's public `/.well-known/caution/build-inputs` endpoint, pins the advertised Platform commit, and includes it in the local build cache identity. That endpoint reports operator-advertised current inputs; it is not app-specific or attested. For a deployed app, rely on the manifest-backed PCR verification result rather than the endpoint alone.

## Verify a remote app

If you are verifying an app from outside its deployment directory, pass the attestation endpoint explicitly:

```bash
caution verify --attestation-url http://<host>/attestation
```

Caution serves `/attestation` through the deployment's public HTTP/HTTPS endpoint and proxies it internally to bootproofd on reserved port `49502`. Use the exact attestation URL shown by the deployment output or provided by the app operator.

> [!NOTE]
>
> **Separate CLI update check**
>
> Even with `--attestation-url`, the CLI may contact the configured Platform (`--url` or `CAUTION_BACKEND_URL`; default `https://dashboard.caution.co`) for its startup update check. To skip that check for this invocation:
>
> ```bash
> CAUTION_NO_UPDATE_CHECK=1 caution verify --attestation-url http://<host>/attestation
> ```
>
> This disables only the update check; it does not make verification offline.

## Verification modes

Choose the mode that matches the source access you have.

| Situation | Command |
| --- | --- |
| You have the app repository checked out locally | `caution verify` |
| You want one deployment of the app, such as a candidate | `caution verify -d <deployment>` |
| You have the app repository and an explicit endpoint | `caution verify --attestation-url http://<host>/attestation` |
| You have a Git URL instead of a local checkout | `caution verify --app-source-url git@git.example.com:org/app.git` |
| You have an exact source archive | `caution verify --from-tarball source.tar.gz` |
| You already have expected PCR values | `caution verify --pcrs pcrs.txt` |
| You want to force a fresh local rebuild | `caution verify --no-cache` |
| You only want to inspect the remote attestation | `caution verify --inspect-attestation` |

`--from-tarball`, `--app-source-url`, and `--pcrs` are mutually exclusive source selectors. `--from-local` is accepted for one release but deprecated because local source is now the default. You can combine `--attestation-url` or `--no-cache` with one source selector. Inspection accepts `--attestation-url` but conflicts with source selectors, `--no-cache`, and `--save-pcrs` because it does not perform verification.

## Inspect without verifying

```bash
caution verify --inspect-attestation --attestation-url http://<host>/attestation
```

This fetches a fresh-nonce response, parses the COSE payload, prints normalized JSON to stdout, and exits. The JSON marks verification as `not_performed`, encodes CBOR byte strings as `base64:<value>`, and places the sibling unsigned manifest under `response_metadata`. A warning is printed to stderr. No Nitro signature, PCR, source, build, TLS, or persistence check is performed, so this output is debugging evidence only.

## What the CLI checks

When you run `caution verify`, the CLI:

1. Generates a fresh nonce to prevent replay attacks.
2. Sends the nonce to the enclave attestation endpoint.
3. Parses and immediately prints the remote PCRs and `user_data` as unverified values, and labels the response manifest as unsigned metadata.
4. Stages the selected source once, reads its existing configuration, and reproduces the build, or reads expected PCRs from a PCR file you provide.
5. Verifies the Nitro attestation document, including the AWS Nitro certificate chain, certificate validity, COSE signature, nonce, and expected PCR values.
6. For the source-backed Attested TLS browser-compatibility mode, validates the verified `user_data` metadata and live certificate binding unless the check is pending or a raw-IP run has no DNS answer; either outcome is PCR-only.
7. Atomically writes trusted state to `.caution/trusted_hashes.json`, or `.caution/deployments/<deployment-id>/trusted_hashes.json` with `-d`, preserving the previous file in a unique backup.

For a source-backed Attested TLS deployment with a completed certificate binding, the important success lines look like this:

```text
Remote PCR values (unverified until verification succeeds):
  PCR0: ...
  PCR1: ...
  PCR2: ...
Remote user data (unverified): ...

Expected PCR values:
  PCR0: ...
  PCR1: ...
  PCR2: ...

✓ Base Nitro attestation and expected PCR0/1/2 verified
✓ TLS certificate binding verified
✓ Attestation verification PASSED
Trusted state: .caution/trusted_hashes.json
```

The base-verification success line authenticates the PCRs and `user_data` displayed earlier; the CLI does not print `user_data` a second time. UTF-8 control characters are escaped, and non-UTF-8 `user_data` is shown as hexadecimal.

Successful verification writes the trusted-state file for the selected mode, backing up any previous state at that path first. The example above uses `.caution/trusted_hashes.json`; verification with `-d` uses `.caution/deployments/<deployment-id>/trusted_hashes.json`. Native STEVE clients and the STEVE CLI can use this file as their pinned PCR policy. Distribute it through an authenticated channel when the client runs on another machine.

For the source-backed Attested TLS browser-compatibility mode (`mode = "tls"` in `caution.hcl`), an HTTPS attestation request on the configured domain binds the leaf certificate from that same WebPKI-validated, non-redirected response. With a raw deployment-IP attestation URL, the CLI normally requires DNS to contain that IP, then makes a hostname-validated HTTPS health request pinned to it. An empty or NXDOMAIN result skips TLS binding. Apart from the pending case below, other DNS, redirect, HTTPS, metadata, or fingerprint failures are fatal.

For deployments-lifecycle Attested TLS builds that defer certificate issuance until they hold the app address, raw-IP verification can instead report `application TLS verification pending` while attested TLS `user_data` is absent. If DNS contains the deployment IP, verification can be pending while certificate issuance completes. A candidate selected with `-d` can also be pending while the configured domain still points to the live deployment. Once TLS `user_data` is present, the normal DNS and certificate-binding checks apply.

Skipped and pending outcomes still report attestation verification passed and save PCR trust without a `tls` object at the selected verification's trust-file path. Treat either outcome as PCR-only, not Attested TLS verification. After DNS is configured and the deployment is live with a certificate, rerun `caution verify -d <deployment>` or your explicit-endpoint verification command and require `✓ TLS certificate binding verified`.

Attested TLS deliberately preserves ordinary browser HTTPS expectations, so the client does not validate Nitro evidence. Run this verification periodically and ad hoc after relevant deployment, DNS, or certificate changes. Where STEVE-specific client code can be integrated, STEVE provides the stronger client-aware design. Ordinary proxy-level HTTPS that is not configured for Attested TLS receives only the base Nitro/PCR verification. `--pcrs` is also PCR-only: it performs no TLS check and removes any stale `tls` object from the persisted trusted state.

## Inspect the reproduced build

During verification, the CLI prints a build artifacts directory. Open that directory to review what went into the reproduced enclave image:

| Path | What to inspect |
| --- | --- |
| `Containerfile.eif` | Complete enclave image build recipe |
| `app/` | Application source and packaged files |
| `enclave/` | EnclaveOS source, including init and attestation service code |
| `run.sh` | Generated startup script |
| `manifest.json` | Build provenance, pinned Platform framework source, source URLs, commits, and metadata |

Reviewing these files is the step that turns attestation into practical verifiability: you can inspect capabilities in source, then prove that the deployed enclave corresponds to that source.

## If verification fails

Use the failure message to choose the next step:

| Failure | What to do |
| --- | --- |
| Debug-mode warning | Deploy and verify a production-mode candidate, then switch if needed. Explicitly destroy retained debug instances; changing HCL does not remove them. See [debug cleanup](<https://docs.caution.co/reference/debug-enclave/running/#clean-up-debug-access>). |
| Manifest has no app commit | The CLI uses local `HEAD`; confirm that it is the intended source before trusting the result. |
| Manifest commit is unavailable locally | Fetch that commit, use `--app-source-url`, use `--from-tarball`, or use `--pcrs`. |
| Private source unavailable | Provide an authorized Git URL with `--app-source-url`, or verify from an authorized local checkout. |
| PCR mismatch | Treat the app as unverified. Confirm the source commit, build inputs, and deployment are the ones you intended; then retry with `--no-cache`. |
| Attestation endpoint unreachable | Check the exact endpoint URL from deployment output or app operator instructions. |

## Verify Caution key services

[Encrypted secrets](<https://docs.caution.co/guides/add-encrypted-secrets/index.md>) rely on two Caution services: Keymaker, which generates quorum bundles, and the key service, which handles passkey holders. Verify them the same way as an app:

```sh
caution verify --service keymaker
caution verify --service key-service
```

The CLI discovers each service from Platform, shows its source, reproduces PCR0/½ and checks fresh attestation before asking to save trust. For another Platform, set `CAUTION_BACKEND_URL` or `--url`. Trust is saved per Platform and reused by the `caution secret` commands. Rerun the command to approve a service upgrade; trust is never updated silently.

This updates shared service trust, not project policy files. Explicit policy flags, `KEYMAKER_PCR_POLICY_PATH` and `.caution/keymaker-pcr-policy.json` take precedence over shared Keymaker trust; a project `.caution/recryptor-pcr-policy.json` also overrides shared key-service policy. When adopting a new Keymaker, explicitly review and update the project policy while preserving the policy needed to verify existing bundles. `secret init` refuses a selected policy that differs from the saved project policy.

The public `/components` page on Platform shows each service's URL, readiness, attestation and policy checks, also as JSON under `services` in `/.well-known/caution/build-inputs`. The repository and commit shown there are reported by the service. Only the CLI's reproduction establishes trust.

## Verification and encryption

Verification proves what code is running. If the app also needs to keep request and response data hidden from the host system, use STEVE for application-layer end-to-end encryption. Attested TLS is a compatibility mode that terminates ordinary TLS inside the enclave, but requires periodic external verification of the live certificate binding.

See [Use STEVE clients](<https://docs.caution.co/guides/use-steve-clients/index.md>) for browser, CLI, Rust, and Swift integration, including pinned PCRs and TOFU.

## See also

- **Attestations**

  ---

  Learn how Caution [verifies enclave integrity](<https://docs.caution.co/concepts/attestation/index.md>) with hardware-backed proofs.
- **Verifiability**

  ---

  Learn why Caution ties [running enclaves back to source](<https://docs.caution.co/concepts/verifiability/index.md>).
