AvrelDocs

Signed release approvals

A signed release approval is a small file that says Avrel approved one exact build. It ships next to the build, and your own updater, flasher or deploy script checks it before installing. A build without a valid approval is refused on the device, so only builds that passed your release gate and your sign-off reach hardware.

Avrel never deploys anything, and the collector never enforces anything. The check runs in your updater, under your control, and works offline.

How a build gets approved#

A build is approved when both of these are true:

  1. A readiness record tied to it is approved. Open the record for a release candidate and have it signed.
  2. The release gate, run for that build, says Approved.

The signature that completes the record issues the approval at once. If the gate blocks the build at that moment, the record is still approved, nothing is signed, and the release shows why.

A release approver can also issue an approval from the release's side panel, under Signed approval, with Issue approval. Use it to add the SHA-256 digests of the build's files, or a different expiry. Assistants and keys never issue approvals.

What the file contains#

{
  "format": "avrel.release-approval.v1",
  "algorithm": "Ed25519",
  "key_id": "3f9a0c1d2e4b5a69",
  "payload": "eyJhcnRpZmFjdHMiOltdLCJidWlsZCI6...",
  "signature": "q2m0Vx..."
}

payload is base64 of the exact JSON bytes Avrel signed. Decoded, it names:

FieldWhat it is
organizationYour organization's ID in Avrel. An approval for anyone else is refused.
release, buildThe release name and its build ID, as you registered the candidate.
artifactsThe files it approves, each with its SHA-256, when given.
gateThe release gate's verdict for this build when it was signed.
readiness_recordThe approved record and who approved it.
issued_by, issued_at, expires_atWho issued it, when, and when it stops being valid: 30 days later unless a release approver chose another expiry, from 1 day to 10 years.
status_urlWhere a device can ask whether it was revoked since.

Because the signed bytes ship as they are, any language checks the file the same way: decode payload, check signature over those bytes with the pinned Ed25519 public key, then read the fields.

Use the image's SHA-256 as the build ID when you register the candidate (a build ID can be up to 64 characters). The updater can then check the file it is about to install against the approval with no other list.

Check it on the device#

Pin the public key in your updater when you build it. The keys are public, with no sign-in:

curl -s https://app.getavrel.com/api/release-approvals/keys > avrel-keys.json

Then check the approval before installing. With the Python client, which needs nothing beyond the standard library on the device:

import sys
from avrel.approvals import ApprovalRefused, verify_approval

try:
    verify_approval("avrel-approval.json",
                    organization="your-org-id",
                    public_keys=["MCowBQYDK2VwAyEA..."],   # pinned from avrel-keys.json
                    artifact="firmware.bin")               # the file you are about to install
except ApprovalRefused as exc:
    sys.exit(f"Not installing: {exc}")

Or from a shell, which exits 1 when the approval is refused:

avrel verify-approval avrel-approval.json --org your-org-id --key-file avrel-keys.json --artifact firmware.bin

It is refused when the signature does not verify, the file was changed, it is for another organization or another build, the file's SHA-256 is not one it approves, or it has expired. Add --online (or online=True) to also ask Avrel whether it was revoked; the device then refuses the build when Avrel cannot be reached.

Publish it with the build#

After the readiness record is approved, fetch the approval in CI with a key that has Read access and publish it next to the build:

avrel approval v1.4.2 -o avrel-approval.json --keys avrel-keys.json

When the build has no approval yet, the command fails and says why, for example that the gate blocks it or no readiness record is approved.

Revoke an approval#

When a build must stop being installed, open the release, find the approval under Signed approval and choose Revoke, with a reason. Withdrawing a candidate revokes its approvals too. The file itself cannot change, so:

  • devices that check online refuse the build from then on;
  • devices that only check offline keep accepting it until it expires, which is why approvals expire after 30 days by default.

GET /api/release-approvals/status?id=apr_... answers valid, expired, revoked or unknown, and nothing else about your organization. Owners and engineers can revoke; assistants cannot.

In the app#

Each release's side panel has a Signed approval section: the approval's state, who issued it and when, the files it names, Download for the file, and Issue approval and Revoke for people who may use them. Approved releases with no approval show what is missing.

From an assistant or CI#

ToolAccessWhat it does
list_release_approvalsReadThe approvals issued, with their release, build, files and state.
get_release_approvalReadOne approval's signed file and what it says, or the newest valid one for a release. Says why a release has none.
verify_release_approvalReadChecks an approval file as a device would, and whether it still stands.

Issuing and revoking approvals stay with people. See AI assistants (MCP).