<!-- AANCER developer pages, part 3 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Signing

### The aancer-pack CLI

The `aancer-pack` CLI is a compiled binary for Linux (x64, arm64), macOS (Apple silicon, Intel) and Windows (x64). It needs no other runtime. Each download comes with its licence notices, SHA256 checksums and a signature. It is available to partners and builders on request: [contact us](https://aancer.ai/contact).

| Command | What it does |
|---|---|
| `aancer-pack init <kind> [dir] [--id <pack id>] [--publisher <name>]` | scaffolds a new pack. Kinds: `skill`, `agent-blueprint`, `template`, `connector` |
| `aancer-pack keygen --out acme.key` | makes an Ed25519 key pair (`acme.key`, `acme.pub`) and prints your key id `pub-<12 hex>`. Never overwrites a key |
| `aancer-pack lint manifest.json content/` or `aancer-pack lint <file>.ancpack` | checks catalog readiness, prints one `<path>: <what to change>` line per problem. Add `--json` for machine-readable output |
| `aancer-pack sign manifest.json content/ -o <file>.ancpack --key acme.key` | builds the signing form, zips and signs. This is the step that makes the `.ancpack`, with a unique build id |
| `aancer-pack verify <file>.ancpack --pubkey acme.pub [--publisher-pubkey acme.pub]` | checks the signature, prints OK. `--publisher-pubkey` also checks the publisher signature of a certified pack |
| `aancer-pack inspect <file>.ancpack` | shows id, version, items and content hash |
| `aancer-pack validate <file>.ancpack --remote <url>` (coming in this release) | runs your installation's import checks without installing, using your `aancer-pack login` session. Exit `0` valid, `2` refused |
| `aancer-pack connector check [dir] [--json]` | checks a connector project |
| `aancer-pack connector run <action or trigger> [dir] [--props <file>] [--auth <file>] [--payload <file>]` | runs one action or trigger of your connector locally |
| `aancer-pack login --target <url> [--email <address>]` | signs in to your installation with a password |
| `aancer-pack login --target <url> --browser` (or `--sso`; coming in this release) | signs in through your installation's own sign-in page in the browser, including single sign-on. Prints the address if no browser opens; times out after 5 minutes. The session lasts at most 1 hour and is kept in the macOS keychain or the Linux secret service, otherwise in a file only you can read |
| `aancer-pack dev [dir] --target <url> [--params <file.json>] [--watch] [--trust-key-on-target]` | signs with your developer key and installs on your developer edition, again on every save with `--watch` |
| `aancer-pack trust-key --print` | prints your developer public key, to add under **Extensions > Trust keys** |
| `aancer-pack telemetry status` | shows the CLI's developer-tool telemetry setting. Telemetry covers the CLI only |
| `aancer-pack --version` | prints the version |

Coming in this release: `aancer-pack doctor [--json]` checks the container runtime, memory (8 GB, or 12 GB with `--full`), free disk (10 GB), the port and the model. It prints one `fix:` line per problem and exits `1` if it finds any.

Exit codes: `0` ok, `2` invalid input or usage, `3` signature or verification refused.

`lint` also demands `publisher.name` (1 to the name limit) and a `publisher.keyId` in one of the forms `pub-<12 hex>`, `inst-<12 hex>` or `install`.

Put the `pub-<12 hex>` id that `keygen` prints into `publisher.keyId`. Keep the `.key` file private. Share only the `.pub` file.

### What gets signed

You do not need this if you use the CLI. It is here so you can check a pack by hand.

1. Start from `manifest.json`.
2. Replace every `{"$ref": "content/x.json"}` with `{"$ref": "content/x.json", "$hash": "sha256:<hex of the file bytes>"}`.
3. Add `assets` with the sha256 of every binary file under `content/`.
4. Remove any `sig` or `signature` field.
5. Serialise as canonical JSON: object keys sorted at every level, compact separators, arrays in order, no non-finite numbers.
6. Sign those bytes with Ed25519. Write the base64url signature to `MANIFEST.sig`, and the signing form to `MANIFEST.json`.

### Who may sign

An installation accepts a pack when one of these keys verifies it:

1. the AANCER platform key;
2. the installation's own export key (`inst-<12 hex>`), for templates, agents and dashboards exported from that installation;
3. a partner key that an administrator added under **Platform Settings > Extensions > Trust keys**. The manifest's `publisher.keyId` must equal the key id the administrator entered.

A pack signed by the installation's own key always verifies with that key and is not affected by catalog withdrawals. A pack whose signer is known but whose signature does not match is refused with `PACK_SIGNATURE_INVALID`.

Connector packs are accepted only with the AANCER platform key. Partners submit connectors for certification and AANCER signs them. See [Connectors](/developers/connectors).

## Install and test

To test a pack, import it into an EVAL or test installation. Import is installation-wide: it checks everything and installs nothing. Only activation changes the installation. A pack that contains workflow templates also passes the template permission check on activate and rollback.

### In the UI

1. **Platform Settings > Extensions > Trust keys > Add trust key**. Paste your public key. Use your `publisher.keyId` as the key id.
2. **Import pack**. The summary lists items, parameters and warnings.
3. **Activate**. Fill in the parameters.
4. Later: **Roll back** to an older version, or **Retire** to uninstall.

Importing needs the `extensions.manage` permission. Activating a pack whose items are all workspace-scoped and target workspaces you manage also works with `extensions.manage_own`.

### With the REST API

```bash
# 1. add the trust key (once per publisher)
curl -X POST https://aancer.example.com/api/extensions/trust-keys \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"keyId":"pub-0123456789ab","label":"Acme Example Ltd","publicKeyPem":"-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"}'

# 2. import (raw bytes as the body)
curl -X POST https://aancer.example.com/api/extensions/packs/import \
  -H "Authorization: Bearer $TOKEN" \
  --data-binary @acme.sales-dashboard-1.2.0.ancpack

# 3. activate with parameter values
curl -X POST https://aancer.example.com/api/extensions/packs/acme.sales-dashboard/activate \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"version":"1.2.0","parameters":{"target_workspace":"ws-sales"}}'
```

| Call | What it does |
|---|---|
| `POST /api/extensions/packs/import` | raw `.ancpack` bytes, optionally `?activate=1`. Returns `201` (new) or `200` with a summary: items, parameters, warnings, `upgradeFrom`, and when relevant `certification`, `revocation`, `keptBehind` |
| `POST /api/extensions/packs/{packId}/activate` | `{ "version": "...", "parameters": { "<id>": "<value>" } }`. A `null` value unbinds an optional parameter |
| `POST /api/extensions/packs/{packId}/rollback` | `{ "version": "..." }` |
| `POST /api/extensions/packs/{packId}/retire` | uninstall |
| `GET /api/extensions/packs`, `GET /api/extensions/packs/{packId}` | list and detail |
| `GET /api/extensions/objects` | installed objects, filter by `kind`, `workspaceId`, `state`, `packId` |
| `GET /api/extensions/schemas` | supported kinds and schema versions |
| `GET /api/extensions/trust-keys` | list trust keys |
| `POST /api/extensions/trust-keys` | add a key, answers `201` |
| `DELETE /api/extensions/trust-keys/{keyId}` | remove a key, answers `204` |

### The certified catalog in your installation

Certified packs are listed in the installation's catalog. An administrator opens a listing and chooses **Get** to import it; a newer certified version shows **Update available**. The installation receives the catalog over its catalog channel. Installations without direct internet access upload the signed catalog file (`catalog-snapshot.json`) by hand, or point the channel at a mirror in their own network.

| Call | Permission | What it does |
|---|---|---|
| `GET /api/marketplace/certified/status` | `marketplace.view` | channel status and last refresh |
| `PUT /api/marketplace/certified/settings` | `extensions.manage` | catalog channel settings |
| `POST /api/marketplace/certified/refresh` | `extensions.manage` | fetch the catalog now |
| `POST /api/marketplace/certified/snapshot` | `extensions.manage` | upload a catalog file (raw body, up to 8 MiB) |
| `GET /api/marketplace/certified/items`, `/items/{packId}`, `/facets` | `marketplace.view` | browse listings, kinds and available updates |
| `POST /api/marketplace/certified/items/{packId}/get` | `marketplace.import_pack` | import a listed pack |

### Withdrawn versions

AANCER can withdraw a certified pack version, for example after a security finding, and names the version that fixes it. A withdrawn version is no longer imported (`PACK_REVOKED`). For a critical withdrawal the installation stops the installed version (a forced stop); otherwise the version is flagged for the administrator. Where the installation allows it, an administrator can record a decision to keep a withdrawn version running, with a reason, and end that decision later:

| Call | Body |
|---|---|
| `POST /api/extensions/packs/{packId}/revocation-override` | `{ version, reason }` |
| `DELETE /api/extensions/packs/{packId}/revocation-override` | `{ version }` |

Both need `extensions.manage`. Activating a newer version ends the decision for older ones.

### Offline install

An operator can drop `.ancpack` files into the installation's packs folder. Every file is imported at start. A pack is activated when every required parameter has a value in `packs.env`, written as `PACK_<pack id with non-alphanumerics as _>__<param>=value`. For example `PACK_acme_sales_dashboard__target_workspace=ws-sales`. Administrators can rescan the folder with **Scan server folder**.

### Versions

A pack id plus version is permanent. Importing the same version again with the same content does nothing. Importing it with different content fails: bump the version. Activating a newer version replaces the older one. With equal `MAJOR.MINOR.PATCH`, a pre-release such as `1.2.0-rc1` is older than `1.2.0`.

## Common errors

| Code | Status | Message | Fix |
|---|---|---|---|
| `PACK_UNSIGNED` | 422 | This pack is not signed (MANIFEST.sig is missing). | Sign it with `aancer-pack sign` |
| `PACK_MALFORMED` | 400 | The pack could not be read. / MANIFEST.json is missing | Rebuild the ZIP with the CLI |
| `PACK_SIGNATURE_INVALID` | 400 | This pack could not be verified, the signature is invalid. | A file changed after signing, a file under `content/` is not referenced or listed, or `publisher.keyId` names another key. Re-sign after every change |
| `PACK_SIGNER_UNKNOWN` | 422 | This pack was signed by an unknown key (pub-...). Add the publisher's key under Extensions > Trust keys first. | The administrator adds your public key with the same key id |
| `PACK_SIGNER_NOT_ALLOWED` | 403 | Connector packs must be signed by the platform key. | Submit connectors for certification |
| `PACK_SCHEMA_INVALID` | 422 | The pack failed validation: `<path>: <message>` | Fix the field at the path. Item errors use `/items/<itemId>/spec/...` |
| `PACK_SCHEMA_INVALID` | 422 | `/parameters: parameter 'x' is referenced but not declared` | Declare it in `parameters` |
| `PACK_SCHEMA_INVALID` | 422 | `/items/0/scope: agent-blueprint items are install-scoped` | Use `"scope": "install"` |
| `PACK_SCHEMA_INVALID` | 422 | `/items/0/workspace: required for workspace scope` | Add `workspace` or use install scope |
| `PACK_SCHEMA_INVALID` | 422 | `/version: must be strict semver` | Use `1.0.0`, not `1.0` or `v1.0.0` |
| `PACK_SCHEMA_INVALID` | 422 | the unzipped content is larger than the limit | Keep the unzipped content under 32 MiB (128 MiB for a connector pack) |
| `EXTENSION_KIND_UNKNOWN` | 422 | This platform does not know the extension kind '...'. | Use a kind from the table above |
| `PACK_PLATFORM_INCOMPATIBLE` | 422 | This pack needs platform version ...; this installation runs ... | Lower `requires.platform`, or the installation upgrades |
| `PACK_VERSION_CONFLICT` | 409 | Pack ... is already imported with different content. Bump the version. | Bump `version` |
| `PACK_TOO_LARGE` | 413 | This file is larger than the ... MB limit for one pack on this installation. | Applies to the file size only: keep the file under 64 MiB |
| `PACK_PARAMETER_MISSING` | 422 | Required parameters are missing: ... | Send them at activation, or set `"required": false` |
| `PACK_PARAMETER_INVALID` | 422 | Parameter values are invalid: ... | Send existing ids as strings |
| `EXTENSION_REFERENCED` | 409 | Other active extensions still reference objects in this pack: ... | Remove the dependants first |
| `PACK_REVOKED` | 403 | This pack version was withdrawn by the platform (...). | Install the version named in the message |
| `PACK_LICENCE_REQUIRED` | 403 | This connector pack needs an active licence. | Activate the licence, then import again |
| `PACK_LICENCE_MISMATCH` | 403 | This connector pack was issued for a different licence. | Ask for a pack issued to this installation |
| `PACK_CONTENT_FORBIDDEN` | 422 | The connector archive contains forbidden content: ... | Remove the named files |
| `PACK_PIECE_NAME_TAKEN` | 409 | A connector named ... is already installed on this platform. | Use another package name |
| `EXTENSION_NOT_FOUND` | 404 | ... not found. | Check the pack id or object id |
| `PACK_NOT_REVOKED` | 409 | This pack version is not withdrawn with a forced stop, so there is nothing to keep running. | Only for versions stopped by a withdrawal |
| `PACK_REVOCATION_OVERRIDE_FORBIDDEN` | 403 | This installation does not allow a withdrawn pack to keep running. | Install the fixed version |

`aancer-pack lint` adds catalog checks, for example "a submission needs a listing block", "a submission must not carry a certification block" and "pack id must be '<publisher id>.<name>'".

## Limits and editions

- Pack file: 64 MiB by default. The operator can change it.
- Unzipped content: 32 MiB per pack, 128 MiB for a pack with a connector. Each asset: 4 MiB; a connector archive (`application/x-tar`): 96 MiB. Items: 256 per pack.
- Importing and activating packs is controlled by permissions (`extensions.manage`, `extensions.manage_own`).
- Some item kinds need a licence feature: embedded apps, certified agents and licensed connectors. Each page says so.
- Check your edition on [aancer.ai/pricing](https://aancer.ai/pricing).


---

Source: https://aancer.ai/developers-templates

---
title: Workflow templates | AANCER Developers
description: Build reusable AANCER workflow templates: the record, typed parameters, bindings, workflow steps, validation rules and how to ship them in a pack.
---

Next part: https://aancer.ai/dev/parts/pages/04-workflow-templates.md
