Docs Plugin operations

Plugin operations: deployment, limits, publishing

Use this page when you administer plugins for a Mockarty installation. It shows
which deployment types support each plugin, how to control registries and
signatures, and how to publish a bundle. For installation steps, see
Plugins; for creating one, see Writing plugins.

Deployment shapes

Choose the installation path that matches your Mockarty deployment:

  • Single node: upload a .zip in Admin → Plugins. A single-node installation supports file uploads.
  • Cluster: use the same Admin → Plugins flow. Admin nodes share installed bundles and enabled state, so an administrator does not need to upload the file separately to each node. Check that all nodes can reach the shared database and cluster messaging service before enabling a plugin.
  • Desktop: install a local file without network access. Browsing a remote registry requires a connection to that registry.
  • Air-gapped installation: upload a local bundle. A remote registry is optional and stays off until configured.

Managed native programs have additional placement restrictions: a multi-node cluster refuses them. Check the install preview before enabling one. Mock kits, content packs, and sandboxed WebAssembly plugins can be used without a managed native program.

Environment variables

Variable Default Effect
MOCKARTY_PLUGINS_ENABLED on Kill-switch. false / 0 / off removes the plugin API, UI section and agent tools entirely.
MOCKARTY_PLUGINS_REGISTRY_URL unset URL of an external registry index.json (for example, a GitHub raw URL or an internal catalogue). Unset means the built-in catalogue of plugins shipped with Mockarty is shown (reading it makes no registry request; a bundle is downloaded from the catalogue’s URL only on an explicit install). Set it to connect an external registry (it takes precedence), or to off to disable one configured elsewhere.
MOCKARTY_PLUGINS_REGISTRY_ALLOW_HTTP off Dev mode: allows http:// download URLs only for loopback hosts, so a plugin author can test the full list→install flow against a local static server. Never needed in production.
MOCKARTY_PLUGINS_REGISTRY_ALLOW_PRIVATE off Corporate mode: the registry may live on the intranet (no GitHub access) — private-range hosts and plain http:// are admitted for the registry client only. Cloud-metadata and link-local addresses stay blocked regardless. Use with an internal static host serving index.json + zips.
MOCKARTY_PLUGINS_TRUSTED_KEYS unset Comma-separated base64 ed25519 public keys. Bundles signed by one of them show signatureStatus: trusted.
MOCKARTY_PLUGINS_REQUIRE_SIGNATURE off true refuses to install unsigned bundles or bundles signed by an untrusted key — for regulated contours.
MOCKARTY_WIKI_IFRAME_ALLOWLIST unset (Wiki) restricts which hosts wiki !iframe: embeds may point at; none forbids external embeds.

Namespace-install policy

Whether a namespace owner may self-install no-code plugins into their own
namespace is an administrator toggle in the UI (Admin → Plugins), not an
environment variable — it changes product behaviour, so it lives where an
administrator can flip it without a redeploy. Default OFF. When on, a namespace
owner can install only no-code bundles (mock kits, content packs, wiki macros,
link types, connector presets) from a marketplace visible to their namespace,
scoped to that namespace alone; WASM modules, UI panels, event types and task
types still require an administrator. Every namespace install is audited
(plugin_ns_installed), and administrators keep the kill-switch — they see and
can uninstall namespace plugins from the same tab.

Hard limits

These are validated at install time and fail with a structured error code —
they are not configurable:

Limit Value
Bundle zip size (compressed) 32 MiB
Files per bundle 2000
Uncompressed total / per file 64 MiB / 16 MiB
Contributions per family (kits, packs, links, …) 50
Name / description length 200 / 4000 characters
Plugin task-type name plugin- prefix, ≤ 19 characters
Plugin event-type name plugin. prefix

Security model (what a plugin can and cannot do)

  • Declarative contributions (mock kits, content packs, connectors, links,
    event/task types) are data. The host renders and applies them; they execute
    nothing.
  • WebAssembly modules run inside a sandbox: no disk, no network, no
    clock, no host memory — with fuel, time and memory caps per call. A broken or
    slow module fails only its own call, never the request or the process.
  • UI panels render in a sandboxed iframe with a strict Content-Security-
    Policy at an opaque origin: no host session, no cookies, no DOM access. The
    host pushes the plugin’s (non-secret) settings in via postMessage.
  • Downloads are pinned and guarded. Registry installs verify the bundle’s
    sha256 against the index; install-by-URL accepts an optional sha256 pin; both
    run through an SSRF-guarded HTTP client that refuses loopback and private
    addresses.
  • Secrets never live in a manifest. Connector plugins ship configuration
    templates; credentials are entered per namespace in Settings → Integrations
    and encrypted at rest.
  • Multi-tenancy: an administrator installs once; every namespace
    independently enables/disables each plugin and overrides its settings. All
    catalogue and hot-path reads are filtered per namespace.
  • Audit: every install, enable, disable, uninstall and per-namespace toggle
    lands in the audit log with the acting user.

