Skip to main content

ScopeGuard-2

ScopeGuard-2 verifies whether a user message falls within the intended scope of your AI service. It takes the last user message, along with the earlier turns of the conversation (if any), and classifies it against a description of your AI service:

The last user message of a conversation, "If it does not arrive tomorrow, can I get a refund?", after the user's "Where is package 1234567890?" and the assistant's "It is in transit and should arrive tomorrow.", goes into ScopeGuard-2, which also reads the AI service description "Parcel delivery assistant. Never respond to requests for refunds." and returns one scope class: Restricted (explicitly forbidden: your AI service must NEVER process it).The last user message of a conversation, "If it does not arrive tomorrow, can I get a refund?", after the user's "Where is package 1234567890?" and the assistant's "It is in transit and should arrive tomorrow.", goes into ScopeGuard-2, which also reads the AI service description "Parcel delivery assistant. Never respond to requests for refunds." and returns one scope class: Restricted (explicitly forbidden: your AI service must NEVER process it).
See it in the PlaygroundExample conversations, each with what ScopeGuard-2 returned.

Scope classes​

ScopeGuard-2 assigns the message exactly one of seven scope classes, judged only against your AI service description, so your code can branch on it:

ClassMeaning
Directly SupportedClearly within the scope of your AI service, which should handle it.
Potentially SupportedA reasonable extension of what your AI service does, with no rule that applies.
Predefined AnswerMatches a scenario with a pre-written response.
Human OversightNeeds human judgment, or meets an escalation criterion.
Out of ScopeOutside the responsibilities of your AI service.
RestrictedExplicitly forbidden: your AI service must NEVER process it.
Chit ChatSmall talk unrelated to your AI service ("thank you", "goodbye").

First call​

You need Linux with an NVIDIA GPU and Python 3.10 to 3.13. The first run downloads the weights from Hugging Face (about 9.3 GB).

Pythonfirst_call.py
pip install "orbitals[scope-guard-vllm]"
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) # e.g. Restricted
No GPU? The same call runs on the hosted API.Hosted version