systemprompt-api 0.14.4

Axum-based HTTP server and API gateway for systemprompt.io AI governance infrastructure. Exposes governed agents, MCP, A2A, and admin endpoints with rate limiting and RBAC.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use axum::extract::Request;
use axum::middleware::Next;
use axum::response::Response;
use systemprompt_models::Config;

pub async fn inject_served_by(request: Request, next: Next) -> Response {
    let instance_id = Config::get().ok().map(|cfg| cfg.instance_id.clone());

    let mut response = next.run(request).await;

    if let Some(id) = instance_id {
        if let Ok(header_value) = id.parse() {
            response.headers_mut().insert("x-served-by", header_value);
        }
    }

    response
}