
A prompt glued to an endpoint. One jailbreak and it breaks.
Guardrailed Agentic AI API
A hardened agent API: attacks screened before the model, leaks screened after it, prompts versioned behind an evaluation gate.

Most AI features are a prompt glued to an endpoint: one jailbreak, rate limit, follow-up question or careless prompt edit and they break.
One jailbreak and it breaksEvery request is screened before the model and every answer before it leaves; blocked requests cost zero tokens; prompts ship only through an audited evaluation gate; every answer is traceable by request ID.
How it works
English subtitles burned in · Spanish CC on YouTube
Promise one: attacks stay out.
Every request is screened for prompt injection before the model is called (OWASP LLM01). A blocked request returns a generic error and costs zero tokens.
Promise two: secrets stay in.
Answers are re-screened for system-prompt leakage and reflected injection before they leave (OWASP LLM02). A flagged answer is replaced with a safe message.
Promise three: every change is proven.
Prompts are versioned artifacts promoted only if they pass an A/B evaluation gate; the safety metric can never be overridden. Every change is sealed in a hash-chained audit log and rollback takes one call.
A hiccup? It retries.
Conversations persist per session, so follow-ups like "now double that" resolve against full history. Transient model errors are retried with backoff instead of becoming 500s.
One request ID. Every answer traceable.
One request ID ties traces, JSON logs and Prometheus counters together. Every response names the prompt version and hash that produced it.
Production-shaped by default.
Per-client rate limiting, optional API-key auth and a non-root Docker image with a health check. CI runs the full suite with zero secrets.
Architecture

Text description of the diagram
The Client hits the FastAPI edge (request-id, security headers, rate limit, API key) over POST /agent/run and /agent/stream. The edge passes the guardrail (sanitize + injection screen, OWASP LLM01): blocked input short-circuits to error_output and then the JSON/SSE response; safe input reaches the planner (structured output with retry/backoff), then execution tools (calculator, echo, web_search), then the output_guardrail leak screen (OWASP LLM02) before the JSON/SSE response. The Prompt Registry (prompts/<name>/vN.yaml + registry.json) supplies the promoted template and links to the hash-chained audit log; the planner keeps per-session checkpoints in SQLite and emits opt-in traces; the edge emits structlog JSON logs and Prometheus /metrics counters.
Measured. Not claimed.
- SQLite memory suits demos and light workloads; high concurrency should move to a Postgres checkpointer.
- Shared-secret API-key auth, not OAuth2/JWT identity; no multi-tenant isolation.
- The 22-case evaluation dataset guards against regressions on known cases; it does not prove prompt quality.
A real, running service. Not a slide.
Stack
Your product. Your tools. Your rules.
Guardrails, streaming, memory and a prompt gate — the boring parts are already done; the tools shown are examples, adapted to your systems on request.

