Guardrails
Open core · self-host + all Splyntra Cloud plans
Detection observes and scores risk after the fact. The guard acts on it in real time. Configured on the SDK, the guard runs a pre-flight check on each call and can monitor or block risky input before your agent proceeds.
Guard modes
Set guard on the SDK constructor. It takes three values:
| Mode | Behavior |
|---|---|
"off" | No inline guarding. Detection and redaction still run. |
"monitor" | Risky calls are flagged and scored but allowed to proceed. |
"block" | High-precision injection is blocked pre-flight, raising SplyntraBlocked. |
- Python
- TypeScript
from splyntra import Splyntra, SplyntraBlocked
Splyntra(
api_key=...,
project="support-agent",
guard="block", # "off" | "monitor" | "block"
guard_fail_open=True, # default; allow if the guard service is unreachable
)
try:
run_agent(user_input)
except SplyntraBlocked:
# A high-precision injection was detected pre-flight.
reject_request()
import { Splyntra, SplyntraBlocked } from "@splyntra/sdk";
new Splyntra({
apiKey: ...,
project: "support-agent",
guard: "block", // "off" | "monitor" | "block"
guardFailOpen: true, // default; allow if the guard service is unreachable
});
try {
await runAgent(userInput);
} catch (e) {
if (e instanceof SplyntraBlocked) {
// A high-precision injection was detected pre-flight.
rejectRequest();
}
}
Pre-flight injection blocking
In block mode the guard performs a high-precision prompt-injection check before the
call runs. When it matches, the SDK raises SplyntraBlocked and the call never executes.
Only high-precision injection signatures block. This keeps the guard from tripping on legitimate input — benign role-play and ordinary prompts that resemble instructions pass through. Lower-confidence signals are still scored and surfaced via detection and the risk score, but they do not block.
Fail-open behavior
guard_fail_open / guardFailOpen controls what happens when the guard service cannot be
reached. With the default true, calls are allowed if the guard is unreachable, so a
guard outage never takes your agent down. Set it to false to fail closed and block when
the guard cannot render a verdict.
Next steps
- Security overview — the detection pillars and risk score.
- Detection & redaction — what the detectors flag.