// Research / Trust, PII & Safety

LLM guardrails that hold up on your fine-tune.

Off-the-shelf guardrails were trained on someone else's model and harms taxonomy. We measure where Llama Guard drops on your fine-tune, train custom classifier heads, and red-team the full attack surface - chat and agentic - before launch.

// What we see

Generic safety classifiers miss your domain. They miss it quietly.

01

Llama Guard recall drops on your fine-tune

Fine-tuning shifts the model's distribution toward your domain; the off-the-shelf classifier never followed. Recall is reliably worse than on the base - the team finds out from a support ticket.

02

The harms taxonomy doesn't match your trust policy

Vendor categories cover violence, hate, self-harm. Your trust team cares about competitor mentions, off-policy financial advice, and PII exfil. The classifier flags what was easy to label.

03

The attacks that hit production aren't the ones on the demo

DAN and role-play variants are well-covered by Garak. Production incidents come from MCP tool responses that override the system prompt, instructions embedded in retrieved documents, and multi-turn escalation.

// Case Study

Guidemate - tourist AI agent for the Lubelskie region

We built Guidemate as a LangGraph-based agent embedded on the Lubelskie Voivodeship's official tourism portal - typed toolkit over the region's curated tourism knowledge, integrated with Poland's RCB government safety-warning feed, deployed on the LangGraph Platform agent service. Serves visitors in 30+ languages at ~$0.01 per message, with a guardrails layer running at 99.3% accuracy.

  • 99.3%

    guardrails accuracy

  • $0.01

    per message

  • 30+

    languages supported

Read the case study
Guidemate - tourist AI agent for the Lubelskie region

// What we do

Three things that decide whether the guardrails hold.

Most safety failures aren't the absence of a classifier. They're a classifier trained on the wrong distribution, a taxonomy that doesn't match the trust policy, and a red-team that stops at public corpora.

Custom classifier heads on your distribution

Distilled classifier heads trained on your domain where the off-the-shelf taxonomy drops.

  • DeBERTa or ModernBERT heads, sub-10ms inline inference
  • Llama Guard 3 and NeMo Guardrails where they fit
  • Active-learning loop on flagged production traffic

Red-team beyond the public corpus

Garak runs the published attacks; our team runs the ones that aren't yet.

  • Domain-specific jailbreaks and multi-turn escalation
  • Indirect injection via RAG inputs and tool outputs
  • Report with concrete attack traces

Eval suite gating every deploy

Pass/fail thresholds per attack class block deploys before the regression lands.

  • Garak suite tuned to your model plus your red-team prompts
  • Regression set built from real incidents
  • Streaming-aware - generation stops on the offending token

// Method fit

Custom guardrails aren't the right control for every LLM.

skip it if

  • You're calling a frontier API directly

    If you accept OpenAI's or Anthropic's safety policy as yours, the moderation endpoint plus a sane system prompt covers the surface.

  • Your real concern is data leakage

    If PII leaking to a third-party LLM is the dominant risk, an egress-side redactor is cheaper than a guardrail layer.

    PII Redaction & LLM Data Privacy
  • The harms surface is small and static

    A narrow internal tool with a known input distribution and no adversarial users needs only a system prompt plus rule-based output validation.

use it if

You've fine-tuned an open-weight model and need to verify the off-the-shelf classifier still holds on your distribution before shipping.

You're running an agentic system - LangGraph, LlamaIndex, AWS AgentCore, custom - that consumes retrieved content, external tools, or MCP server responses. The injection surface is fundamentally different from chat.

Your harms taxonomy doesn't match the vendor categories - your trust team cares about competitor mentions, off-policy advice, and PII in generated text.

Enterprise procurement is asking for documented red-team results, classifier F1 on your distribution, and a CI-gated eval suite.

// How we work

Taxonomy first. Red-team in the open. Hand off the eval.

Every guardrail engagement starts with the harms taxonomy your trust team owns - and a measurement of where the off-the-shelf stack drops on your distribution. The classifier work comes after.

01

Taxonomy and gap measurement (week one)

A workshop with your trust team defines what's blocked, flagged, allowed-but-logged, or out of scope. Then we measure where Llama Guard, NeMo, and the moderation API drop on your traffic.

02

Iterate in a shared workspace

