> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Cognite Data Fusion (CDF) is an industrial DataOps platform. Prefer English docs unless the user asks for another locale.
> Follow /_llms/ index links recursively until you reach page URLs ending in .md. Fetch those Markdown twins instead of HTML.
> For REST APIs, default to calendar version 20230101 (stable). Use 20230101-beta or 20230101-alpha only if the user is on a preview API. Cite paths under /api-reference/concepts/<version>/ and the Cdf-Version header. Prefer the Python SDK (cognite-sdk) unless the user is in JavaScript/TypeScript.
> Start here by task: platform overview /cdf/index.md; data modeling /cdf/dm/index.md; data integration /cdf/integration/index.md; access /cdf/access/index.md; CDF Toolkit /cdf/deploy/cdf_toolkit/index.md; REST quickstart /dev/quickstart.md; Python SDK https://cognite-sdk-python.readthedocs-hosted.com/en/stable/; Atlas AI /cdf/atlas_ai/concepts/index.md; Flows apps /cdf/flows/index.md; MCP and IDE setup /dev/guides/ide_ai_integration.md.
> For implementation work, also load /skill.md.

# Signing Flows custom apps from the CLI

> Step-by-step guide to generate signing keys, sign Flows custom app bundles, and publish signed deployments with the Cognite CLI.

Signing a Flows custom app proves who built the bundle and binds the signature to the exact bytes deployed. The platform rejects the version if anything in the bundle changes after signing, or if the signing key isn't registered.

This guide has two parts. First, generate and register a signing key. Then upload, sign, and publish each version of the app.

Use this guide if you're a certified Flows builder and you publish custom apps with the Cognite CLI.

