Skip to main content

Crate systemprompt

Crate systemprompt 

Source
Expand description
systemprompt.io

§systemprompt

The governance engine behind AI infrastructure you actually own. One Rust binary, one PostgreSQL, every agent and tool call through one audited path. This is the facade crate: it re-exports the systemprompt-core workspace behind feature flags.

Crates.io Docs.rs codecov License: BSL-1.1 Rust 1.94+ PostgreSQL 18+

Website · Documentation · Evaluation template · Discord

§What this crate is

systemprompt is the facade over the systemprompt-core workspace: one dependency and one feature matrix in place of thirty-odd systemprompt-* crates. Depend on it to build extensions, embed the governance pipeline, or drive the API server from your own binary.

For what the platform is and why it exists, see the repository README. To evaluate it end to end without writing code, start with the MIT-licensed systemprompt-template, whose scripted demo suite runs every published claim on your laptop.

§Use as a library

[dependencies]
systemprompt = { version = "0.29.0", features = ["full"] }
use systemprompt::prelude::*;
FeatureIncludes
core (default)traits, models, identifiers, extension
databasePostgreSQL abstraction (DbPool)
apiHTTP server and AppContext (requires core + database)
cliCLI entry point
fullEverything: all domain modules + CLI
slackSlack integration (opt-in; not included in full)
teamsMicrosoft Teams integration (opt-in; not included in full)

The full per-feature matrix, including the finer-grained flags (config, mcp, events, security, runtime, and the rest), is on the docs.rs crate root.

§Requirements

  • Rust 1.94+ (the workspace is edition 2024).
  • PostgreSQL 18+ for every feature above core.

Running the server rather than depending on it is covered in getting-started.md.

§License

Business Source License 1.1 (BSL-1.1). Source-available for evaluation, testing, and non-production use; production use requires a commercial license. Each version converts to Apache-2.0 four years after its publication. You will always be able to read, audit, and eventually own this code. See LICENSE. Licensing enquiries: ed@systemprompt.io.

§Security

Report vulnerabilities to ed@systemprompt.io, not via public issues. See SECURITY.md.


systemprompt.io · Documentation · Guides · Live Demo · Template · crates.io · docs.rs · Discord

Rent your control plane and you rent your audit trail. This one compiles.

# Feature flags
FeaturePulls inUse case
core (default)traits, models, identifiers, extension, template-providerAuthor extensions, share types, no I/O.
databasesystemprompt-database, sqlxSQLx-backed DbPool and repository helpers.
configsystemprompt-configProfile, secrets, and credential bootstrap loaders.
mcprmcpImplement Model Context Protocol servers.
apisystemprompt-api, systemprompt-runtime, axum (implies core + database)HTTP server, AppContext, Axum router.
cloudsystemprompt-cloudCloud API client, credentials bootstrap, OAuth.
loggingsystemprompt-loggingTracing setup with the workspace’s layer stack.
loadersystemprompt-loaderFilesystem and module discovery.
eventssystemprompt-eventsIn-process event bus and SSE plumbing.
clientsystemprompt-clientHTTP API client used by the CLI.
securitysystemprompt-securityJWT, scope/RBAC, secret scanning, rate limit.
clisystemprompt-cliThe systemprompt CLI as a library entry point.
runtimecli + extension injectionRuntimeBuilder for embedding with custom extensions.
test-utilscloudEnables cloud for test scaffolding; not for production.
fullAll of the above plus all domain crates (agent, ai, mcp, oauth, users, content, analytics, evaluation, scheduler, generator, files)Building a product binary.
systemprompt = { version = "0.29.0", features = ["full"] }

Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.

Re-exports§

pub use runtime::RuntimeBuilder;runtime
pub use runtime::RuntimeError;runtime
pub use crate::prelude::*;

Modules§

agentfull
Agent-to-Agent (A2A) protocol: message types, task lifecycle, streaming server, agent registry.
aifull
Provider selection, request/response types, cost accounting.
analyticsfull
Request, conversation, agent, tool, and cost metrics.
apiapi
HTTP server entry: Axum router, middleware stack, listener bootstrap.
clicli
CLI entry surface: run, CliConfig, OutputFormat, ColorMode, VerbosityLevel.
clientclient
HTTP API client used by the CLI and external tooling to drive a running instance.
cloudcloud
Credentials bootstrap, tenant management, deployment.
configconfig
Profile / secrets / credentials configuration loaders. Drives the ProfileBootstrap → SecretsBootstrap → CredentialsBootstrap → Config sequence.
contentfull
Pages, articles, markdown ingestion.
credentialscloud
Loads OAuth client credentials and tenant identity at startup.
databasedatabase
SQLx-backed database abstraction: DbPool, DatabaseProvider, repositories, introspection.
evaluationevaluation
Evaluation framework: judge runs over production AI traffic, failure replay with repair hints, and the auto-improve loop.
eventsevents
In-process event bus and SSE broadcasting.
extensioncore
Compile-time extension framework: the Extension trait, typed variants, register_extension! macro, and registry.
filesfull
generatorfull
Tera-based renderer driving the web CLI domain.
identifierscore
UserId, AgentId, TaskId, TraceId, and the rest of the wrappers.
loaderloader
Filesystem and module discovery for services, plugins, and config files.
logginglogging
Tracing/logging setup helpers (startup-mode gating, layered subscribers).
marketplacefull
The MarketplaceFilter trait, which gates per-user visibility of plugins, skills, agents, and managed MCP servers in the bridge manifest.
mcpfull
Server orchestrator, network/proxy layer, RBAC middleware.
modelscore
I/O-free: config structs, profile types, domain DTOs.
oauthfull
OAuth2, OIDC, and WebAuthn flows.
prelude
Curated re-exports for use systemprompt::prelude::*. Curated re-exports for use systemprompt::prelude::*.
profilecore
Profile types — the on-disk profile schema (Profile, CloudConfig, ProfileStyle, CloudValidationMode) plus the ProfileBootstrap loader when the config feature is enabled.
runtimeruntime
RuntimeBuilder for embedding the platform with compile-time injected extensions and a custom web-asset strategy. Embedding helper for the systemprompt CLI.
schedulerfull
securitysecurity
Security primitives: JWT verification, scope/RBAC, secret scanning, rate-limit middleware.
slackslack
Inbound Events API, slash commands, and Block Kit interactivity dispatched to governed agents.
systemapi
Application runtime / AppContext wiring. Construct via AppContextBuilder from the prelude.
teamsteams
Inbound Bot Framework activities, token validation, Adaptive Card rendering.
template_providercore
Template provider trait surface for custom rendering backends (Tera, Handlebars, MJML, …).
traitscore
Includes LlmProvider, ToolProvider, Job, and the typed error contracts (ApiError, ExtensionError, McpErrorData).
usersfull
Accounts, roles, scopes.

Enums§

WebAssetsruntime
Controls how the runtime serves the static web bundle: in-binary, on-disk, or disabled. Web-asset serving strategy re-exported from systemprompt-extension.