Mirror runs policy evaluations in 4ms at the edge of your agent — redacting PII, blocking tool abuse, and routing flagged conversations to human review without touching your inference path.
A rules engine, a redaction layer, and a violation feed — wired together with the same trace context as your spans. Drop in the SDK, ship policies as code.
YAML or TypeScript. Versioned with your code, evaluated at inference time. Branch policies per environment.
# refund-agent guardrails name: refund-agent version: 12 on: prompt: - pii_redact: { entities: [email, phone, ssn] } - jailbreak_detect: { action: retry, max: 2 } tool_call: - allowlist: [stripe.refund, crm.note] - rate_limit: { stripe.refund: 6/min } response: - toxicity: { threshold: 0.85, action: block } - schema: ./schemas/refund.json on_block: route_to: review-queue
Severity, agent, policy, and the redacted span — one click to the full conversation.
Tokens replaced before the model sees them; re-hydrated only in your audit log.
// 4 lines, OpenAI-compatible import { guardrail } from "mirror-sdk"; const mirror = guardrail({ policy: "refund" }); await mirror.wrap(openai.chat.create);
Dedup violations by policy + agent + 5-minute window. Route high-severity to PagerDuty, the rest to a Slack channel — or your incident pipeline of choice.
Mirror reuses your offline eval suite as runtime policies. The same prompt → response → grade loop you ran in CI now runs on every live request — with rollouts, kill-switches, and gradual exposure.
A guardrail evaluation is one rule running against one inference. Bundles roll over. No per-seat tax on your safety team.
For a side project or a single agent in staging.
For teams shipping LLM features to real customers.
For regulated industries and 100M+ request workloads.
"Mirror replaced 2,400 lines of ad-hoc Python regex with twelve YAML files. Our PII incident rate dropped to zero for the last 184 days."
"The shadow-mode rollouts are the killer feature. We've shipped 38 policies without a single false-positive incident in production."
"P95 added 6ms to our agent loop. It's the cheapest insurance policy we've ever bought, and the audit log paid off in the first SOC 2 review."
If you have a deeper question, the engineering Slack answers within a few hours during EU/US hours.
One eval = one rule running against one inference. A request that triggers 3 rules costs 3 evals. We bill in $0.00018 increments and bundles roll over month-to-month for 90 days. Shadow-mode evals are billed at 25% of the live rate.
Both. The SDK runs deterministic rules (allowlists, schemas, redaction) in-process — typical overhead 1.4ms. ML-based rules (toxicity, jailbreak) run in a local sidecar that you deploy alongside your service. We also offer a managed proxy at proxy.mirror.dev for teams who don't want to host anything.
Yes. Export a function with signature (ctx) => Verdict and reference it from YAML. Custom rules run sandboxed in V8 isolates with a 50ms hard timeout and no network access by default. We also support Python via a gRPC bridge for the ML team's preferences.
For a request with 4 active rules: P50 8ms, P95 11.8ms, P99 18.3ms — measured against our public dashboard at status.mirror.dev. The proxy speaks the OpenAI chat-completion protocol natively, so swapping api.openai.com for proxy.mirror.dev is the entire integration.
Redaction happens before the model call, and the redacted form is what lands in our logs. Re-hydration tokens live exclusively in your customer-managed KMS key — we cannot decrypt them. The audit log writer signs each entry with an Ed25519 key per workspace so you can verify chain-of-custody at any time.
Ship your next LLM feature behind 12 audited rules. The free tier covers 100k evaluations and never expires.