Getting Started
In about ten minutes you will make your first trust check, gate a RAG pipeline so only trusted sources reach your LLM, and pull the audit record that proves what happened. All you need is an API key and curl.
What you'll build
Rasepi sits next to your AI stack, not inside it. The flow you are wiring up:
your app rasepi your llm
──────── ────── ────────
question
└─ retrieve 20 docs
└────────────────► filter-sources
allow 8 / warn 5 / block 7
◄────────────────┘
└─ build prompt from allowed + warned ──────────► generate answer
└────────────────► log usage (optional)Rasepi never sees your prompts and never talks to your model. One HTTP call in, decisions out.
1 Get an API key
In your Rasepi workspace, open Trust → AI Apps, register your bot as an application, and mint a key bound to it with the trust:evaluate, trust:read, and trust:usage scopes. Keys look like rk_live_…, carry an expiry, and are shown once. Using an app-bound key means every decision is attributed to that named app. (A plain tenant key from Admin → API Keys also works.)
Pass the key on every request, either way works:
Authorization: Bearer rk_live_xxxxxxxxxxxx
# or
X-Api-Key: rk_live_xxxxxxxxxxxx
For OAuth setups you can use a client-credentials token instead. See Trust API → Authentication.
2 Your first trust check
Ask Rasepi whether a single document may be used by a customer-facing bot. Source IDs can be a native entry (entry:{guid}), a connected document (confluence:SPACE:12345), or simply a URL:
curl https://api.rasepi.com/api/trust/evaluate \
-H "X-Api-Key: $RASEPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sources": ["https://wiki.acme.com/x/Ab12"],
"context": {
"actorType": "ai_agent",
"actorLabel": "support-bot",
"action": "answer_customer",
"channel": "public_support_chat"
}
}'The response gives you a decision with evidence, not just a score:
{
"decisionId": "0d9f…4b21",
"overallDecision": "block",
"results": [{
"sourceId": "https://wiki.acme.com/x/Ab12",
"title": "OAuth Migration Guide",
"decision": "block",
"freshnessScore": 41,
"reasons": [{
"code": "source_changed_after_review",
"dimension": "freshness",
"severity": "block",
"message": "Linked API reference changed after the last approved review."
}],
"requirements": { "citationRequired": true, "disclaimerRequired": false }
}]
}Try the same call with "channel": "internal" — the same document may come back as warn instead. Context is part of the decision.
3 Gate your RAG pipeline
For RAG, use /api/trust/filter-sources. Same request shape, but the response is already partitioned into allowed, warned, and blocked. Node example:
// after your retriever has found candidates
const candidates = await retriever.search(question)
const res = await fetch("https://api.rasepi.com/api/trust/filter-sources", {
method: "POST",
headers: {
"X-Api-Key": process.env.RASEPI_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
sources: candidates.map(c => c.url), // or entry:{guid} ids
context: {
actorType: "ai_agent",
actorLabel: "support-bot",
action: "answer_customer",
channel: "public_support_chat",
},
}),
})
const gate = await res.json()
// honor obligations on warned sources (citations, disclaimers)
const context = [...gate.allowed, ...gate.warned]
const answer = await llm.generate(question, context)The same in Python:
import os, requests
candidates = retriever.search(question)
gate = requests.post(
"https://api.rasepi.com/api/trust/filter-sources",
headers={"X-Api-Key": os.environ["RASEPI_API_KEY"]},
json={
"sources": [c.url for c in candidates],
"context": {
"actorType": "ai_agent",
"actorLabel": "support-bot",
"action": "answer_customer",
"channel": "public_support_chat",
},
},
).json()
context = gate["allowed"] + gate["warned"]
answer = llm.generate(question, context)Blocked sources never enter the prompt. Up to 100 sources per call; unresolvable IDs come back unresolved instead of failing the batch.
4 Log usage (optional, recommended)
After the answer ships, tell Rasepi which sources were actually used. Linked to the decisionId from step 3, this closes the loop between "allowed" and "relied on":
curl https://api.rasepi.com/api/trust/usage \
-H "X-Api-Key: $RASEPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"decisionId": "0d9f…4b21",
"actorLabel": "support-bot",
"action": "answer_customer",
"sources": ["https://wiki.acme.com/x/Ab12"],
"outcome": "answer_sent"
}'5 Explain a decision
Every evaluation is recorded in the decision ledger. Fetch any past decision with its per-source evidence exactly as it was at decision time:
curl https://api.rasepi.com/api/trust/decisions/0d9f…4b21 \
-H "X-Api-Key: $RASEPI_API_KEY"
This is the answer to the audit question: who or what relied on which knowledge, and why was it allowed?
★ Full runnable example
Prefer to read working code? demo/external-rag is a complete standalone RAG bot that does its own retrieval and OpenAI calls and gates every answer through the steps above. It seeds a handbook, registers an app, mints a key, and demonstrates allow / warn / block — plus the same bot with the gate switched off, leaking what it should not. Machine-readable spec: /openapi.yaml.