Hoppa till innehållet

Back to Guardrino

Tutorial · Available

Put Guardrino in front of your OpenAI-compatible app

Three steps, and no change to your app except one URL.

Status: Available. This integration is built and tested. Pilot companies receive the Guardrino package from HisnLabs.

Developer reference · Install guide · AI platforms · Open model card · OpenAI-compatible proxy · Streaming · LiteLLM · MCP security proxy · Tutorial: LiteLLM · Tutorial: MCP tools

Try it today Guardrino-t7 Open, an earlier version of our classifier, is public on Hugging Face under Apache-2.0. The demo runs in your browser: what you type stays on your device. Live demo · Model card · Same demo on Hugging Face

Step 1 · Set the upstream

Guardrino must be installed first (see the install guide). In its policy file, add a [proxy] section that names the model API your app uses today.

block_status = 403            # answer a refused message with HTTP 403 (default 400)

[proxy]
upstream = "https://llm.example/v1"   # the model API Guardrino forwards to
api_key = "UPSTREAM_KEY"              # optional: when unset, the caller's key is passed through
buffer_output = false                 # true: hold the reply until it has been checked

Leave api_key out if your app should keep sending its own key: Guardrino passes it through.

Step 2 · Change the base URL

In your app, replace the model provider’s base URL with Guardrino’s. Nothing else changes.

from openai import OpenAI

# The only change: the base URL (and the key your Guardrino deployment expects).
client = OpenAI(base_url="https://guardrino.example/v1", api_key="YOUR_KEY")

reply = client.chat.completions.create(
    model="your-model",
    messages=[{"role": "user", "content": "Summarise this ticket."}],
    user="conversation-7f3a",  # becomes the conversation_id
)

To tie turns together without touching your code, send the same user value or the X-Guardrino-Conversation header on every turn of a conversation.

Step 3 · Check it works

Send a normal message and then one that your policy refuses. The first returns the model’s reply; the second returns an error in the OpenAI error shape.

curl https://guardrino.example/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Guardrino-Conversation: conversation-7f3a" \
  -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'

If your app streams replies, read the streaming page to choose between live chunks and buffer_output = true.

Request early access