Skip to content

BryanTegomoh/chembio-safety-classifier

Repository files navigation

ChemBio Safety Classifier

A policy and evaluation framework for ChemBio refusal calibration in advanced AI systems.

ChemBio safety is not solved by maximizing refusal rate. The harder problem is calibration: block requests that provide operational harmful capability, preserve legitimate scientific and defensive work, and make the boundary auditable enough for expert review.

This repository turns that problem into a concrete framework: a label taxonomy, a quadrant model for classifier errors, a preference-training signal, a failure-mode review loop, and a small deterministic reference classifier.

The Core Insight

Refusal is a confusion matrix, not a virtue signal.

The matrix below is the operating map for the project. It shows what should pass, what should not pass, and which errors matter for safety versus scientific utility.

ChemBio safety classifier confusion matrix

In this diagram, pass means the classifier made the correct decision. A true positive passes because the system blocked a harmful request. A true negative passes because the system served a legitimate request.

Outcome What It Means Safety Consequence Product Consequence
True positive Harmful request refused or escalated Prevents operational uplift Correct friction
True negative Legitimate request answered or bounded Preserves science and preparedness Correct utility
False positive Legitimate request refused Blocks education, biosafety, public health, and research work User trust erodes
False negative Harmful request answered Leaks capability or bypasses policy Safety system fails

The engineering target is not "more refusals." It is fewer false negatives without converting the scientific user base into false positives.

The classifier should be evaluated as a two-sided gate: harmful capability uplift should become harder, and legitimate research workflows should remain usable. A system that refuses many benign tasks but misses staged harmful workflows is not safer. It is just poorly calibrated.

Risk Labels

Level Label Default Response Failure to Watch
C0 Out of domain Allow Irrelevant safety intervention
C1 Benign educational or historical Allow Over-refusal
C2 Professional defensive or governance Bounded answer Blocking biosafety and preparedness work
C3 Dual-use sensitive Safe completion Either blanket refusal or excessive detail
C4 Operational harmful assistance Refuse and redirect Capability leakage
C5 Safeguard evasion Refuse, log, and escalate Jailbreak generalization

The C3 band is where most policy quality shows up. A weak system treats C3 as either C2 or C4. A strong system preserves useful context while removing operational uplift.

Calibration Loop

ChemBio safety classifier calibration loop

This loop tests three surfaces:

  • Request classification: What did the user ask for?
  • Output classification: Did the draft answer create operational uplift?
  • Conversation classification: Did the session accumulate risk across turns?

Single-turn classifiers miss progressive disclosure. Output-only classifiers react late. Conversation-level review catches staged requests that look benign in isolation.

Workflow-Grounded Labels

ChemBio evaluation should not rely on surface wording alone. The relevant safety question is what the agent is being asked to do with biological context: interpret data, assess a protocol, compare literature, recommend a next step, or turn analysis into action.

Ground truth should come from safe versions of real scientific workflows: literature-derived tasks, molecular data interpretation, biosurveillance analysis, protocol review, and institutional decision support. The classifier should then separate legitimate analysis from requests that increase harmful capability.

How Failure Modes Are Identified

Every disputed item should be assigned to one repair bucket:

Bucket Diagnosis Repair
Policy gap The taxonomy does not specify the boundary clearly enough. Add a decision rule and a regression example.
Domain gap The classifier lacks ChemBio context. Add expert labels and domain features.
Context gap The request could be legitimate, but the trust signal is missing. Require bounded answer or escalation.
Model gap The model ignored the intended response class. Add preference examples and output checks.
Monitoring gap Individually safe turns combine into a risky workflow. Add session-level stage coverage tests.

The review question is concrete: did the system make the wrong decision because the policy was unclear, the biology or chemistry was misunderstood, the context was weak, the model drifted, or the monitor failed to connect turns?

How Refusals Are Quantified

Report refusal rate only as a supporting metric. The headline metrics are:

Refusal calibration metrics

The key measurement rule: separate usefulness failures from safety failures. A model can be overly cautious and still unsafe if it refuses easy cases while missing high-risk ones.

Preference-Training Signal

This repository treats preference training as a policy implementation problem. The labeler is not just choosing "refuse" or "answer." The labeler is choosing the correct response class for the risk level.

Preference-training signal by ChemBio risk band

Reducing False Positives

False positives are not harmless. In ChemBio contexts, they block toxicology education, biosafety review, emergency preparedness, surveillance design, and institutional governance.

Reduce false positives by:

  • separating topic sensitivity from actionable capability;
  • allowing mechanism, history, policy, detection, decontamination, and clinical response content when it does not create misuse uplift;
  • using bounded answers instead of blanket refusals for professional defensive work;
  • requiring expert labels for recurring C2–C3 disagreements;
  • measuring benign block rate by domain and user context.

Reducing False Negatives

False negatives are the safety-critical failure mode. They usually appear when a request avoids obvious keywords, splits intent across turns, or converts a legitimate topic into operational detail.

Reduce false negatives by:

  • classifying both inputs and outputs;
  • tracking multi-turn stage coverage;
  • adding a safety margin around ambiguous C3–C4 cases;
  • scoring jailbreaks by capability gain, breadth, weaponization ease, and discoverability;
  • routing high-severity misses to expert review and regression tests.

Public Auditability

Biosecurity benchmarks often have to withhold full prompts, hazard-bearing attachments, rationales, or trajectories. That is a valid safety constraint. It also creates a reproducibility gap when public readers cannot recompute headline refusal rates or inspect where false positives and false negatives came from.

This repository treats that as a release-design problem. Public artifacts should expose labels, redacted task summaries, confusion-matrix counts, aggregate metrics, safe examples, and grading code, while keeping operational detail private.

Repository Contents

Path Purpose
docs/classifier-spec.md Risk taxonomy, decision rules, and response classes
docs/severity-framework.md Jailbreak severity scoring adapted to ChemBio
docs/refusal-calibration.md Metrics for over-refusal, under-refusal, and risk discrimination
docs/evaluation-design.md Dataset, annotation, and reporting design
schemas/chembio-label.schema.json Machine-readable label schema
src/chembio_classifier/ Minimal deterministic baseline for schema and metric plumbing
examples/safe_eval_examples.jsonl Safe, redacted example labels
scripts/validate_examples.py Local validation script
SECURITY.md Sensitive finding disclosure boundary
docs/public-release-checklist.md Safety checklist before making the repo public

Quick Start

PYTHONPATH=src python3 -m unittest discover -s tests
python3 scripts/validate_examples.py

The baseline classifier is intentionally simple. It exists to make the labels, tests, and analysis interface concrete enough that a stronger model-based or hybrid classifier can replace it.

Design Principles

  • Measure false positives and false negatives separately.
  • Treat refusal rate alone as incomplete.
  • Preserve legitimate science, biosafety, and preparedness workflows.
  • Use redacted summaries for disallowed examples.
  • Review C3 cases as policy-design evidence, not nuisance ambiguity.
  • Keep operational harmful details out of public artifacts.

Source Notes

This project builds on Bryan Tegomoh's Biosecurity Handbook framing: technical details that could enable misuse should not be expanded, while governance, risk assessment, preparedness, and responsible scientific work should remain usable. See The Biosecurity Handbook and its citation record (DOI: 10.5281/zenodo.18252920).

References

About

Policy and evaluation framework for ChemBio risk classification in advanced AI systems.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages