Integration
Fact-checking & guardrails for Claude
Claude models are the workhorses of serious LLM deployments, and Anthropic’s platform earns its reputation – strong model-side alignment, workspace spend and rate limits, free moderation tooling, a Compliance API for enterprise oversight. None of it changes what happens at your boundary: your PII still enters the prompt unless something screens it, a summarized figure can still drift from its source, and your compliance duties are still yours. in/guard/out adds that boundary without asking you to change how you build.
Side by side
| Concern | Anthropic platform | in/guard/out |
|---|---|---|
| Model-side safety | Best-in-class alignment work – governs what the model will say | Boundary enforcement – governs what your traffic may contain and do |
| Harmful-content screening | Free moderation tooling for prompts, Anthropic’s policies | Classifier cascade on both directions, your policy, surgical censoring |
| Your customers’ PII | — reaches the API unless you screen it | Screened to placeholders before egress, restored on response |
| Figures vs sources | — | Deterministic numeric grounding + fact-check judge, per request |
| Output format | Tool-use JSON, prompt technique | Schema validate-and-repair, or a clean 422 |
| Spend control | Workspace / user spend and rate limits | Those still apply, plus per-run budgets with guard sub-calls priced in |
| Enterprise oversight | Compliance API + security-tool integrations (Claude Enterprise) | Per-request audit trail at the API boundary: checks, verdicts, timings, cost |
| Agent tool policy | — | Full agent stack – tool allow/deny, tiers, action grounding, taint – on the native route |
Keep the Anthropic SDK you already use
in/guard/out speaks the Anthropic Messages API natively: point your existing Anthropic SDK at it – x-api-key auth, content blocks, tool use, streaming responses – and every call crosses the full pipeline. PII screen and restore, grounding and fact-checking, content safety, injection defense, and the complete agent stack: Claude’s tool calls are inspected against your tool policy, permission tiers, action grounding, and budgets before your app acts on them. Prefer the OpenAI-compatible surface, or Claude via OpenRouter? Both work – same models, same pipeline, whichever dialect your code already speaks.
Model safety and boundary enforcement are not rivals; they answer different questions. Anthropic’s alignment work makes Claude less likely to produce harm from ambiguous instructions. It cannot know which figures your source documents contain, which tools your policy allows, or which of your customers’ identifiers must never leave your boundary – those are facts about your application, and they are enforced where your traffic flows.
Your Anthropic SDK, guarded
client = Anthropic(
base_url="https://api.inguardout.com",
api_key="gr-…",
)
client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[…],
)Setting it up with in/guard/out
1. Swap the base URL
Set base_url on your Anthropic client to in/guard/out and use a gr- key. Your Anthropic credentials go in the dashboard; requests route to the Anthropic API with them.
2. Keep your code
Messages, content blocks, tool use, streaming – the /v1/messages surface accepts what your SDK already sends. OpenAI-style clients keep working on /v1/chat/completions.
3. Turn on the checks
PII screening, grounding, format, and safety run on every Claude response; the agent stages inspect every tool call against your key’s policy.
4. Watch the tiers
Route Opus-class work and Haiku-class work through different keys with different check profiles – stricter grounding where the cheaper tier answers.
Frequently asked questions
Which Claude models work?
Whatever your configured upstream serves – Opus, Sonnet, and Haiku tiers via the Anthropic API, and the same families via OpenRouter. in/guard/out is model-agnostic; pricing metadata drives per-request cost tracking.
Doesn’t Claude already have strong safety built in?
Model-side safety and boundary enforcement answer different questions. Anthropic’s alignment work governs what the model will say; it cannot screen your customers’ PII out of prompts, verify figures against your source documents, enforce your tool policies, or produce your audit trail. Those live at your boundary.
Do I have to switch to an OpenAI-style client?
No. The proxy exposes the Anthropic Messages API natively – your Anthropic SDK works with a base-URL swap, including tool use and streaming. The OpenAI-compatible surface remains for apps built that way; both run the same pipeline.
How does streaming work with guardrails?
Guardrails need the complete response – a hallucinated figure can’t be un-streamed – so the proxy checks the full completion first, then delivers it to streaming clients in standard SSE frames. Your streaming code works unchanged; time-to-first-token reflects the checks.
Does PII screening interfere with Claude’s answers?
Placeholders are stable per value, so the model reasons over consistent tokens and the restore step returns a natural answer. Grounding compares against the screened source, so placeholders aren’t mistaken for changed values.
Related
Put guardrails in front of Claude
Keep your Anthropic SDK - one base-URL swap routes every Claude call through PII screening, fact-checking, and tool policy. We are running a limited demo - sign up and we will get you in as soon as we can.