Human review of an installed action

For an installed, enabled, namespace-approved action using the read-only tasks.get
profile, a signed-in user with namespace write rights can retain a proposal. The
first proposal for an installation requires a namespace owner. A different current
namespace owner reviews it. Both operations keep the candidate disabled; a review
alone does not enable execution or approve a mission.

Use the current human login session. API keys and agent/service tokens cannot
perform this human review. These operations are available when the server has
mounted the installed-action review service; otherwise they return 503. Human
review does not require an enabled agent runner, MCP server, model profile or
action worker. Execution remains a separate operation.

The base path is /api/v1/namespaces/{namespace}/plugin-actions/{id}/{action}/proposals:

Operation Input Successful result
POST base path {"motivation":"Why this action is needed"} 200, exact reference, state: "retained_disabled", disabled: true
GET base path Query reference=<exact reference> 200, retained proposal or disabled review under current rights
POST base path + /reviews {"reference":"<proposal reference>","note":"Independent review"} 200, reviewed reference, state: "reviewed_disabled", disabled: true

A retained proposal response also identifies its namespace, plugin, action,
candidateDigest, original authorId, and motivation. A review response identifies
its original author and reviewerId. Keep the returned reference exactly. Reading
a reviewed reference requires the current reviewer; retaining a proposal reference
does not grant access to another namespace or survive revoked rights.

Bodies accept only the fields above. The maximum is 8 KiB; motivation is at most
1024 UTF-8 bytes, note 512, and reference 256. Values must be non-empty and have no
leading or trailing whitespace. Unknown fields, duplicate keys and ambiguous
reference query parameters return 400. Package/reference changes return 409;
a missing or unauthorized human session returns 401 or 403.

If saving returns 503 with code: "action_publication_unknown", the response
includes the known reference, state: "unknown" and disabled: true. Read that
exact reference through GET using current rights before any further action.
Do not resend the mutation automatically. If readback is unavailable or refused,
the outcome remains unresolved; a missing response is not proof that nothing was
saved. Other 503 responses mean the service could not confirm a successful result.
A failed read of current package authority returns action_publication_unavailable;
it does not establish that the package changed. Keep the draft and reread its
state with current rights before deciding what to do next.

Check a reviewed installed action

POST /api/v1/namespaces/{namespace}/plugin-actions/{id}/{action}/proposals/evaluations requests the server’s compatibility check. Sign in as the current reviewer and submit only the exact reviewed reference:

{"reference":"draft/<exact reference from review>"}

The server uses its configured contained worker and fixed checks. You cannot supply a verdict, a receipt, a policy or execution settings in this request. A completed response contains reference, state (accepted or rejected), attemptId and jobId, verified against current server records. An accepted check is not publication or approval of an original Mission. Publication remains a separate human decision.

Evaluation requires an available configured worker; action_evaluation_worker_unavailable does not confirm a completed check. The request has a bounded duration and respects cancellation. Each reviewed reference has one recorded attempt. A repeated POST conflicts rather than creating another attempt. If the response is lost or reports action_evaluation_unknown, keep the reference and use the observation GET below with current rights. That error exposes only the requested reference and state: unknown; it confirms neither completion nor that nothing ran. Never automatically repeat the evaluation. Other failed responses do not establish that the attempt was absent. API keys, service tokens, SDK/CLI and MCP tools cannot replace the required human session. Responses are not cached.

Read the checked state of a reviewed action

Use GET at the same base path plus /observations?reference=<exact draft reference> with the current reviewer’s human session. The response contains reference and state, with attemptId and jobId only when verified. These identifiers are for correlation and do not grant access. The operation does not require a running action worker and never starts or retries evaluation, publishes, approves a mission, or performs cleanup.

State Meaning
not_started No attempt is recorded for this reviewed reference. This is not authorization to execute it.
reconciliation_required An attempt needs reconciliation, or a past publication is not confirmed as the current publication. Do not repeat the operation.
accepted The recorded compatibility check was verified and accepted. Publication still requires a separate decision.
rejected The recorded compatibility check was verified and rejected. It cannot authorize publication.
published The exact reviewed candidate is confirmed as the current publication. publishedRevision identifies its revision.

