FerriteDocs

Packages

Install shared Ferrite source into an application with ferrite add: resolution, signature and digest checks, MCP usage without a shell, and the published package catalog.

A deployable Ferrite application declares one Cargo dependency, ferrite-app, and the platform source gate rejects any other entry in [dependencies], including local path dependencies. Shared functionality therefore ships as Rust source instead of Cargo crates: ferrite add copies a package’s source tree into your app’s src/ directory, where it compiles inside your crate, runs with your app’s handles and no others, and passes the same source gate as code you wrote. See the one-dependency rule for why this boundary exists.

Add a package

Run ferrite add from your app directory (or pass --dir), then declare the printed modules at your crate root:

ferrite add mcp
pub mod crypto;
pub mod mcp;

The CLI runs six steps in order and writes nothing to disk unless every step succeeds:

  1. It loads the package index from https://packages.<base>/registry.json, where <base> comes from your active MCP login (https://mcp.<base>/mcp), so each app installs from its active installation’s registry. Before signing in, ferrite add exits with Select a Ferrite instance first or pass --registry; pass --registry https://packages.ferrite.cloud/registry.json to target Ferrite Cloud directly. Use --registry <url> for another remote index, or --path <dir> for a local checkout containing packages/registry.json. The CLI caches the index in its config directory so an offline run still resolves from the last seen index and reports its age (fetching package files still requires network access). Any index whose serial is lower than one already seen is rejected as a downgrade.

    For URL indexes, the CLI verifies the detached Ed25519 signature at registry.json.sig. packages.ferrite.cloud and other Ferrite installation package hosts are checked against the public key compiled into the CLI. For any other registry, pass its trusted public keys in FERRITE_REGISTRY_KEYS=ed25519:<base64>[,...]. Unsigned indexes and untrusted signers are rejected. When no key is trusted for a third-party registry, --allow-unsigned-registry installs on file digests alone and prints a notice; once a key is trusted for that registry, the flag has no effect. A failed signature check is always rejected. Local --path checkouts skip signature verification.

  2. It resolves the requested package and its transitive dependencies. Running ferrite add mcp also installs sha256-hmac, which is why the crate root above declares both crypto and mcp.

  3. It downloads each listed file and checks it against the SHA-256 digest in the index. One mismatched byte aborts the entire install.

  4. It maps each file under src/<mount>/, using the package’s declared root unless ferrite-packages.json already specifies another (for example, sha256-hmac mounts under src/crypto/). Each .rs file receives a @generated by ferrite-pkg header with its package name and version, and inline #[cfg(test)] mod name { ... } blocks are stripped because they test package internals. Separate test files shipped by a package (auth, ferrite-sso, preview-gate, and agent-sdk) stay installed and run under ferrite test.

  5. It refuses to overwrite any existing file whose contents differ and lists the conflicting paths, unless you pass --force.

  6. It writes all files, records the requested package’s mount in ferrite-packages.json, and prints the crate-root lines you need: the pub mod declarations, plus extern crate alloc; for packages written against alloc:: paths (wasm-runtime, qjs-engine, and serde-codec). Any package that declares Cargo features also outputs a [features] block (none in the current registry does). After ferrite add auth, the CLI also prints the sign-in setup, including the secrets auth reads along with your app’s public origin and OAuth callback URLs so you can configure them before your first deploy.

ferrite add runs on Linux and macOS; on other operating systems it stops before reading or writing anything.

Treat vendored files as generated source. Do not edit files carrying the @generated by ferrite-pkg header: the next ferrite add flags edits as conflicts, and ferrite add --force <name> replaces them. To upgrade to a newer version, run ferrite add --force <name>.

Use a package without a shell

An agent connected only to the Ferrite MCP server, with no shell to run ferrite add, can inspect and include packages through MCP where the platform serves those tools. Ferrite Cloud serves all three capabilities; on another installation, check tools/list for list_packages and read_package, and check the deploy_source schema for a packages property.

  • list_packages lists published packages; passing query filters to packages whose name, summary, or guide contains every word.
  • read_package {"name": "<name>"} returns the package guide, its files as installed in your app, its dependencies in install order, and the required crate-root lines. Guides longer than 24,000 bytes are truncated with instructions for reading the rest. Passing file returns one file in chunks of up to 60,000 bytes; send the returned next_offset back as offset to continue. For auth, the setup guide points to app_host so you have your app’s origin and OAuth callbacks before the first deploy.
  • Pass package names in the packages argument of code_gate, deploy_source, or rcs_commit:
{
  "spec": "<the InfraSpec JSON>",
  "files": {
    "Cargo.toml": "...",
    "src/main.rs": "pub mod crypto;\n..."
  },
  "packages": ["sha256-hmac"]
}

