Skip to content

Deployment governance

Attestation proves a node runs a trusted image today. Three later decisions could still put an app’s data in front of something new:

Decision Flag What it lets in
Release approvals --release-approvals A new mero-tee release (a new node image) holding the app’s data
App upgrades --app-upgrades New app code reading the app’s state
Outbound approvals --outbound-approvals A new destination the app may send data to over HTTPS

Each is held by one side, chosen when the cluster is deployed (system::Governance, Authority), and the same rules hold on every cluster, shared or dedicated:

  • operator: the operator decides for every app, through the Ops API. Nobody else can. This suits a managed deployment whose users trust its operator with that decision.
  • owner (the default; the attested value keeps this name): the decision belongs to the parties around each app, with a fresh passkey assertion that is logged as consent. The operator cannot. Who exactly depends on the decision:
Decision owner side: who holds it Who acts Where
Release (node image) approvals The app’s publisher: the organization its package’s signing key is bound to (Publishers). For a package whose key is not bound yet, or a raw bundle (development only), the app’s owning organization Members of that organization holding APPROVE_RELEASES (its owner and admins hold it) POST /orgs/{org}/releases
App upgrades The app’s owning organization, whatever its package’s manifest declares (App upgrades) Its owner and admins, each with a passkey step-up over the exact upgrade POST /apps/{app}/upgrade, POST /orgs/{org}/upgrade, the consent page’s upgrade sheet
Outbound approvals The app’s owning organization, per publisher key MANAGE_APPLICATION holders organization-wide POST /orgs/{org}/outbound
Who publishes a package The holder of the package’s pinned signing key, whatever governance says A member holding APPROVE_RELEASES in the organization, sending the key’s signature POST /orgs/{org}/publishers
Release deadlines Always the operator (below) The operator POST /ops/releases/{version}/deadline

With operator, each row’s decision is the operator’s instead (POST /ops/releases, /ops/apps/{app}/upgrade, /ops/orgs/{org}/upgrade, /ops/outbound). Whichever side does not hold a decision is refused by the API (403) and, should a command get that far, by apply.

The three decisions sit among the others that shape what an app runs and where its data may go:

