There are exactly two ways a plugin arrives on a node: you copy a file, or the node installs it for you. This page documents the second path — what the installer verifies, in what order, and what it writes — because a verification step you cannot name is indistinguishable from no verification at all.
The installer route
Every node runs scorpiox-bot-api on port 8150. That process exposes one route for plugin lifecycle:
GET /plugin_manage?action=platform
POST /plugin_manage?action=install|update|uninstall
It requires node authentication before it does anything: the same X-Bot-Password, bearer token or ?pwd= accepted by every other node route. An unauthenticated request never reaches the installer.
What action=platform tells you
{"ok":true,"os":"linux","arch":"x86_64",
"preferred_target":"linux-x86_64-musl","fallback_target":"linux-x86_64",
"install_dir":"/workspace/.scorpiox/plugins",
"has_cc":true,"has_git":true}
This is the node describing itself, and it is also the answer to "which artifact should I download". A Debian slim container reports preferred_target: linux-x86_64-musl because a static binary is the one that cannot fail on a missing glibc symbol. A Windows node reports windows-x86_64. An Apple Silicon laptop reports macos-arm64.
has_cc is the field that decides which track is available at all. With has_cc: false — a slim container with no compiler — source installation is not offered, and the pre-built path is the only one that works. That is not a limitation imposed for its own sake; it is the reason the pre-built path exists.
Pre-built installation, step by step
The order matters more than any single step.
1. Origin allowlist. The artifact_url must begin with https://dist.scorpiox.net/bot-plugins/ and, when present, the git_repo_url must begin with https://plugingit.scorpiox.net/. Anything else is 403 untrusted_origin. This is not a signature check, but it does mean a compromised market page cannot point the installer at an arbitrary host. Both bases are overridable by an operator through BOT_PLUGIN_DIST_BASE and BOT_PLUGIN_GIT_BASE; the override is deliberately a server-side environment variable and not a request parameter.
2. Identifier validation. The plugin id must match plugin_[A-Za-z0-9_-]{1,56}. No slash, no backslash, no ... This is what stops an id from being a path.
3. Checksum requirement. A request without expected_sha256 is refused with 400 missing_sha256; the installer has no "skip verification" mode. The field must be 64 hexadecimal characters.
4. Download to a temporary name. The binary is written to <install_dir>/.tmp_<id>.<pid>, not to its final name. A half-finished download is therefore never visible to the server, which resolves plugin files live on every request.
5. Pure-C SHA-256. The digest is computed by the node itself, using a bundled implementation. No sha256sum, no certutil, no external tool whose absence would silently skip the check. A mismatch is 422 checksum_mismatch and the temporary file is removed.
6. Native magic-header check. The bytes are inspected for the magic number of the current platform: 0x7f 'E' 'L' 'F' on Linux, MZ on Windows, a Mach-O magic on macOS. A binary for the wrong platform is 422 invalid_binary_header before it is ever executed.
7. --meta smoke test. The downloaded file is executed exactly once, with --meta, and its output must parse as a JSON object. This proves three things at once: the file is executable, it runs on this machine, and it honours the metadata contract. A file that crashes, hangs or prints something else is 422 smoke_test_failed.
8. Atomic rename into place. Only after all seven checks pass does the temporary file become <install_dir>/plugin_<id>.
9. Sidecar manifest. plugin_<id>.manifest.json is written beside the binary, recording the install method, the target, the verified SHA-256, the source commit and the time. This is the audit trail the market UI displays. It is a record, not a signature — it says what happened, and it can be edited by anyone with write access to the directory.
Source installation
The same pipeline with three substitutions. The repository is shallow-cloned into a temporary directory instead of being downloaded as a tarball. The build is make when a Makefile exists, otherwise a direct cc invocation, with failures reported as 422 build_failed including the tail of the compiler output. And the checksum is computed after the build rather than compared against a published one, because there is no published one — the manifest records the digest of the binary you just produced, so a later re-install can tell whether the code changed.
The magic-header and --meta checks are identical. The clone is only from an allowlisted plugingit origin. The temporary directory is removed whether the build succeeded or failed.
Where the file lands
/workspace/.scorpiox/plugins when /workspace exists and is writable. On a BotCloud container that is a persistent volume: the plugin survives a container restart. Everywhere else, ~/.scorpiox/plugins, and on Windows %LOCALAPPDATA%\scorpiox\plugins.
The resolution has a consequence worth stating plainly. On a BotCloud container, you can install a plugin, restart the container, and find it still there — because /workspace is the one path that outlives the container. On a Mesh laptop, the plugin is in the user's own home directory, next to everything else that user owns.
Uninstalling
action=uninstall with id=plugin_<name> deletes both the binary and its manifest, and refuses to touch anything outside the user plugin directory. A plugin that an operator installed into the node API's own directory is 403 operator_plugin: the installer will not remove files it does not manage.
What isolation actually is
The installer runs as the node user, and so does the plugin. There is no privilege drop between them, no seccomp filter and no filesystem namespace. The isolation in this design is not inside the process; it is the boundary of the whole node.
That is why the recommendation is a container. A BotCloud container is a Linux box with its own home directory, its own Git server, its own ports and no inbound network listener. A plugin that reads everything it can reach on that box reaches three things: the container's files, the container's credentials and the container's network. On a laptop it reaches everything the user owns.
The market's contribution is not a sandbox. It is that every install is verifiable — same source, same commit, same checksum — and reversible with one rm. Combined with a disposable node, that is a coherent security posture. Without one, it is a good verification story with a real blast radius.
Manual installation, for completeness
gcc -O2 -std=c99 -o plugin_mine src/plugin_mine.c
cp plugin_mine ~/.scorpiox/plugins/
chmod +x ~/.scorpiox/plugins/plugin_mine
No manifest is written, and nothing is verified. The server picks it up on the next request, because discovery is a directory scan performed per request rather than at startup. This path is fine for your own work and wrong for anything you downloaded.
Read next
- The C99 Three-Mode Plugin SDK — what
--meta, the JSON mode and the HTML mode have to return. - dist Manifests and SHA-256 — how the published digests are produced and how to verify one by hand.
- Cross-Compiling for musl, MinGW and macOS — the toolchain invocation behind each
preferred_target.