Before the gate or build reads files, the server injects each named package and its dependencies under src/<root>/, byte-for-byte identical to ferrite add, so your request sends only your own files. If you also send a package file in files, the server accepts an exact match and rejects any difference. Pin a specific release with "name@version"; versions the server does not carry are rejected. If your files plus the requested packages exceed the MCP request body budget, the call fails and you need to name fewer packages. The reply lists the injected packages beside the verdict on code_gate and inside BuildStarted on deploy_source.

On an installation without these MCP tools, you can bundle a package yourself: read https://packages.<base>/registry.json for each package’s root, dependencies, and file SHA-256 digests, download each file from https://packages.<base>/<package>/src/<path>, verify every digest, place the package and its dependencies under src/<root>/, and include them in files. Whenever a shell is available, ferrite add is simpler because it checks signatures, adds provenance headers, and prints the crate-root lines.

Running ferrite add ferrite-auth fails with a message pointing to auth. Ferrite Core has no platform-managed sign-in service; application sign-in comes from the auth package.

Sign-in and sessions

PackageMounts atAlso installsUse it for
authsrc/auth/noneSign-in for your app: OAuth authorization-code flow with PKCE over your declared egress handle (each call made and recorded by the platform), opaque store-backed sessions, one __Host- cookie, and a CSRF gate. See Authentication
alloy-authsrc/alloy_auth/alloy, http-change-password, http-cookies, sha256-hmacPassword sessions for an Alloy app: PBKDF2 records, store-backed sessions, host-only session cookies, and session-bound CSRF so audited mutations record a server-verified actor
ferrite-ssosrc/ferrite_sso/http-change-password, http-cookies, sha256-hmacSingle sign-on across properties run by one operator: a broker app built on auth issues short-lived, audience-bound, single-use assertions, and each client verifies them to mint its own session. Because clients share an assertion key with the broker, use it only across properties run by one operator; use auth for an independent app
http-cookiessrc/http_cookies/none__Host- session cookie constructor and reader that composes the prefix, root path, Secure flag, and absent Domain in one constructor
http-change-passwordsrc/http_change_password/none/.well-known/change-password handler that redirects to a password page your app serves, or answers 404 when none is served
preview-gatesrc/preview_gate/http-cookies, sha256-hmacNot for application authors. Ferrite’s own sign-in broker mounts it beside auth to restrict operator-run hosts to an identity allowlist; ferrite.cloud hosts are configured for public access

Application frameworks

PackageMounts atAlso installsUse it for
alloysrc/alloy/sha256-hmacThe Alloy runtime: route matching, tag-epoch cache, replay-safe actions, document assembly, and packed asset archives. ferrite new alloy scaffolds an app with it mounted
rsxsrc/rsx/noneRuntime layer for Rsx: escape-safe HTML, file-convention router, and ingress server. ferrite rsx new writes it from the CLI bundle
nitrosrc/nitro/sha256-hmacNitro server toolkit in constrained Rust: routing, route rules, storage over Ferrite primitives, cached handlers, and the ingress adapter behind TanStack Start apps

Agents and protocols

PackageMounts atAlso installsUse it for
agent-sdksrc/agent_sdk/acp, http-query, mcp, regex-lite, sha256-hmacThe Agent SDK. Keeps your product’s agent inside your application so it deploys and rolls back with the app, stores conversations in the app’s own bindings, and obeys the same ferrite.json manifest. Compose hooks, tools, skills, and subagents in one function with session recovery and compaction, served over the thread API, MCP, ACP, and A2A
agent-readysrc/agent_ready/http-change-password, http-query, sha256-hmacExposes your app to customers’ assistants from one declared surface: robots.txt, sitemap.xml, llms.txt, Markdown page twins, an OpenAPI catalog, an A2A agent card, a stateless MCP server, RFC 9457 errors, and opt-in Personal Agent Protocol (Poppy 1.0) discovery, exposure controls, exact-terms approvals, Browser Join, and conversations
poppy-oauthsrc/poppy_oauth/agent-ready, http-query, sha256-hmacStandalone per-app OAuth 2.1 issuer for Personal Agent Protocol (Poppy 1.0): RFC 8414 metadata, PAR, PKCE S256, private_key_jwt, multi-resource RFC 8707 refresh tokens, optional DPoP, immediate RFC 7009 revocation, and a Connected Personal Agents settings page
mcpsrc/mcp/sha256-hmacModel Context Protocol revision 2026-07-28: wire protocol, stateless client, resource-server shell, and OAuth 2.1 authorization
acpsrc/acp/noneAgent Client Protocol v1: JSON-RPC wire model, agent and client roles, session lifecycle, and HTTP, SSE, and WebSocket bindings
ferrite-aisrc/ai/noneResponses API request, response, item, and stream-event types spoken by the AI Gateway
ai-budgetssrc/ai_budgets/noneAI attribution per user, team, or workspace, reserve-and-settle allowance counters, and policy that routes autonomous runs to cheaper models
gpt-pluginssrc/gpt_plugins/sha256-hmacOpenAI plugin kit on Ferrite: an MCP server for ChatGPT and Codex with optional UI (MCP Apps), OpenAI MCP extensions, skills, MCP Events, checkout, and submission packaging. Its stylesheet derives from Apache-2.0 code, so it also installs LICENSES/Apache-2.0.txt and NOTICE with your app