This GET reads evidence already recorded by the server; it does not create that evidence. A missing job or lost response does not establish that execution never happened. If the GET returns 503 with action_publication_read_unknown, it echoes only the requested reference and state: "unknown". Perform a fresh read with current rights; never repeat evaluation or publication because a read failed. Other failed or refused reads leave the outcome unresolved. Responses are not cached. API keys, MCP tools and SDK/CLI clients cannot replace the required human session.

Explicit publication of a reviewed installed action

POST /api/v1/namespaces/{namespace}/plugin-actions/{id}/{action}/proposals/publications makes a separate publication decision. Sign in as the current reviewer and use that user session. Send only the exact reviewed reference and your note; the author cannot review their own proposal. Current rights, the installed source and its recorded compatibility result are checked again.

{"reference":"draft/<exact reference from review>","note":"Publish this checked revision"}

A successful response contains reference, state: published and publishedRevision. Publication requires an accepted compatibility result and refuses an existing publication instead of replacing it. It does not run the compatibility check, execute the action or approve an original Mission. Reading and publication do not require a running action worker.

If the response is lost or reports action_publication_effect_unknown, preserve the reference and use the observation read above with current rights. An unknown response contains no confirmed revision and does not imply that the action is disabled or that no change occurred. Do not automatically repeat the POST. A rejected result, lost access or a conflicting publication cannot be turned into approval by repeating the request. API keys, service tokens and agent assertions cannot replace the human session.

Structured error codes

Plugin API failures return {"error": "<detail>", "code": "<stable code>"}.
The UI shows a localized message per code; agents and scripts can branch on it:

bundle_too_large, bundle_invalid, manifest_missing, manifest_invalid,
asset_missing, signature_invalid, host_incompatible,
contribution_conflict, not_found, storage_error, internal.

Publishing to a registry

A registry is a static index.json plus downloadable zips — a GitHub
repository with Releases is the reference setup; any static host works.

  1. Build and validate the bundle: mockarty-cli plugin pack . then
    mockarty-cli plugin inspect <zip>.
  2. Generate the index entry:
    mockarty-cli plugin publish <zip> --download-url https://github.com/<org>/<repo>/releases/download/<id>-v<version>/<zip>
    — it prints a ready JSON object with the correct sha256.
  3. Upload the zip as a Release asset at exactly that URL and add the object to
    the plugins array of the repository’s index.json (via a pull request in
    a shared registry).
  4. Point servers at the raw index URL via MOCKARTY_PLUGINS_REGISTRY_URL. The
    catalogue appears under Admin → Plugins; installs verify the sha256.

The digest is of the file you upload, not of a re-packed source. Packing
the same plugin twice can produce different bytes — archives record mtimes and
file modes, and compressors differ between builds — so a sha256 taken from a
bundle packed on your machine may not match the artifact on the release, and
the install is then refused with downloaded bundle sha256 … does not match
the registry index
. Take the digest from the file you actually publish
(mockarty-cli plugin publish <the-uploaded.zip> prints it), and re-run the
publish step whenever you replace an asset.

Version upgrades are in-place: publishing 1.1.0 and installing it over
1.0.0 keeps the enabled state and swaps the contributions atomically.

The capability kill-switch

Everything a plugin or an external integration contributes — mission
components, runner task types — is listed in the unified capability catalogue
(GET /api/v1/capabilities), alongside the built-in capabilities. When a
dynamic capability must be shut down instantly — a compromised vendor, a
misbehaving integration — an administrator can open Autonomous Missions →
Capabilities
and use Disable. The same operation is available for
automation in one call:

curl -X POST "$MOCKARTY_URL/api/v1/capabilities/<key>/revoke" \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"reason": "vendor key compromised"}'

The reason is mandatory and is shown wherever the capability would have
appeared. One call is enough:

  • the capability turns unavailable in the catalogue with
    availability.reason: "revoked" and your reason in revokedReason — both
    people and agents see why before planning around it;
  • operator-managed rows carry operatorManaged: true, a managementKey, and
    the exact managementNamespace; the Missions UI uses that durable identity
    for Disable/Restore without guessing from a display facet or confusing a
    namespace-local row with an instance-wide policy;
  • if the capability came from a plugin, that plugin is disabled on every node
    in the same call (the response names it in sourceDisabled);
  • re-installing or re-enabling the source does not resurrect the
    capability — the attempt fails with contribution_conflict and the stored
    reason, until the revocation is lifted explicitly.

