cendor-sdk 1.4.0
Guardrails maturity (plan-guardrails-v02). Additive and backward-compatible. Requires
cendor-guardrails>=1.2 and cendor-acttrace>=1.4. (Folds the never-released 1.3.0 — Waves 1 & 2
below — into a single minor with Wave 3; if the waves ship separately, 1.3.0 = Waves 1–2 and
1.4.0 = Wave 3.)
Added (Wave 4 — bounded re-ask, streaming checks)
Agent(reask_on_output_trip=N)— when an output-stage guardrail blocks the final answer,
re-ask the model to revise it up toNtimes instead of raising (default0= raise immediately).
Each re-ask is a full model call — its cost lands in tokenguard/acttrace like any other; bounded by
the cap andmax_turns; if every re-ask still trips, the block raises (fail-closed). Applies to
run/run.aioand per-segment orchestration (non-streaming). The re-asked block is still
recorded on the audit chain andResult.guardrail_decisions.Agent(stream_check_window=N)— onrun.stream, also evaluate the output guardrails on the
buffered text everyNcharacters, so a block fires earlier in the stream (default0= final
text only). Already-yielded deltas can't be unshown, so this narrows the window, it doesn't close it
(redact mid-stream isn't applied) — single-agentrun.streamonly.
Added (Wave 3 — hosted rails, config-as-data, grounding)
- Hosted rails via
rules—rules.bedrock_guardrail/rules.azure_content_safety/
rules.model_armorre-exported fromcendor-guardrails, usable inAgent(guardrails=[…])at any
of the four stages. The client is bring-your-own (duck-typed, metered by the vendor); every verdict
still lands as a localguardrail_decisionin the run's audit chain ("cloud check, local
evidence"). Also re-exported:rules.groundedness/rules.denied_topics(bring-your-own
embedding fn) for RAG-hallucination and off-topic gating. load_policy()/LoadedPolicyre-exported at the SDK top level — declare deterministic
guardrails in a versioned JSON/YAML file and pass the result straight toAgent(guardrails=…).
The policy's content hash + version are stamped into every decision, so the run's audit chain
proves which policy was active.
Added (Wave 1 — PII bridge, execution model, decision inspection)
rules.pii()/rules.secrets()/rules.entropy()— PII/secret guardrails bridged from
acttrace's detector catalogue (the SDK may import libraries; the tool→tool ban only constrains
the libraries). They gate all four stages by default — includingtool_output, which the
process-globalguard()never sees.rulesis now the SDK's own superset module (the
deterministiccendor.guardrailsrules re-exported + the three bridged ones). No catch-rate claim
— coverage is exactly acttrace's catalogue.Agent(guardrail_mode=…)+ per-runrun(agent, input, guardrail_mode="parallel")— overlap
input-stage guardrails with the first model call (OpenAI-parity, async only) for lower latency on
the pass path; default"blocking"stays pre-spend. Honest limit: parallel mode can bill a call a
later trip blocks, and does not apply input redaction before the call.Result.guardrail_decisions— every trip/flag recorded during a run, for post-hoc inspection
without re-reading the audit file (populated forrun/run.aio/run.stream/ teams).judgere-exported fromcendor.sdk— thecendor.guardrails.judgehelpers (verdict prompt +
strict-JSON parsing) for buildingrules.llm_judgechecks; the judge call rides an instrumented
client, so its own spend is budgeted + audited. Per-guardrailtimeout/on_error(from
cendor-guardrails1.1) flow throughrules.custom/rules.llm_judge.
Added (Wave 2 — detection-tier adapters via rules)
- The SDK's
rulessuperset now also re-exports the opt-in detection-tier adapters from
cendor-guardrails1.1:rules.classifier(BYO local model),rules.prompt_guard(prompt-injection
classifier adapter,[promptguard]extra — no jailbreak-detection claim),rules.language
(language-switch guard), andrules.openai_moderation(OpenAI's free moderation endpoint). See the
guardrails "Threat model" for what each tier does and doesn't stop.