Connectors and grants

PackageMounts atAlso installsUse it for
gatekeepersrc/gatekeeper/noneConnector contract: scoped grants, observation audit, approvals with simulated outcomes, bounded catalogs, and schedules that stay inactive on registration and re-verify admission on every delivery
connector-githubsrc/connector_github/gatekeeperGitHub connector on the gatekeeper contract; your app implements the live backend trait over its own egress
connector-googlesrc/connector_google/gatekeeperGoogle Docs, Sheets, and Drive folders on the gatekeeper contract, with connector-owned OAuth
context-librarysrc/context_library/gatekeeperPublic or private collections of documents and SKILL.md skills, searchable and expandable as slash commands
blueprintssrc/blueprints/gatekeeperSharing a surface’s code and binding requirements without its state or credentials, with hashed share keys and revocable permissions

Commerce and messaging

PackageMounts atAlso installsUse it for
paymentssrc/payments/agent-ready, http-change-password, http-query, sha256-hmacCustomer billing: Stripe request builders, signed webhook verification, an idempotent event-admission ledger, dunning schedules, and the x402 header path
messagingsrc/messaging/noneTransactional email and chat: request builders for Resend, Postmark (single sends, batches of up to 500 messages, and broadcast stream type, suppression, and delivery-count readers), Telegram Bot API, and Cloudflare Email Sending, plus a Markdown email renderer that cannot emit active content and retry classification

HTTP, text, and data

PackageMounts atAlso installsUse it for
http-querysrc/http_query/noneTotal query-string decoder for IngressRequest.path, which arrives verbatim as path?query
http-route-budgetsrc/http_route_budget/noneAdmits each request against its matched route’s token bucket kept in a store your app already binds, before the handler runs any effect. See Rate limits
regex-litesrc/regex_lite/nonePanic-free, step-bounded regular expressions for apps without access to the regex crate
crdt-textsrc/crdt/noneSequence CRDT for collaborative plain text and Markdown with server-side merge, tombstone deletes, and idempotent re-apply (not Yjs-compatible)
sha256-hmacsrc/crypto/noneSHA-256, HMAC-SHA-256, constant-time comparison, hex encoding, PBKDF2 password records, and OS entropy over ferrite_app::crypto
serde-codecsrc/codec/noneCompact binary serde codec for embedding precompiled WebAssembly modules in app source
chronicle-syncsrc/chronicle_sync/noneWire protocol shared by a workspace authority and a sandbox leaf: bounded binary codecs, frame headers, message bodies, workspace-relative paths, SHA-256 hashing, manifest models, and sequence tracking using safe Rust and std only

Engines

PackageMounts atAlso installsUse it for
wasm-runtimesrc/wasm/noneIn-app WebAssembly interpreter: runtime store and stack interpreter over pre-parsed modules (derived from tinywasm, MIT OR Apache-2.0)
qjs-enginesrc/qjs/serde-codec, wasm-runtimeFuel-bounded QuickJS on wasm-runtime to run JavaScript and TypeScript snippets with deterministic-replay host calls

Application-specific

The registry also publishes packages scoped to specific reference apps; they are not general-purpose building blocks:

PackageMounts atAlso installsUse it for
bookshelfsrc/bookshelf/noneThe Goodreads catalog contract shared by NextBooks and its importer

Security shape

A package has no deployment, bindings, credentials, or resources of its own. Everything it does at runtime runs through the handles your ferrite.json grants the host app, which is why provider packages such as auth and messaging require you to declare egress destinations and secrets yourself. When a subsystem needs its own failure, scaling, or authority boundary, deploy it as a separate Ferrite app instead of vendoring a package.

Because vendored source compiles into your crate, its code shares every handle your application holds. It can read any secret injected into the app and call any destination declared in ferrite.json, beyond the ones its guide asks for. A secret is set once and is never returned by a read; the running application receives its value and can call out only to declared destinations. Read a package’s files before adding it, the same way you review code you wrote. See What this does not stop for what code holding a secret can still do with it.

Ferrite counts page views on this site. Privacy · Terms