The operation is fail-closed. If Mockarty cannot disable the plugin source or
cannot read/persist the durable kill-switch state, it returns 503 and never
claims a successful revocation while executable contributions may still be
active. Retry after restoring the database/plugin store; a plugin that was
already disabled remains safely off during that retry.

Lifting it is a deliberate two-step decision:
POST /api/v1/capabilities/<key>/restore removes the mark, and the source
plugin still has to be enabled again by hand. External capabilities that are
registered but not executable on this server appear in the catalogue with
availability.reason: "declared" — visible for planning, not a promise of
execution. An administrator can also register such a row from Autonomous
Missions → Capabilities → Register capability
. All three operations are
administrator-only and audited.

Troubleshooting

  • Plugin installed but nothing appeared — it lands disabled by design;
    press Enable. If it is enabled and still missing in a namespace, check the
    per-namespace toggle (Admin → Plugins → Enable here) and the plugin’s
    default_off flag.
  • healthy: false in plugin status — the node failed to apply a
    contribution (typically a WASM module built for WASI instead of
    wasm-unknown, or a key conflict with another plugin). The server log names
    the cause.
  • Registry list is empty — this is expected until
    MOCKARTY_PLUGINS_REGISTRY_URL or an operator-managed source is configured.
    If a source is configured, the index may be unreachable or may fail
    validation. The API response carries a hint in every case: a source URL is
    checked when it is added, and “we reached it and it is not a registry”
    answers 400 rather than 502.
  • Install from URL fails with bundle_invalid — the URL must be http(s)
    and reachable without touching private address space; pin the sha256 to rule
    out a corrupted download.

Recovering a recorded native action job

In Admin Panel → Plugins → Recover an action job, enter the saved job ID and select Read current state. After a successful read, explicitly confirm cleanup of that job before selecting Reconcile cleanup. Running and receipt states may offer cleanup; terminal and recovering states do not. The panel is independent of the installed-plugin list.

Before sending cleanup, this browser tab retains the job ID and signed-in user ID (no action text or credentials). A sent cleanup cannot be sent again from that tab, including after a reload; use readback if the result is unknown. If this storage is unavailable or full, cleanup is blocked. Switching pages retains the entered ID in memory but requires a new state read. Signing out clears the form.

A signed-in global administrator can read a known native action job with GET /api/v1/native-actions/jobs/{job}/recovery. Use the exact recorded 32-character lowercase hexadecimal job ID. Send no body or query parameters. API keys and service identities cannot use this control.

The response describes recorded state: running, receipt, recovering, or terminal. A successful read does not prove that a worker has stopped or that an evaluation passed. A failed read supplies no state.

An explicit POST /api/v1/native-actions/jobs/{job}/recovery/cleanup, also without a body or query parameters, reconciles that job through its retained worker. It does not execute the action or approve an evaluation. Recovery can remain available after the source plugin or namespace is removed. The current server must still have the matching worker configuration and the administrator’s session must remain valid.

A successful cleanup returns outcome: reconciled. If cleanup cannot be confirmed, the response reports outcome: unknown. Keep the job ID and read its recorded state; do not automatically repeat cleanup after a timeout or lost response. These administrator controls are not exposed as generated MCP tools or public SDK/CLI operations.

Reviewing and publishing an installed action

In Settings → Agent Skills → Installed action candidates, a namespace owner can retain an installed action for independent review. Enter the exact plugin and action IDs from the installed package and a short motivation, then explicitly confirm Retain candidate. Save the returned proposal reference. Another namespace owner must inspect the source and permissions, load that reference and explicitly record the review; the author cannot review their own candidate.

The resulting draft remains disabled. Its reviewer loads the draft, selects Read attempt state, and can explicitly request Check exact candidate when no check is recorded. A recorded accepted check enables a separate Publish checked candidate decision. Publication does not approve or execute an original Mission. This native path currently admits only the tasks.get profile; it is not general-purpose access to every internal scripting SDK method.

Motivation is limited to 1024 UTF-8 bytes; review and publication notes to 512. Do not include secrets. References, candidate digests and the author/reviewer relationship are shown as read-only metadata. A recorded job ID can be handed to a global administrator for Admin Panel → Plugins → Recover an action job.

Before a mutation, this tab saves a bounded repeat-prevention record containing user, namespace, plugin/action IDs, reference and operation, without the note or action source. Unknown results keep the record, including after reload. Load the saved reference and read its attempt state; a missing or unavailable state does not authorize a retry. If storage is unavailable or full, new commands are blocked. A successful retention returns a new reference and clears only its retention hold. Page changes preserve the form in memory but require fresh state and consent; changing namespace or signing out clears it.