Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Plugin Authoring Overview

Truss extension work should start from the smallest seam that preserves the runtime’s trust model. The safe path is:

  1. Use MCP when the extension is an external tool or already exists as a service.
  2. Use an in-process Rust Tool when the tool must share process memory or run hot/trusted logic.
  3. Use a provider plugin when adding a model backend or auth strategy.
  4. Use an event or ledger consumer when the extension only observes runs.
  5. Use a sandbox or anchor backend when swapping infrastructure behind an existing trust boundary.

The key rule is simple: outcome-affecting work must pass through Ctx, policy, events, and the signed ledger. Presentation-only work should stay off-journal.

Current seams

SeamCurrent APIBest forJournal rule
Providertruss_core::provider::Provider, built through truss_providers::registryModel backends, auth strategies, local OpenAI-compatible serversModel results are journaled by the agent/durable loop, not by the provider
In-process tooltruss_core::tools::ToolTrusted Rust tools that touch local state or need low latencyOverride call_with_ledger when the tool creates durable facts or side effects
MCP server tool[[mcp.servers]] + mcp:<server>:<tool>Out-of-process tools and enterprise integrationsTruss records mcp_tool_call provenance plus replayable tool_result
Event streamAgentEvent via Ctx::with_eventsLive UIs, logs, dashboards, telemetryUsually off-journal; observe without changing run outcome
Ledger readerLedgerReader, truss ledger ...Evidence exports, audits, buyer reports, recallRead-only; never rewrites signed entries
Sandboxtruss_core::sandbox::SandboxStronger command isolation behind existing self-check/tool flowsKeep the same self_validation journal shape
Anchortruss_core::anchor::AnchorRekor/transparency log/on-chain hash anchoringAnchor hashes only, never evidence or secrets
ContextProviderRoadmap seamEnterprise docs/vector/policy injectionNot a public trait yet; do not invent a parallel path

Pick the seam

Authoring checklist

  • Does this extension affect the model’s answer, contract verdict, filesystem, network, spend, memory, or identity? If yes, route it through a core seam.
  • Does it only render, summarize, notify, or visualize already-recorded data? If yes, keep it as a consumer and do not add journal entries.
  • Can it run out-of-process? Prefer MCP. In-process tools are for trusted code.
  • Does it need credentials? Resolve them inside the provider/MCP server/backend and avoid recording secret values.
  • Does it create a fact future runs may rely on? Stamp it with LedgerRef provenance.
  • Does it perform a side effect that should execute once? Make it replayable via the durable ledger/memo path instead of relying on best-effort idempotency.

Verification checklist

  • cargo test or a focused crate test for Rust seam changes.
  • truss mcp probe <server> for MCP tools.
  • truss ledger verify <run-id> or truss ledger export <run-id> for durable evidence.
  • mdbook build docs for docs and examples.
  • Confirm no secret values appear in logs, events, or ledger payloads.