Quickstart
Run your first guardrail: add ScopeGuard-2 to a simple parcel-tracking assistant, so that it blocks every query the assistant must not handle.
This Quickstart runs the guardrail on your own hardware: you need a Linux machine with an NVIDIA GPU and the model weights, available on request on Hugging Face. With no hardware on your side, follow the Hosted API Quickstart: ScopeGuard-2 on our servers, plus a dashboard for your keys and usage.
Install the library
You need Python 3.10 to 3.13. The scope-guard-vllm extra adds vLLM, which runs the model:
pip install "orbitals[scope-guard-vllm]"
Write the script
Save this as quickstart.py:
from orbitals.scope_guard_v2 import ScopeGuardV2
sg = ScopeGuardV2(
backend="vllm",
model="principled-intelligence/scope-guard-v2-4B-q-2609",
)
result = sg.validate(
[
{
"role": "user",
"content": "I ordered a package, tracking number 1234567890",
},
{
"role": "assistant",
"content": (
"Great, the package is in transit. "
"What would you like to know?"
),
},
{
"role": "user",
"content": "If it does not arrive tomorrow, can I get a refund?",
},
],
ai_service_description=(
"A virtual assistant for a parcel delivery service. "
"It tracks packages by tracking number "
"and gives expected delivery dates. "
"It never handles refund requests."
),
)
print(result.scope_class.value)
backend="vllm" loads the model named by model into your Python process.
Run it
python quickstart.py
Restricted
The first run downloads the weights (about 9.3 GB), and vLLM prints its loading logs before the verdict. Restricted means your AI service must never process the message, so you do not pass it on to your LLM.