who decides what, with which proof, judged wheredecisionwhoconsent / proofwhere enforcedinstall apackageopen: any account. granted: a live deployergrant, its own or its org's (org-wideMANAGE_APPLICATION). The operator: alwaysunbound session or unscopedAPI key; grant judged atthe install's own timeAPI, before any fetch(403 DEPLOY_NOT_GRANTED);apply againoffer areleasethe deployment's managers (its owner account,or its org's org-wide MANAGE_APPLICATION),who see the release; a grant where grantedpasskey consent:deployment:{id} /__offer_appapply, on every nodeupgrade aninstancethe owner and admins of its organization,whatever the manifest's upgrades: says (not amember or the publisher); or the operator.From a deployment: only to the offered releasepasskey step-up over{ bundle, migrate, manifest },or an upgrade key; theoperator's signatureAPI and apply(UpgradeApp);409 OUTSIDE_DEPLOYMENTat bothapprovenode imagesAPPROVE_RELEASES holders of the publisher org(key unbound: the app's own org); or theoperator (--release-approvals operator)passkey consent,POST /orgs/{org}/releases;signed POST /ops/releasesthe replicas that holdthe data (may_send),placementapproveoutbound hoststhe app's org: org-wide MANAGE_APPLICATION,per publisher key; or the operator(--outbound-approvals operator)passkey consent,POST /orgs/{org}/outbound;signed POST /ops/outboundapply; the outboundgate on the node thatruns the requestset deploymentsecretsthe deployment's managers; only a name arelease it offers (or one those use) declaresstep-up over{ name, fingerprint };never the valueAPI (404 UNDECLARED_SECRET); apply works outthe fingerprint againset instancesecretsthe instance's owner, or whoever manages itsorg's apps; a name its release declaresstep-up over{ name, fingerprint }API; a hidden row inthe app's own logpasskey: a fresh assertion after 412 CONFIRM_REQUIRED · signed: with the operator's key

Read a row across: who may make the decision, what they present for it, and where a node refuses anyone else; a row’s operator path exists only where the cluster’s governance gives the operator that decision.

Fixed at genesis, attested with every receipt key

Section titled “Fixed at genesis, attested with every receipt key”

The first system leader writes the configured governance into the system state with SystemCmd::Genesis, before any account can exist (The system group). After that it cannot change: a second genesis is refused, and a node restarted with other flags reads the state’s answer, not its own.

One part may change once: the operator may move deployments from open to granted (SystemCmd::SetDeploymentsGranted, signed with its key), never back, so an existing cluster can close installs without being recreated. It only narrows who may install code; the attested governance changes with it. The sign-up policy changes too, with the signature of whoever runs it.

Every node’s receipt-key attestation binds the governance its system state holds, with its cluster and node id (receipt_key_binding(key, governance, cluster, node)). verify_app_cluster requires every replica of an app to attest the same governance and returns it, so a user can prove, from hardware quotes, who may move their app to new code before they trust it with data (Attestation & receipts).

A package is identified by its name and its pinned signer, the publisher key (did:key) that signed its first release (Packages). Who installed a package first says nothing about who publishes it: anyone may install a registry package, and the first installer (PackageRecord::owner) is never the publisher. An organization becomes the publisher of every package a key signs only by binding the key, with the key’s own signature. Until then the key is unbound, and each instance of its packages is governed by its own organization.

  1. Read the generation. GET /publishers/{signerId} (any signed-in account) answers the cluster’s name, the key’s binding generation (how many bindings it has had on this cluster) and whether it is bound now.

  2. The key signs. Its holder signs, with the package key’s Ed25519 secret, the bytes of system::publisher_binding_message (\n a newline):

    calimero-publisher-binding/v1\n{cluster}\n{org}\n{signerId}\n{generation}

    meroctl app sign signs manifests only; any Ed25519 signer over these exact bytes will do. publicKey is the key’s 32 bytes and signature its 64, both base64url; the key must derive the did:key it claims. The cluster name and the signer id are at most 128 bytes each.

  3. A member sends it. A member of the organization holding APPROVE_RELEASES (the owner and admins hold it) sends POST /orgs/{org}/publishers { signerId, publicKey, signature } from an unbound passkey session. The node checks membership, the capability and the signature before anything else (404 for a non-member, 403 for the rest), then asks for a step-up over org:<org> / __bind_publisher / { signerId, generation }.

  4. The log decides. BindPublisher applies on every node only when the cluster it names is that node’s own (--cluster: a binding signed for another cluster binds nothing here), the actor still holds APPROVE_RELEASES, and the signature verifies over the generation as it stands at apply. The binding records the next generation and answers it. So a signature binds once: it cannot be replayed on this cluster or another, nor after the key moved on.

Rebinding. Binding the key to another organization is the same flow with a new signature from the same key over the next generation. The organization it leaves can neither keep it nor stop it. The pinned key never changes, so a package’s publisher is always whoever its key last signed for.

Unbinding. Deleting the organization unbinds its keys (DeleteOrg); each keeps its generation (SystemState::unbound_publishers), so an organization created later under the same id publishes nothing until the key signs for it anew. There is no other way to unbind: a key moves to another organization or stays where it is.

GET /orgs/{org} lists the keys an organization publishes (publishes).

Binding moves decisions from each instance’s organization to the publisher, for every instance of every package the key signs, customers’ included. The package of an instance is the one of the release it runs (AppRecord::release), never merely of the first release that shipped the same WASM. A WASM belongs to one signer: a release of another signer’s package that ships it is refused at install (409, SHIPS_IN_OTHER_PACKAGE).

Decision Bound key: the publisher’s Unbound key, or a raw bundle (the fallback)
Which mero-tee releases hold the instance (Release approvals) The publisher’s approvedReleases, set by its APPROVE_RELEASES holders The instance’s own organization’s set (an account’s own apps: its personal organization’s)
Upgrades (App upgrades), whatever the package declares Unchanged: the owner and admins of the instance’s own organization; the publisher’s run moves only the instances of organizations its starter is an owner or admin of The same
The package’s registered origins (Registered origins) The publisher’s organization-wide MANAGE_APPLICATION holders The package’s first installer
Outbound approvals (below) Unchanged: always the instance’s own organization, per publisher key The same

Where governance gives release approvals or app upgrades to the operator, the operator decides those for every app, bound or not.

Acme publishes the package chat, signed by did:key:z6Mk…acme, whose manifest declares upgrades: publisher from its first release. Two customers run instances: Globex, in its organization, and Ann, in her personal organization.

  1. Before binding. Each instance’s own organization approves the node images that may hold it: Globex’s set for Globex’s instance, Ann’s personal organization’s for hers. Each customer’s owner and admins upgrade their own instance, as they will after the binding.
  2. Binding. An Acme admin reads GET /publishers/did:key:z6Mk…acme (generation: 0), has the key’s holder sign the message for Acme at generation 0, and sends it with her passkey. The log records generation 1. From that entry on, Acme’s approvedReleases decide which nodes hold both customers’ instances: when the operator rolls out a new mero-tee release, Acme approves it once (POST /orgs/{acme}/releases) and the replicas send both instances’ data to nodes on it. Globex’s own set no longer governs its instance of chat.
  3. Shipping 1.1. Acme publishes chat 1.1 to the registry. Its run, POST /orgs/{acme}/packages/chat/upgrade { version: "1.1.0" } with one passkey step-up, moves Acme’s own instances only. Globex’s owner or an admin moves Globex’s instance, from Globex’s frontend through the consent page or with POST /apps/{app}/upgrade; Acme cannot.
  4. Moving the key. Acme reorganizes into a new organization, Acme Labs. The key signs again, for Acme Labs at generation 1, and an APPROVE_RELEASES holder there sends it. Acme loses every decision above at that entry, and its signature for generation 0 can never bind again.

A mero-tee release is a node image: kernel, firmware, merod build. Upgrading the cluster means starting nodes on a new release, and those nodes would then receive app data. So the replicas that hold an app’s data decide, per app, which releases may receive it:

  • Approved set. Where the operator decides, one set covers every app (operator_releases), seeded with the founding node’s release. Otherwise an app’s set is its publisher’s (Org::approved_releases of the organization its package’s key is bound to), covering every instance of every package it publishes, its customers’ included. An app whose package’s key is not bound yet, or that runs a raw bundle, is judged by its owning organization’s set (SystemState::approved_for_release). The package is that of the release the instance runs (AppRecord::release), never merely of whichever release first shipped the same WASM. Every app is in an organization, so there is no account’s set: an account’s own apps are judged by the organization they are in (Where an instance goes). The release of the node an organization was created through (one made with an instance included; for a personal organization from before 1.0.0-rc.32, the node its account signed up through) is approved from the start.
  • Changing it. POST /orgs/{org}/releases { version, approved } by a member holding APPROVE_RELEASES there (the owner and admins hold it; a member when granted organization-wide, Capabilities; in an organization of one, its owner), each with a passkey step-up; or POST /ops/releases by the operator. The last approved release cannot be withdrawn. GET /orgs/{org} lists who may approve (releaseApprovers). An app or console asks for either through the node’s consent page (kind: "release", with "withdraw": true to withdraw). A withdrawal stops new data reaching nodes on that release; it deletes and moves nothing: a replica already there keeps what it holds (and, if it leads the app, keeps leading it) until the operator moves it.
  • Enforcement is by the nodes that already hold the data:
    • Node::may_send refuses every Raft entry and snapshot of an app group to a peer whose verified attestation names a release outside the app’s set (a peer not yet attested is attested first; the system group goes to every attested peer);

    • placement of a new app considers only nodes on an approved release;

    • a replica move onto a node whose release is not approved is refused.

    • every internal route that reaches an app’s data (internal/view, call, events, storage, blob/*, app-ready, presence, an app group’s raft) refuses a calling node whose release is not in the set: peers identify themselves with their attested key (Networking);

    • a session signed by a node on a release outside the set reaches none of the app (Sessions), and the app’s blobs and presence go only to nodes on an approved release.

An approval is a decision with a proof: the owner’s passkey consent over that exact change, or the operator’s signature where the operator decides, checked where it applies on every node, and usable once (system group). A node cannot log an approval of its own release.

So a node on an unapproved image can join the cluster and replicate the system group, but receives no app’s data until that app’s approver approves its release. It still holds the system state (accounts, memberships, approvals) in full (what the system group holds).

Like a store’s target-SDK deadline, the operator may announce, per release, when work on older images ends: POST /ops/releases/{version}/deadline { after: "2026-12-01T00:00:00Z" } (after: null, or DELETE, lifts it; SetReleaseDeadline). It is an operator decision: the node answers 428 OPERATOR_SIGNATURE_REQUIRED with the bytes to sign, and every node checks the signature where the deadline applies. Deadlines are public: GET /releases, which anyone may call inside the sealed channel, answers the governance and every deadline.

From a release’s deadline on, a party whose newest approved release is older than it (by semver) loses new work on the old image, judged on the set that governs the app (the publisher’s, or the fallback above):

  • creating an app, installing a release (refused only when every scope the installer could use it in is stopped) and upgrading an app are refused 409 RELEASE_DEADLINE, naming the release to approve and the deadline;
  • placement gives no new app a node on a release older than one whose deadline passed.

Existing apps keep running: their calls, reads, writes and replicas go on as before, and no data moves. Approving the release (or a newer one) lifts the stop at once. GET /orgs/{org} says whether its own set is stopped (newWorkStopped).

Why the operator may do this. A deadline cannot move data (no release is approved by it, and may_send reads only approvals), cannot block an approval (approvals are never judged against deadlines), and cannot touch running apps. It only withholds new work, which is availability, and availability is already the operator’s: it can stop nodes or withhold the network. Announcing the rule in advance and in public is better for users than an unannounced stop.

Time. apply judges a deadline against the time the command carries (CreateApp’s createdAt, UpgradeApp’s at, InstallPackage’s installedAt), stamped once by the proposing node and replicated with the command, never against each node’s clock: every replica and every replay of the log decides the same. The system log has no consensus timestamp of its own; the proposing node is an attested node of the cluster, and a skewed clock only moves when an announced, operator-chosen deadline takes effect, which is the operator’s to decide anyway. An upgrade carries the time the API judged it at, before it ran on the app’s group, so apply never refuses the record of an upgrade the app’s group already ran.

An upgrade switches an app to another release’s code over the existing state, which the new code reads as it is: no migration runs (Upgrades & migrations). Where the operator decides, POST /ops/apps/{app}/upgrade and organization-wide runs through /ops/orgs/{org}/upgrade upgrade to a release the operator installed itself (/ops/packages, recorded as installed by operator). Otherwise each app is upgraded by its own organization: its owner and admins (OrgRole::Admin or above, SystemState::approves_upgrades), and nobody else. Not the member who created the app, a team’s lead, or a member holding MANAGE_APPLICATION; and not the publisher, for an instance of another organization, whatever the package’s manifest declares (upgrades: "owner" | "publisher", calimero_bundle::UpgradeAuthority), its key bound or not. A person approves from inside the app: its frontend reads GET /apps/{app}/update (whether a release is available, and mayApprove) and opens the consent page’s upgrade sheet. An organization’s run (POST /orgs/{org}/upgrade) and an upgrade key (Upgrade keys) need the same owner or admin; a publisher’s run (POST /orgs/{org}/packages/{package}/upgrade { version, migrate? }, by an owner or admin of the publisher) moves only the instances of the organizations its starter is an owner or admin of. Anyone else is refused 403 before any passkey, and apply refuses the entry (Feature::OwnerApprovedUpgrades, 1.0.0-rc.33; UpgradeApp, StartUpgradeRun and CreateApiKey { owner_approves }).

Until every node runs 1.0.0-rc.33, the rule before holds, and entries logged before it replay as they applied: for owner (the default) the app’s owner, or whoever holds MANAGE_APPLICATION on its team or across its organization; for publisher the publisher organization’s MANAGE_APPLICATION holders, for every instance, and nobody (409) until its key is bound.

Each acts with their own passkey step-up over the exact upgrade (consent on UpgradeApp). The declaration may only loosen toward owners: a release declaring publisher is refused once a lower version of the package declared owner (and an owner release below a publisher one), and an upgrade that would move an app from an owner release to a publisher one is refused. An owner who accepted a package as theirs to upgrade never has that taken from them by a later release.

The same owners and admins set how updates apply: an update policy for the organization or one app (POST /orgs/{org}/upgrade-policy, POST /apps/{app}/upgrade-policy, with a passkey). Every update is classified green or red (where its data may go, its signer, its state), and the class is judged again where it applies, so no node can pass a red update off as green. With secondApprover, a red update needs two distinct owners or admins: the first logs a pending approval with their own passkey (POST /apps/{app}/upgrade-approvals), the second applies it. Nothing updates on its own by default; with autoApply: noDestinations a green update that removes no method and moves none of the apps it created, of an app with no destinations (no data leaves Calimero), applies on its own once the hold has passed since the release was logged (a deployment’s instance: its offer), after a restore point. That is the policy’s authority, not the developer’s: it is judged again where it applies, and an owner or admin may undo any upgrade for a week, back to its restore point (POST /apps/{app}/undo, the one move to an older release; Updates that apply on their own).

An app’s signed manifest declares the URL prefixes it may call. A declared prefix is usable only once it is approved for the app’s publisher (the package’s pinned signer) in the app’s organization, by whoever holds MANAGE_APPLICATION across it (POST /orgs/{org}/outbound; a grant on one team is not enough, since the approval covers every app of the organization; for an account’s own apps, the owner of their organization), with a passkey step-up, or by the operator (POST /ops/outbound). The approval records both the prefixes approved and every prefix the approver was shown, so a prefix a later release adds reads as awaiting approval rather than approved. The operator additionally bounds which hosts any app may reach and holds the secrets requests may carry (App execution).

Who may install apps (signed packages from the registry or an upload, and raw bundles in development) is a rule of its own, chosen at deployment and attested with the rest (Governance::deployments, --deployments). It is kept apart from sign-up because people must sign up to use a deployer’s apps: a cluster open to anyone who reaches it can still keep the code it runs to the deployers it granted.

  • open (the default): any account installs.

  • granted: an account installs only with a live deployer grant: its own (account:<id>), or, holding MANAGE_APPLICATION organization-wide, one its organization holds (org:<id>). A grant may end (until), judged at the install’s own time, never a node’s clock. The API refuses before it fetches or stores anything (403 DEPLOY_NOT_GRANTED), and apply refuses InstallPackage and PutBundle again. The operator’s own installs need none.

    Everyone else still signs up and creates instances from a deployment’s offers, or of a release the operator installed (its catalog). Any other instance outside every offer is a live deployer’s: a customer who sees a release some other way, or a deployer whose grant was revoked, is refused (POST /apps, 403 DEPLOY_NOT_GRANTED), and so is an upgrade moving such an instance into another package (SystemState::creates_outside_offers, upgrades_outside_offers). CreateApp and UpgradeApp refuse the same where they apply once the cluster version brings offersOnly (1.0.0-rc.36); an earlier entry replays as it applied. So on a granted cluster every instance is either the operator’s catalog or attributable to a deployer.

Who grants deployers (Governance::deployers, --deployers):

  • operator (the default): the operator, signed with its key (POST /ops/deployers { deployer, until? }, DELETE /ops/deployers/{key}; cluster / __grant_deployer / { deployer, until }, __revoke_deployer / { deployer }).
  • owner: a dedicated cluster handed to its customer. The operator grants until it names the cluster’s owner, an account or an organization, once (POST /ops/cluster-owner { owner }, __cluster_owner). From then on the owner, or the owner organization’s organization-wide MANAGE_APPLICATION holders, grant and revoke with a passkey step-up (POST /deployers, DELETE /deployers/{key}, 412 first), and the operator’s signature is refused.

Revoking a grant stops new installs, deployments and offers only: what the deployer installed, and the apps running it, stay, and its deployments keep their offers, from which customers still create instances (that needs no grant). GET /deployers lists the rule, the owner and every grant, for the operator and for whoever acts for the owner.

Why owner. It lets the operator keep running a dedicated cluster’s machines without deciding who deploys on it. Every receipt key attests deployers: owner, so the customer can check from hardware quotes, without trusting the operator, that once it is named the operator’s signature grants nothing. The attested governance does not name the owner: the owner reads that, and every grant, from GET /deployers, and may revoke any grant there, including one the operator made before naming it.

A grant never lets its signer act inside a deployment: creating one, offering, withdrawing and deleting each carry a manager’s own passkey consent (Deployments), which the operator’s key cannot make.

Where deployments are granted, creating a deployment and offering an app in one need the same grant, held by the account acting.

Read it top to bottom: the operator grants until it names the cluster’s owner (only where deployers: owner), the owner grants with a passkey from then on, and an install goes ahead only for an account whose grant is live at the install’s own time.

The governance JSON names deployments and deployers only when they are not the defaults, after the other three fields, so a cluster deployed with the defaults attests the same bytes as before ({"releases":"owner","appUpgrades":"owner","outbound":"owner"}). A client that recomputes the receipt-key binding must keep both fields, in that order, when the attested object carries them.

Who may create an account (Governance::sign_up, --sign-up), checked by CreateAccount at apply (SystemState::admits), so a leader cannot let anyone else in:

  • open (the default): anyone who reaches the cluster.
  • invite: someone presenting an organization invite (the account joins the organization at the invite’s role, the invite spent once) or a cluster sign-up invite.
  • closed: someone presenting a cluster sign-up invite only, the pre-authorization of whoever runs sign-up.

An invite rides on CreateAccount { invite: { inviteKey, now, signature } }: the signature is the token key’s over the new account id and now (proof::sign_invite_redeem, the redemption an organization invite already uses), so only the node the person handed the token to can make it, and it is spent once (used_proofs). Its expiry is judged at the signed now. An unknown, expired or used-up invite is refused on every policy, before anything changes.

Cluster sign-up invites (SystemState::sign_up_invites, by the token’s public key; CreateSignUpInvite, RevokeSignUpInvite) and the policy itself (SetSignUp) are run by one party: the operator, with its key, until the operator names the cluster’s owner where deployers: owner; then whoever acts for the owner, with a passkey, and never the operator (SystemState::runs_sign_up). Statements: cluster / __sign_up / { policy }, __create_sign_up_invite / { inviteKey, uses, expiresAt }, __revoke_sign_up_invite / { inviteKey }. Routes: Sign-up policy.

The governance JSON names signUp only when it is not open, after deployers; a cluster from before reads as open.

A deployment is an owner’s list of the apps it offers on the cluster (SystemState::deployments): an id, a name customers see, an owner (an account, or an organization) and, per app name, the one installed release it offers (package@version). Customers create instances from its offers; the releases themselves are stored once and may be offered by several deployments, each independent of the others. A developer’s walk-through, from creating one to withdrawing an offer: Offer your app to customers.

the developer offers releases; each customer owns its instancesdeveloper: account or orgmanagers: the account, or org-wideMANAGE_APPLICATION holdersownsdeployment "Chat"own host {dlabel}.{apps-domain}offers: app → package@versionchat → chat@1.2.0wiki → wiki@0.4.0secret values (sealed)NEAR_AI_API_KEY = ••••names its releases declare or useusage: developer = this owner(org id, or account:{id})customer org "Globex"owns its instances: owner, grants, data, quotasinstance "Support"runs chat@1.2.0owner: dana · deployment: Chatcreated with it (uses: create)Support.kv (store)Support.ai (inference)same org, owner, deployment;deleted with the instanceusage labels, every app of it:org = Globex (pays, quotas)developer = Chat's owner (billed)the developer has no path into its datacustomer org "Initech""Notes" runs wiki@0.4.0never sees Globex──▸ a customer creates an instance from an offer: POST /apps { deployment, package }- - ▸ secret values: only names the running release declares, only for code of a package the deployment offers or uses, only to the secret's declared hostsAn instance moves only to the release its deployment offers (409 OUTSIDE_DEPLOYMENT).

The developer’s side (left) holds the offers and the secret values; every instance, with the apps its release creates, sits in the customer’s organization (right), which owns and governs it, and its usage is labelled with both.

Who manages it: for an account owner, that account; for an organization, whoever holds MANAGE_APPLICATION there organization-wide (the owner and admins included). Each change carries the actor’s own passkey consent, verified where it applies on every node, and is judged against the state it applies to, so a member whose capability was withdrawn, or who left, can no longer change it. The deployment lists no managers (it records only who created it and who added each offer): they are read from the owning organization, so one change there covers every deployment it owns, and a teammate’s passkey stays on their own account. The operator’s key signs none of these changes:

Change Route Consent statement Rule at apply
Create POST /deployments { name, owner } cluster / __create_deployment / { name, owner } The actor acts for owner; a live grant where deployments are granted; an organization owner holds a recovery key (below); at most 16 per owner. Its id is derived from the consent’s nonce, so no node picks another
Offer POST /deployments/{id}/apps { app, package, version } deployment:{id} / __offer_app / { app, package, version } A manager who sees the release, installed already; a live grant where granted; adds the entry or moves it to another release of its package; at most 64 apps
Withdraw DELETE /deployments/{id}/apps/{app} deployment:{id} / __withdraw_app / { app } A manager; refused while an instance created from this deployment runs that app’s package. The release stays installed
Delete DELETE /deployments/{id} deployment:{id} / __delete_deployment / {} A manager; only once it offers nothing and no instance came from it. Its secret values go with it
Set a secret PUT /deployments/{id}/secrets/{name} { value } deployment:{id} / __set_secret / { name, fingerprint } A manager; a name a release it offers declares, or a release one of those references in its uses (an installed release of the package in the reference’s range; deploymentUsedSecrets, rc.32) (404 UNDECLARED_SECRET), a value of 1 to 4,096 bytes; at most 16 per deployment and 4,096 in the cluster. The consent names the value’s fingerprint, which apply works out again from the value, never the value itself
Clear a secret DELETE /deployments/{id}/secrets/{name} deployment:{id} / __clear_secret / { name } A manager; only a value it holds

Each answers 412 CONFIRM_REQUIRED first. An organization that owns a deployment is not deleted until the deployment is.

Recovery key: if every manager lost every passkey, nobody could change the deployment again and its customers would stay on its last offer for good. So an organization owns a deployment only while it can be recovered: creating one for an organization without a recovery key is 409 RECOVERY_KEY_REQUIRED, and so is removing the key (POST /orgs/{org}/recovery { publicKey: null }) while it owns one; rotating it stays allowed, and no member change is ever blocked. The owner keeps the seed offline. Both refusals come before the passkey, and apply judges them again (deploymentNeedsRecovery, 1.0.0-rc.38); an entry logged below that version replays as it applied, and an organization that already owns a deployment without a key is refused nothing until it creates another or would remove a key it later sets. An account’s deployment needs no key.

Transfer: a deployment changes hands in two steps, from any owner to any other. Its owner account, or an owner or admin of its organization, offers it (MANAGE_APPLICATION manages a deployment but does not hand it over; POST /deployments/{id}/transfer { to }, deployment:{id} / __offer_deployment / { to }) to an account or organization that exists and does not own it already; one offer waits at a time (409 TRANSFER_PENDING), and a lapsed one may be replaced. A manager of to accepts it within 7 days (POST /deployments/{id}/transfer/accept { to }, deployment:{id} / __accept_deployment / { to, offeredAt }, bound to that one offer), and only while whoever offered it may still hand it over (409 TRANSFER_STALE: removed, their role lowered, or the organization recovered by another owner). The receiver needs a live deployer grant of its own where deployments are granted, a recovery key if it is an organization, room for one more deployment, and the use of every release the deployment offers (409 OFFERS_NOT_USABLE otherwise: a private release serves an offer only while its owner may use it, so its customers would get no updates). A manager of either side cancels a waiting offer (DELETE /deployments/{id}/transfer), and deleting the deployment drops it; GET /deployments lists offers waiting for the caller under offered. The id, name, offers and customers’ instances stay, and only the owner changes (a transfer never renames it); the deployment records its last hand-over (Deployment::transferred: from whom, and when); the previous owner’s secret values are dropped (the new owner sets its own: an offer it makes could otherwise send them to a host of its choosing). Customers are not asked: from the hand-over, their update sheets say who now runs the deployment and whom it came from, until a person approves an update of the instance themselves (AppRecord::owner_seen_at; an upgrade key’s, a run’s or the operator’s does not count), and until then no update applies to it on its own (SystemState::handed_over_unseen). deploymentTransfer, 1.0.0-rc.38.

Instances: POST /apps { deployment, package, version?, service?, … } creates an instance from the release the deployment offers for that package (version, if given, must be it), whether or not the creator sees the release otherwise, and without a deployer grant: nothing is installed. An offer serves (here, and for an upgrade to it) only while someone who acts for the deployment’s owner may still use the release; otherwise the deployment answers as one that does not offer the package (400 NOT_OFFERED), and instances made before keep running. The instance records the deployment (AppRecord::deployment), and CreateApp checks again where it applies that the deployment exists and offers the release the instance runs. Instances created without a deployment, and those from before, record none. The apps a release creates with its instance (its create references, the instance’s unit) record the instance’s deployment too: the offer of the instance’s release covers them, and their CreateApp names that offer (unit_offer), which apply checks the deployment still offers. Deleting the instance deletes them (DeleteApp { members }); members created before 1.0.0-rc.32 record no deployment.

Upgrades: the deployment’s managers decide which release its instances run; an instance’s owner only accepts it. POST /apps/{app}/upgrade of an instance from a deployment resolves its target from the deployment’s offer for the package the instance runs (a version, when named, must be that release; naming none accepts it), whether or not the owner sees the release otherwise. Another version, another package or a raw bundle is refused 409 OUTSIDE_DEPLOYMENT before the step-up, and an organization’s, publisher’s or unit’s run notes such an instance as failed. UpgradeApp refuses the same where it applies (SystemState::within_deployment) for an entry that says so (in_deployment, set once the cluster version brings upgradeInDeployment, 1.0.0-rc.32) or once the logged cluster version brings the rule; an earlier entry replays as it applied. An offer moves an instance (one app, any run, the operator’s, an update on its own) only while someone who acts for the deployment’s owner may still use the release it names; from the logged cluster version that brings privateReleases, apply judges the same.

Secrets: a value a manager sets for a secret its offered releases declare is the value the node attaches where the release binds NAME, for every instance created from the deployment that set no value of its own (PUT /apps/{app}/secrets/{name}), and goes before the operator’s: the instance’s value, then the deployment’s, then the operator’s. Only for a name the release the instance runs declares, only for a run of a release of a package the deployment offers (any version: a package’s signer is pinned, so only its publisher signs releases of it; SystemState::deployment_covers), and only into a request to that secret’s declared hosts. The managers set the value for the code they offer: an instance whose record somehow ran other code, a customer’s own package declaring the same name for a host they chose, gets no deployment value. It is kept in the system group’s state (sealed at rest, inside attested nodes, like an instance’s own value, which travels in its app’s log), read by the outbound gate on the node that runs the request, and never answered: GET /deployments/{id}/secrets gives its managers each name’s fingerprint, who set it and when, and an instance’s GET /apps/{app}/secrets says only source: deployment. A value whose name no offered release declares any more (an offer withdrawn or moved to a release without it) is kept, unused, until a manager clears it. Needs cluster version 1.0.0-rc.32 (deploymentSecrets).

A deployment may also hold a value for a secret that a release one of its offered releases references (uses) declares: an installed release of the referenced package inside the reference’s range. Apply judges it from the system state, which keeps each release’s references (PackageVersion::uses) once every node does (deploymentUsedSecrets, 1.0.0-rc.32; a release installed before records none until it is installed again). An app an instance creates with it (mode: create) that carries the deployment reads that value for a name its own release declares, only to its declared hosts; the instance itself, whose release does not declare it, never gets it.

attaching a bound secret NAME to one run's requesta run sends to HOSTan instance or aunit memberits release binds NAME there1 · the instance'sPUT /apps/{app}/secrets/{name}in the app's own logelse2 · its deployment'sPUT /deployments/{id}/…only if the run's package isone the deployment coverselse3 · the operator's[outbound] env_secretsor secrets serviceelse: nothingthe outbound gate, on the node that runs itattached by the node in NAME's one header or body fieldthe app setting that place, or {{secret:…}}: refusedthe response, each copy of the value → [redacted]

Each step is tried only for a name the running release declares; the first value found is used, and the gate still sends it only to that secret’s declared hosts.

Customers see who offers it: the install and update sheets of an instance created from a deployment, and GET /apps/{app}/update, name the deployment with its id and its owner’s kind and name (“Offered by acme-labs, run by the organization Acme Labs”). Names are not unique, so the id and the owner always come with the name. An instance from no deployment names none. This is read-only: nothing new is logged.

Releases: DELETE /packages/{p}[/{v}] is refused for a release any deployment offers, whoever installed it first; a release no deployment offers keeps the rules it had (its first installer uninstalls it once no app runs it). Records from before deployments are not moved into one: attaching an old install would bind its customer to a deployer they never chose, so a customer who wants a deployer’s offer creates an instance from it.

Reads:

  • GET /deployments: the deployments the caller manages.
  • GET /deployments/{id}: public by id: its name, its frontend host, its owner’s kind and name, and the apps it offers with their releases. Never its managers or customers.
  • GET /deployments/{id}/orgs: for its managers, on fresh state: each organization with instances created from it, with its id and name, how many, which of the deployment’s apps and the releases they run (as each instance’s record names them, never a release found by its WASM), and when the first was created, and memberCount and activeMembers30d (members whose last sign-in or session exchange is within 30 days). Never who the members are, teams, instance names or app data; below cluster version 1.0.0-rc.32 (ordinaryOrgs), instances in a personal organization are only counted (outsideOrgs). Another deployment’s customers never appear, even on the same release. An organization is a customer only through its instances: the listing is worked out from the instances that record the deployment, so deleting its last one ends it, with no other record to undo: the customer stays in control of it.
  • GET /deployments/{id}/secrets: for its managers, on fresh state: every secret its offered releases, or the releases they reference, declare and every one it holds a value of, with the offered apps that reach it, the releases that declare it (declaredBy: [{ package, version }]) and, when set, its fingerprint, setBy and setAt. Never a value.

Frontends open at a deployment’s release with /d/{deployment}/, or on the deployment’s own host, {dlabel}.{apps-domain}, which POST /deployments and the reads above return as host (Deployment hosts).

Before approving, the approver needs to see what is waiting. Read-only reports show it, each paged (?after=ID&limit=N, at most 100 per page):

  • An organization’s members: GET /orgs/{org}/apps (any member; 404 to anyone else, as GET /orgs/{org}).
  • An account, for its own apps: GET /auth/apps: the apps it owns in any organization (scope { kind: "account" }; the top-level approvedReleases are its only organization’s (below cluster version 1.0.0-rc.32 its personal organization’s), and each app’s own set is in its entry). An app’s frontend (a session bound to its package) reads only that package’s apps, so a developer’s app can tell its users that a release waits for their approval.
  • The operator: GET /ops/apps and GET /ops/orgs, without names or accounts (The operator).

Each answers the governance, the scope’s approved releases (null: none ever recorded, which leaves the apps unrestricted), the releases the cluster’s nodes run with whether each is approved (so “2.3.131 runs here, not approved yet” is one read), and per app:

  • its release (the one the instance was created at or last upgraded to, so releases sharing a WASM are told apart), and its publisher: the package’s pinned signer and, once the key is bound, the organization it is bound to (publisher.org);
  • releasesApprovedBy: whose approvals decide which releases hold it: operator, publisher (a bound key) or owner (the app’s own organization). The app’s approvedReleases is that party’s set, which for a publisher’s package is not the scope’s own;
  • upgradesHeldBy: who upgrades it: operator, else owner (the owner and admins of its organization; before 1.0.0-rc.33, what its release’s manifest declares, owner or publisher);
  • newer releases it could upgrade to (one with the same WASM included: its frontend may differ), its last upgrade (each end’s release) with the actor’s kind (owner, member, operator), and each replica’s release and whether it is approved.

The scope’s own approvedReleases and clusterReleases describe the organization’s own set (for /auth/apps, the account’s only organization’s): the one that governs its raw uploads, its unbound packages and, as a publisher, every instance of its packages.

Approving and upgrading stay passkey decisions on the cluster’s own origin: a session bound to an app’s frontend is refused the approval routes (403), so an app sends its user to the node’s consent page, below.

Where owners decide, an app often needs its user to make one of these decisions: a new version of the app is out, a feature needs an outbound host, the operator rolled a new image. The app cannot run the passkey ceremony itself: an assertion is blind, so the page that asks for it decides what the person thinks they approve, and an app’s page is the publisher’s code. A session opened on an app’s frontend is refused every approval route.

Instead the app asks the node (POST /consent/requests), and the node serves a consent page of its own, on its own origin, that shows what is being approved from node-side data only (for an upgrade, a capability sheet diffed from the two signed manifests), asks for the passkey there, and sends the person back to the app with the result. The consent then binds the release’s measurements digest or the target’s signed-manifest hash, not just a version. See The consent page.

Giving the operator a decision is giving it the power to put new code, a new image or a new destination in front of user data. The choice is the deployment’s, made once, and visible to every user who verifies the cluster.

Where the node implements this chapter, by the names in its code: paths are under crates/node/src unless another crate is named. The design and its reasons are above; a module’s own detail is in its //! doc, and the node’s mental model is crates/node/AGENTS.md.

Code: system::Governance, Authority, shared with clients in calimero_client::attest.

  • The first leader writes SystemCmd::Genesis before any account exists (CreateAccount waits for it); a second genesis is refused.
  • Every receipt-key quote binds it (receipt_key_binding(key, governance, cluster, node), AttestationDoc::governance), so verify_app_cluster proves it.
  • Node::attest_issuer requires that bound form. It takes a peer’s unbound receipt-key.v2 quote only while the logged cluster version is below RECEIPT_KEY_BOUND_SINCE (takes_unbound_receipt_key).
  • Operator routes: POST /ops/releases (operator_releases, answered by approved_releases), POST /ops/apps/{app}/upgrade (UpgradeApp { by_operator }), POST /ops/outbound (operator_outbound, ReleaseScope::Cluster).
  • The operator’s installs (/ops/packages, /ops/packages/install) are recorded as system::OPERATOR, which no account can be and no account quota counts; it deletes only what it installed.
  • Governance::deployments and deployers are left out of the governance JSON when default, so a default cluster attests the bytes it did before.
  • The one change after genesis is SetDeploymentsGranted (open to granted, operator-signed, never back).

Code: SystemState::approved_for_release.

  • BindPublisher verifies the key’s signature over system::publisher_binding_message at apply, against SystemMachine::cluster (the node’s --cluster), not the command’s own cluster.
  • Each binding bumps the key’s generation, so a signature never replays; bindings live in SystemState::publishers.
  • DeleteOrg unbinds the org’s keys and keeps their generations (SystemState::unbound_publishers), so a later org with the same id is not their publisher.
  • PackageRecord::owner is only the first installer, never the publisher.
  • Approvers hold caps::APPROVE_RELEASES (SystemState::approves_releases).
  • Node::may_send refuses Raft entries and snapshots to a peer whose attested release (HttpAttestor::seen_release, read through Node::release_at) group_may_hold does not allow. Node::place skips such nodes, and /ops/apps/{app}/replicas refuses them.
  • SystemState::approves_upgrades (OrgRole::Admin or above) holds under Feature::OwnerApprovedUpgrades, whatever PackageVersion::upgrades (calimero_bundle::UpgradeAuthority) says.
  • SystemState::may_upgrade(app, account, owner_approves) decides. UpgradeApp, StartUpgradeRun (its starter) and CreateApiKey judge it when owner_approves is set or the cluster version brings it (SystemState::owner_approves; NOT_AN_UPGRADE_APPROVER).
  • The API asks api::owner_approves (through require_features) and refuses 403 before the step-up (api::upgrade_refusal, run_refusal for runs).
  • The rule is not in hold_to_current_rules: an entry logged below the version replays under the earlier rule (SystemState::manages_apps for owner; the publisher’s org-wide holders for publisher).
  • SystemState::manages_apps still gates outbound approvals, backup keys and deployers.
  • Authority only loosens toward owners: PackageRecord::upgrades_in_order at install and SystemState::upgrade_keeps_authority at upgrade.
  • run_upgrade judges who and where before anything runs on the app’s group.

Code: SystemState::governing_release, governing.

  • Without AppRecord::release, the bundle’s recorded release counts only if installed by the time the app took the bundle (created_at, or its last successful upgrade’s at).
  • SHIPS_IN_OTHER_PACKAGE (409, verify_release) enforces one signer per WASM.
  • Both rules hold once SystemState::attributes_by_release is set by the AttributeByRelease mark the system leader writes from reconcile.

Code: SetReleaseDeadline, SystemState::release_deadlines.

  • Routes: POST|DELETE /ops/releases/{version}/deadline (operator key, __release_deadline; after: null lifts it).
  • A stalled party is judged by SystemState::stalled_for_release and install_stalled (409 RELEASE_DEADLINE, node::stalled); placement skips SystemState::retired nodes.
  • A registry install judges the package’s pinned key only for an installer that may use the package (package_used), else as unbound.
  • run_upgrade stamps at before the upgrade runs, so apply judges the same time.

Code: SystemState::deployers, cluster_owner, may_deploy.

  • Node::refuse_undeployable refuses before any fetch, verification or store, in install_from_registry, install_upload and POST /bundles (403 DEPLOY_NOT_GRANTED).
  • apply refuses again with system::NOT_A_DEPLOYER.
  • SystemState::creates_outside_offers decides who may create outside an offer; CreateApp { offers_only } (Feature::OffersOnly) applies it.
  • SystemState::upgrades_outside_offers applies the same rule to UpgradeApp, the operator’s excepted.
  • GrantDeployer and RevokeDeployer are signed by the operator until SetClusterOwner. From then on the owner side grants with a passkey, and SystemState::deployers_owner makes authorize refuse the operator’s signature.
  • The grant’s at is not signed: the 428 and the signed retry are two requests.

Code: Governance::sign_up, left out of the governance JSON when open.

  • CreateAccount { invite } is judged at apply by SystemState::admits; an invite presented is checked under every policy.
  • The invite is a SignUpRedemption { inviteKey, now, signature } (proof::sign_invite_redeem over the new account), spent in used_proofs.
  • Refusals are Rejection::sign_up (403 SIGN_UP_REFUSED).
  • api::refuse_sign_up refuses register/begin and register/finish first, on fresh state; the finish refuses before its challenge is spent.
  • SystemState::sign_up_invites is bounded by MAX_SIGN_UP_INVITES and MAX_SIGN_UP_INVITE_USES.
  • SystemState::runs_sign_up says who runs the invites and SetSignUp: the operator until the owner is named, then the owner.