> [!NOTE]
>
> To sign from a pipeline rather than your own machine, see [Signing Flows custom apps from CI/CD](https://docs.cognite.com/cdf/flows/guides/code-signing-cicd.md).

## Signatures required to publish

Every publish needs a **developer signature**. Projects with [**Dev status**](https://docs.cognite.com/cdf/flows/guides/dev-status.md) need only that signature. Production **Cognite Data Fusion (CDF)** projects without Dev status need **both** that signature and Cognite's **app certification signature** (`.cert.sig`) from [Application certification](https://docs.cognite.com/cdf/flows/guides/application-certification.md). Each signature is tied to the exact bundle bytes. This guide covers the developer signature only.

| Signature | What it proves |
| - | - |
| Developer signature | A certified developer built this bundle for this CDF project. |
| App certification signature | Cognite has reviewed and approved this production bundle. |

[Request Dev status](https://docs.cognite.com/cdf/flows/guides/dev-status.md) before you publish to a non-production project.

## Prerequisites

* The latest Cognite CLI (`npx @cognite/cli@latest`).
* A Flows custom app with `app.json` (with `infra` set to `appsApi`).
* Access to the CDF project you'll deploy to.
* [Builder certification](https://docs.cognite.com/cdf/flows/guides/builder-certification.md), or signing instructions from the team reviewing your app.
* [Application certification](https://docs.cognite.com/cdf/flows/guides/application-certification.md) if you're publishing to a production project and need Cognite's `.cert.sig`.

> [!NOTE]
>
> A developer signature is not the same as [application certification](https://docs.cognite.com/cdf/flows/guides/application-certification.md). Production apps still need Cognite's application certification signature before they can be published to production projects.

## Generate and register a signing key

Do this after you claim the [builder certificate](https://docs.cognite.com/cdf/flows/guides/builder-certification.md). Every publish needs a developer signature from a key that Cognite has registered. Generate a signing key and submit the Zendesk URL that the CLI prints. You need one registered key to publish apps to any CDF project.

**1. Generate a signing key**

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest keys generate --interactive
```

When prompted for a key ID (`kid`), give the key a short name for this machine, such as `juno-laptop`. The key expires in **12 months**. On macOS, the private key goes in **Keychain** (a password prompt is expected). On Windows, it goes in **Credential Manager**. Don't email the `.pub.pem` file. The Zendesk URL already includes the public key.

These flags change how the CLI collects the name and how you get the Zendesk URL.

| Flag | What it does |
| - | - |
| `--interactive` | Prompts you to **Open in browser** or **Copy link**. Opens a pre-filled Zendesk form. Does not submit the form. |
| `--copy-link` | Copies the Zendesk URL with no prompt. |
| `--kid` | Sets the key ID. Use a short name for this machine. |
| `--email` | Sets the email address on the Zendesk form. |

If you pass `--kid` and `--email` together, the CLI skips prompts and prints the URL plus a YAML block. Use the URL. Don't paste YAML into a blank ticket.

> [!WARNING]
>
> The private key stays on your machine. Don't share it, commit it, export it from Keychain, or send it to Cognite.

**2. Register the public key**

Submit the Zendesk form from the URL that `keys generate` printed. Don't paste YAML into a blank ticket.

Support checks that you completed the **hands-on workshop**, then replies when they add the key. New keys become available on weekdays during business hours in Central European Time (CET).

Until then, `apps sign` and `apps publish` can fail with a 403 that mentions CDF capabilities, and `apps status` can show `KEY_NOT_IN_REGISTRY`. That 403 message is generic. It is not an access problem. See [403: signing key is not in the public key registry](#403-signing-key-is-not-in-the-public-key-registry).

> [!TIP]
>
> When support has added the key and it is available, you can publish apps with a developer signature.

## Upload, sign, and publish the app

After your public key is registered, use these steps to upload, sign, and publish each version of the app.

**1. Build and upload**

From your app folder:

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npm run build
npx @cognite/cli@latest apps deploy --interactive
```

`apps deploy` packages `dist/`, uploads it as a DRAFT, and keeps a copy of the exact bytes at `.cognite-bundles/<externalId>-<versionTag>.zip` so signing operates on what the platform actually received. The app scaffold gitignores `.cognite-bundles/`. Don't commit bundle files from that folder.

**2. Sign the bundle**

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest apps sign
```

With no arguments, `apps sign` uses `externalId` and `versionTag` from `app.json`. It finds the matching `.cognite-bundles/<app>-<version>.zip`, writes `<bundle>.dev.sig` next to it, and submits the signature to the platform. Override with `--signing-identity <kid>`, `--scope <org>/<project>`, or an explicit bundle path.

Run `apps status` to verify the signature was accepted before you publish.

> [!TIP]
>
> Commit before signing so the source-to-signature link stays auditable. Tag the commit with the app version:
>
> ```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
> git tag "v$(jq -r .versionTag app.json)" -m "Signed deployment"
> git push origin --tags
> ```

**3. Publish**

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest apps publish .
```

`apps publish` transitions the version from DRAFT to PUBLISHED. Signatures were already submitted by `apps sign`; publish re-submits any local `.dev.sig` (and `.cert.sig` if present) as a safety net, then flips the lifecycle state.

**4. Confirm**

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest apps status .
```

The command shows the lifecycle state and every signature the platform has on record for the current version. Each entry includes the signing identity (`kid`), the role (`developer` or `certifier`), the time the signature was issued, and the platform's verdict.

You'll see one of three shapes depending on where you are in the flow:

Before `apps deploy`:

```text theme={"languages":{"custom":["/_languages/kuiper.json"]}}
Status:  not deployed yet

Run `npx @cognite/cli apps deploy` to upload this version.
```

After `apps deploy`, before `apps sign` + `apps publish`:

```text theme={"languages":{"custom":["/_languages/kuiper.json"]}}
Status:  DRAFT

Signatures: none stored

Run `npx @cognite/cli apps publish .` to publish this version.
```

After a clean publish:

```text theme={"languages":{"custom":["/_languages/kuiper.json"]}}
App:     Sign Test App (sign-test-app)
Version: 0.0.3  (local)
Status:  PUBLISHED

Signatures:
  acme-dev-001    (developer, signed 2026-05-27T13:22:37.000Z) — VALID
  cognite-cert-1  (certifier, signed 2026-05-27T13:25:10.000Z) — VALID
```

A verdict other than `VALID` means the platform won't accept that signature for serve-time verification. The verdict table explains each result and what to do.

| Verdict | What it means | What to do |
| - | - | - |
| `VALID` | Signature verifies and the key is in the registry and in date. | Nothing — this is the expected state. |
| `REVOKED` | The signing key has been revoked since the signature was submitted. | Re-sign with a current key, then publish a new version. |
| `EXPIRED` | The signing key was in date when signed, but has since expired. | Rotate the key (see [Rotate or replace a key](#rotate-or-replace-a-key)) and re-sign. |
| `SIGNED_BEFORE_KEY_ISSUED` | The signature's `iat` timestamp predates the key's registration. Clock skew, or a stale key. | Re-sign with the current system clock. If the clock is correct, contact Cognite. |
| `IAT_IN_FUTURE` | The signature's `iat` timestamp is in the future. Usually clock skew on the signing machine. | Fix the signing machine's clock, then re-sign and re-publish. |
| `BUNDLE_TOO_OLD` | The bundle's signature is older than the platform's minimum-age policy. | Re-sign the current bundle and re-publish. |
| `KEY_NOT_IN_REGISTRY` | The `kid` isn't in the public key registry, or isn't available yet. | Confirm the `kid` with `keys list`. Wait until the key is available on a weekday during business hours, CET, then run `apps publish` again. See [403: signing key is not in the public key registry](#403-signing-key-is-not-in-the-public-key-registry). |

> [!TIP]
>
> Verify the version is **PUBLISHED** and your developer signature appears as `VALID` for the expected `kid`. Anything else needs action before the version will serve.

## Production certification (Cognite signature)

Production CDF projects without [Dev status](https://docs.cognite.com/cdf/flows/guides/dev-status.md) need both a developer signature and an app certification signature. The two signatures are independent. Cognite signs the same bundle bytes with their own key and returns the signature to you. Complete the [Upload, sign, and publish the app](#upload-sign-and-publish-the-app) steps through **Sign the bundle**, then add these steps before you publish the application:

**1. Submit the app for review**

From your app folder, on a clean commit:

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest apps submit
```

`apps submit` packages a source archive (`src-<sha>.zip`), copies the deploy bundle into `dist/submit/`, and opens a pre-filled Zendesk request with the app metadata. Attach everything in `dist/submit/` plus a screen recording of the app, then submit.

> [!NOTE]
>
> The command will fail if your working tree has uncommitted changes — the source archive has to match the committed code exactly. Commit first, then re-run.

**2. Receive the certification signature from Cognite**

After Cognite reviews and approves the bundle, your Zendesk contact replies with a `.cert.sig` file. Save it to your app's `.cognite-bundles/` folder next to the deploy bundle, named `<externalId>-<versionTag>.cert.sig`.

For example, for app `sign-test-app` version `0.0.3`:

```text theme={"languages":{"custom":["/_languages/kuiper.json"]}}
.cognite-bundles/
  sign-test-app-0.0.3.zip          ← created by apps deploy
  sign-test-app-0.0.3.zip.dev.sig  ← created by apps sign
  sign-test-app-0.0.3.zip.cert.sig ← from Cognite, save here
```

To open `.cognite-bundles/` in your file manager from the app folder:

> [tab] macOS
>
> ```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
> open .cognite-bundles
> ```

> [tab] Windows
>
> ```powershell theme={"languages":{"custom":["/_languages/kuiper.json"]}}
> explorer .cognite-bundles
> ```

> [tab] Linux
>
> ```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
> xdg-open .cognite-bundles
> ```

Don't commit `.cert.sig` to git. The scaffold gitignores `.cognite-bundles/` for this reason.

**3. Publish**

```bash theme={"languages":{"custom":["/_languages/kuiper.json"]}}
npx @cognite/cli@latest apps publish .
```

`apps publish` picks up both `.dev.sig` and `.cert.sig`, submits the certifier signature, and transitions the version to PUBLISHED.

Run `apps status .` to confirm both signatures show as `VALID`.

## Sign again when the bundle changes

The signature is bound to the exact bytes of the bundle. Anything that changes the bundle invalidates the signature:

* Re-running `npm run build`
* Editing files in `dist/` or `manifest.json`
* Bumping the app version

Re-run `apps deploy`, `apps sign`, and `apps publish` in order. `deploy` overwrites the bundle file at the same path, so the next `sign` picks up the new bytes automatically.

## Rotate or replace a key

Generate a new key when the old one expires, you move to a new machine, or you suspect the private key is compromised:

1. `npx @cognite/cli@latest keys generate --interactive`.
2. Register the new public key.
3. Sign new bundles with the new key.
4. Ask your Cognite contact to revoke the old key if needed.

Previously published apps stay published. Rotating your local key doesn't invalidate signatures already accepted by the platform.

Keys are valid for 12 months by default. Set a calendar reminder for nine months out so you renew before signing starts failing, or ask Cognite in a Zendesk ticket to extend the key's validity.

## Troubleshooting

> [accordion] No signing identities were found
>
> Run `npx @cognite/cli@latest keys generate --interactive`, then retry the signing command.

> [accordion] Publish fails with `bundle hash mismatch`
>
> The bytes you signed don't match what the platform received. Run these commands in order:
>
> 1. `npx @cognite/cli@latest apps deploy` — refreshes `.cognite-bundles/<app>-<version>.zip` with the bytes the platform has.
> 2. `npx @cognite/cli@latest apps sign` — signs the refreshed bundle.
> 3. `npx @cognite/cli@latest apps publish .` — submits the new signature.
>
> Don't manually repackage the bundle.

> [accordion] `apps status` shows `KEY_NOT_IN_REGISTRY`
>
> The key isn't in the registry yet. Wait until the key is available on a weekday during business hours, CET. Then run `apps publish` again. `apps sign` already wrote `.dev.sig`, so you don't need to sign again. If you signed with a different key, or `apps sign` or `apps publish` returned 403, see [403: signing key is not in the public key registry](#403-signing-key-is-not-in-the-public-key-registry).

> [accordion] 403: signing key is not in the public key registry
>
> If `apps sign` or `apps publish` fails with:
>
> ```text theme={"languages":{"custom":["/_languages/kuiper.json"]}}
> signature (role=developer, kid=jsmith-dev-001): signing key used to create the signature is not in the public key registry. | code: 403 | X-Request-ID: ...
>   You don't have the required CDF capabilities. Please contact your CDF admin.
> ```
>
> The first line is the cause: that `kid` isn't in the public key registry. The second sentence is a generic message the CLI shows for any 403. It is not an access problem. Don't contact your CDF project admin for this error.
>
> Either you signed with a **different local key** than the one you registered, or the registered key **is not available yet**. Run `npx @cognite/cli@latest keys list`. If you signed with the wrong key, run `apps sign` again with `--signing-identity <kid>`, then run `apps publish`. If you used the registered key, wait until the key is available on a weekday during business hours, CET, then run `apps publish` again. `apps sign` writes the `.dev.sig` file before it sends the signature. `apps publish` sends that same file, so you don't need to sign again.
>
> If the error continues during business hours, CET, contact Cognite support.

> [accordion] `apps status` shows `IAT_IN_FUTURE` or `SIGNED_BEFORE_KEY_ISSUED`
>
> The signature timestamp doesn't line up with the key's registration window. Almost always clock skew on the signing machine. Make sure your system clock is correct, then re-run `apps sign` and `apps publish`.

> [accordion] Publish fails with `two signatures required`
>
> You're targeting a production project that requires both a developer and an app certification signature. Follow [Production certification](#production-certification-cognite-signature) to submit for review and add the `.cert.sig` Cognite returns.

> [accordion] Multiple signing keys
>
> Run `npx @cognite/cli@latest keys list`, find the correct `kid`, and pass it with `--signing-identity <kid>`.

> [accordion] Lost access to Mac or Keychain
>
> Generate a new key on the replacement machine and register the public key. Ask your Cognite contact to revoke the old key if it may be compromised.

## Related topics

* [Becoming a certified Flows custom apps builder](https://docs.cognite.com/cdf/flows/guides/builder-certification.md)
* [Certifying a Flows custom app for production](https://docs.cognite.com/cdf/flows/guides/application-certification.md)
* [Signing Flows custom apps from CI/CD](https://docs.cognite.com/cdf/flows/guides/code-signing-cicd.md)
* [Deploying Flows custom apps](https://docs.cognite.com/cdf/flows/guides/deploying.md)
* [Dev status](https://docs.cognite.com/cdf/flows/guides/dev-status.md)
* [Flows custom apps quality guidelines](https://docs.cognite.com/cdf/flows/guides/quality-guidelines.md)
