systemprompt 0.6.1

Self-hosted AI governance infrastructure. The Rust library behind systemprompt.io: MCP-native tool-call governance, 6-tier RBAC, secret detection, full audit trails, SIEM-ready events. Provider-agnostic across Anthropic, OpenAI, Gemini, and local models. PostgreSQL, air-gap capable, BSL-1.1.
Documentation
//! Demonstrates connecting a `DbPool` against a Postgres URL.
//!
//! Run with: `cargo run -p systemprompt --example database --features database`
//! (requires a reachable Postgres at `postgres://localhost/systemprompt`).

use systemprompt::database::Database;
use systemprompt::prelude::DbPool;

#[tokio::main(flavor = "current_thread")]
async fn main() {
    tracing_subscriber::fmt::init();
    let url = std::env::var("DATABASE_URL")
        .unwrap_or_else(|_| "postgres://localhost/systemprompt".to_string());

    match Database::new_postgres(&url).await {
        Ok(db) => {
            let pool: DbPool = std::sync::Arc::new(db);
            tracing::info!(has_write_pool = pool.has_write_pool(), "connected");
        },
        Err(err) => {
            tracing::error!(error = %err, "connect failed");
        },
    }
}