Every classifier head, red-team round, and eval delta lands in a Weights & Biases or MLflow workspace your engineers can see. The dashboard replaces the status report.

03

Hand off the eval and the runbook

We hand off the classifier heads, integration code, the eval suite in your CI, and a runbook for false-positive triage, kill switches, and tenant overrides. Slack for 30 days.

Karol Gawron

// Expert insight

Llama Guard is a strong default - until you fine-tune. Domain fine-tunes drift the model's behavior in ways the off-the-shelf classifier was never trained to catch, and the eval surface narrows in lockstep. Custom classifier heads exist because that gap is real, not because we want to sell more model training.

Karol Gawron

Head of R&D @ bards.ai

See our open-source work

// Why bards.ai

We've shipped guardrails, watched them get attacked, and trained the heads from scratch.

Adversarial ML rewards experience. We've shipped guardrails to production, watched them get attacked, and trained the heads from scratch - on our own published models.

Authors of the EU PII model

bardsai/eu-pii-anonymization-multilang is ours. Output PII validation runs on a model we publish - no licensing surprises, no opaque vendor stack.

Agentic attack surface, not just chat jailbreaks

We test indirect injection through MCP tool responses, RAG-retrieved documents, and function-call outputs - the vectors causing production incidents in 2025-2026.

F1 measured on your distribution, not a vendor benchmark

We run the base classifier on a sample of your traffic before writing integration code. That number drives the engagement scope.

Evidence-grade deliverables for compliance buyers

Red-team reports, classifier calibration results, and eval pass/fail logs with per-attack-class thresholds - the documentation format your buyers and auditors expect.

10+ peer-reviewed NLP publications

CLARIN-PL spinoff. We read the safety literature when it lands and ship classifier heads from scratch.

Experience measured in attacks survived

Everyone on your engagement has run a guardrail stack in production, triaged flagged traffic, and retrained heads when new attack patterns landed.

// FAQ

Common questions about LLM guardrails

Fine-tuning narrows the model's distribution toward your domain - and narrows the safety classifier's training distribution out of it. Llama Guard's recall on a domain-specific model is reliably worse than on the base it was trained against. The fix is a domain-tuned classifier head plus a real eval on your fine-tune, not a stronger off-the-shelf default.

Distilled classifier heads: 5-15ms per call on a T4 or L40S. Llama Guard 3 (8B) inline: 50-150ms depending on context length. For latency-sensitive routes we run a small classifier inline and a larger one async on a sample. Output guardrails run streaming - they stop generation on the offending token rather than waiting for the whole response.

Two ways. First, our red-team runs domain-specific attacks during the build - we don't ship without exploring the prompt space your customers actually inhabit. Second, the production system logs flagged inputs under a strict review policy, our team triages new attack patterns weekly, and the input classifier gets retrained on the new corpus.

Yes - and the threat model is meaningfully different. The dominant attack against production agents isn't a jailbreak in the user message; it's an instruction injected through a retrieved document, an MCP server response, or a tool's return value. We add input scrubbing at the agent tool boundary, structured-output validation on every tool call, and per-tool authorization policies that the agent can't override at runtime. Agent guardrails are a superset of chat guardrails - the underlying classifiers are the same, but the instrumentation points and the red-team playbook are distinct.

Article 15 of the EU AI Act requires high-risk AI systems to include appropriate accuracy, robustness, and cybersecurity measures - with technical documentation that supports post-market monitoring. A calibrated classifier suite with per-attack-class F1 measurements, a structured red-team report, and a CI-gated eval suite are the evidence artifacts that satisfy both internal audit and third-party conformity assessments. We produce these as part of every engagement; the documentation format is designed to map to Article 9 risk management and Article 15 technical requirements, not to serve as a marketing brochure.

// Let's ship it

Your fine-tune changed the attack surface. Let's map it.

Bring the model, the trust policy, and your traffic shape. We'll come back with a guardrail architecture, a red-team plan, and a number - usually within a business day.

Engagements from
$40K
Typical range
$40K-$100K
Duration
4-8 weeks

Fixed-fee proposal after the first scoping call. Scope drivers: classifier custom-training scope, red-team depth, greenfield eval suite.

Karol Gawron

Karol Gawron

Head of R&D @ bards.ai