
In 2022, researchers at a pharmaceutical AI company ran an experiment that should keep every enterprise AI leader awake at night. They took a commercial drug discovery model — one designed to find life-saving therapies — and changed a single setting. Instead of penalizing toxicity, they rewarded it. In under six hours, the model generated 40,000 potential chemical weapons, including the nerve agent VX and novel compounds predicted to be even more lethal. The hardware? A standard consumer-grade server.
This wasn't a nation-state cyberattack. It wasn't a sophisticated hack. It was a configuration change that any competent developer could make in minutes. And the safety filters that most enterprise AI systems rely on today? They would have missed every single one of those 40,000 molecules.
We've spent months analyzing this vulnerability — what the research community now calls the "flipped switch" problem — and what we found challenges the foundational assumptions of how most organizations approach AI safety in high-stakes domains.
The Experiment That Changed Everything
The team at Collaborations Pharmaceuticals conducted this work for the Spiez Convergence conference, a biennial arms control event organized by the Swiss government. Their tool, MegaSyn, was built to predict bioactivity and generate novel drug candidates for rare diseases. It was doing exactly what it was designed to do — exploring chemical space to find molecules with specific properties.
The "flip" was almost comically simple. The model's reward function originally looked something like this: score a molecule highly if it's biologically active, and penalize it if it's toxic. The researchers simply reversed the penalty. Toxicity became the goal.
The AI didn't need new training data, new architecture, or new capabilities. It already knew how to make poisons. That knowledge was the flip side of knowing how to make medicines.
What emerged wasn't just a list of known chemical weapons. The model rediscovered VX and other classified nerve agents from scratch, then went further — generating thousands of novel compounds that appear in no public database and no government watchlist. Some were predicted to be more potent than VX itself.
The barrier to replicating this? Open-source chemistry datasets, a standard machine learning architecture, and a consumer GPU. We detail the full technical analysis in our interactive exploration of this research.
Why Your AI Safety Filters Are Blind to This

Most enterprise AI deployments rely on what the industry calls "guardrails" — filters that scan inputs and outputs for dangerous content. Think of them as keyword blockers on steroids. They check prompts for banned terms, scan responses against watchlists, and sometimes use a secondary AI model to judge whether output seems harmful.
Against the threat we're describing, these filters are essentially useless. There are three reasons.
They operate on words, not chemistry. A content filter will block the word "Sarin." It will not block the string O=P(C)(F)O, which is Sarin's chemical notation — called a SMILES string — that any molecular AI model reads fluently. Recent studies demonstrate that this "SMILES-prompting" technique bypasses safety mechanisms in leading models like GPT-4 and Claude 3 with success rates sometimes exceeding 90% for specific substances.
They can't handle novelty. If a generated molecule doesn't appear in any database — as was the case for thousands of compounds in the flipped-switch experiment — there's nothing for the filter to match against. The molecule is new. The filter has no opinion about it.
They miss activity cliffs. In medicinal chemistry, an activity cliff is when a tiny structural change — swapping one atom for another — transforms a safe drug into something lethal. It's like the difference between table salt and a chlorine compound. A text-based filter sees two molecules that look 99% identical and waves them both through, missing the 1% that matters.
A safety system that can be defeated by writing a molecule's chemical notation instead of its name isn't a safety system. It's a speed bump.
The Real Problem: Toxicity and Therapy Live in the Same Neighborhood
To understand why surface-level filters will never solve this problem, you need to understand how generative AI models actually "think" about molecules.
Deep learning models don't store a list of molecules. They learn a compressed, mathematical representation of chemical space — a kind of internal map where similar molecules sit near each other. Researchers call this the model's latent space. Think of it as a vast landscape where every point corresponds to a possible molecule, and nearby points correspond to molecules with similar properties.
The critical insight: on this map, the region containing effective drugs and the region containing lethal toxins aren't on opposite sides of the world. They're neighbors. Often, they overlap.
This isn't a software bug. It's biochemistry. The same molecular feature that lets a drug cross the blood-brain barrier to treat Alzheimer's is the same feature that lets a nerve agent reach its target. High binding affinity — a molecule's ability to grip tightly onto a protein — is exactly what you want in a cancer drug and exactly what makes VX deadly.
When the Collaborations Pharmaceuticals team flipped their reward function, they weren't sending the model to some distant, forbidden corner of its map. They were telling it to walk a few steps in a different direction — from the "therapeutic" neighborhood to the "lethal" one right next door.
This is why blocking dangerous outputs after the fact can never be sufficient. If you try to wall off every feature associated with toxicity, you destroy the model's ability to do useful drug discovery. The features are entangled. You can't separate "good chemistry knowledge" from "dangerous chemistry knowledge" because they're the same knowledge.
What Latent Space Governance Actually Means

Our research points to a fundamentally different approach. Instead of filtering outputs after the model generates them, we constrain what the model can generate in the first place — by intervening directly in that internal mathematical landscape.
We call this Latent Space Governance, and the core idea is more intuitive than it sounds.
Imagine the model's internal map again — that landscape where every point is a possible molecule. Standard safety filters let the model wander anywhere on the map, then check whether it ended up somewhere dangerous. Our approach draws hard boundaries on the map itself, making certain regions mathematically unreachable during the generation process.
The model can still explore freely within the safe territory. It still discovers novel, useful molecules. But its path physically cannot cross into the zones we've identified as dangerous — not because we're catching it after the fact, but because the math won't allow it.
This works through three mechanisms operating together:
We first map the dangerous regions using a technique called Topological Data Analysis — essentially creating a mathematical fingerprint of what "toxic chemical space" looks like, including its shape, boundaries, and hidden pockets. This isn't a list of known bad molecules. It's a geometric description of the properties that make molecules dangerous, which means it catches novel threats that don't appear in any database.
We then train lightweight companion networks — we call them Constraint Critics — that monitor the model's position on the map in real time. These critics are separate from the main model, which means we can update them as new threats emerge without retraining the entire system.
Finally, during generation, if the model's trajectory drifts toward a dangerous zone, gradient-based steering applies an opposing mathematical force — nudging it back to safe territory before any output is produced. The model effectively "considers" a toxic molecule but is forced to resolve it into a safe alternative before anything is ever generated.
The model doesn't generate a dangerous molecule that gets caught by a filter. It never generates one at all. The dangerous region of its internal map simply doesn't exist as a reachable destination.
For the full mathematical formulation — including the constrained optimization framework and Langevin dynamics steering — see our detailed technical whitepaper.
The Regulatory Walls Are Closing In
This isn't only a technical argument. The regulatory landscape is making structural AI safety a business necessity.
The White House Executive Order on AI explicitly identifies the risk of AI lowering barriers to chemical and biological weapon development as a tier-1 national security threat. The subsequent Genesis Mission directive mandates "appropriate risk-based cybersecurity measures" for AI-directed scientific experimentation. The NIST Generative AI Profile (NIST.AI.600-1) specifically warns that chemical and biological design tools "may predict novel structures not in training data" — the exact scenario where keyword filters fail.
ISO 42001, the first international management system standard for AI, requires demonstrated robustness against adversarial attacks. An organization that relies on filters defeatable by SMILES-prompting will struggle to make that demonstration.
The compliance gap is stark. A standard AI wrapper can show that it tries to filter dangerous content. It cannot demonstrate that it prevents the creation of dangerous content. That distinction — between "best effort" and "mathematical proof of bounded behavior" — is exactly where regulatory scrutiny is heading.
Our approach produces something filters cannot: a statistical safety certificate. We can demonstrate to auditors that the probability of toxic generation falls below specified thresholds (for example, less than one in a million), and we can log not just outputs but every constraint violation the model attempted during generation.
What About Legitimate Research That Needs Toxicity Data?
A reasonable objection: don't pharmaceutical researchers sometimes need to understand toxicity? Won't locking out those regions cripple legitimate science?
Yes, and this is precisely why the approach must be surgical rather than blunt. Latent Space Governance doesn't eliminate the model's understanding of toxicity — it constrains the generative process. Researchers can still query toxicity predictions for known compounds. They can still analyze why certain molecules are dangerous. What they cannot do is use the generative engine to optimize for lethality or to produce novel compounds in weapons-relevant chemical space.
Think of it as the difference between a chemistry textbook and a weapons factory. The knowledge exists. The manufacturing capability is what's constrained.
Does This Apply Beyond Drug Discovery?
The flipped-switch vulnerability is not unique to chemistry. Any AI system designed to maximize a metric can be inverted to maximize its harmful opposite.
A model trained to find and patch software vulnerabilities understands how to exploit them. A model optimized to detect financial fraud has learned to generate undetectable fraudulent transactions. A model designed to optimize supply chain efficiency could, with inverted objectives, identify the most disruptive points of failure.
In every case, the capability to harm is the mathematical inverse of the capability to help. And in every case, text-based safety filters face the same fundamental limitation: they operate on the surface of the model's behavior while the risk lives in its internal structure.
If a model understands what makes a system secure, it inherently understands what makes it vulnerable. These aren't separate capabilities. They're the same capability viewed from different angles.
What This Means for Your AI Strategy
If your organization is deploying generative AI in any domain where outputs interact with the physical world — drug design, materials science, cybersecurity, critical infrastructure — the question isn't whether your safety filters are good enough. The question is whether filters, as a category, can ever be good enough.
Our analysis suggests they cannot. Not for these stakes. The gap between "we scan outputs for known threats" and "we mathematically constrain what the model can produce" is the gap between hoping nothing goes wrong and engineering a system where certain failures are structurally impossible.
Three things worth evaluating in your current AI deployments:
Can your safety mechanisms handle novel outputs? If they rely on matching against known threats, they fail the moment the model generates something new — which is, by definition, what generative AI does.
Are your constraints embedded in the model's architecture, or bolted on after the fact? Post-hoc filters can be bypassed. Structural constraints require re-engineering the system to circumvent.
Can you prove your safety claims to a regulator? Not "we have a filter" — but "the probability of harmful generation is below this threshold, and here's the mathematical basis."
The flipped-switch experiment happened in 2022. The techniques it used have only become more accessible since then. The window for treating AI safety as a post-deployment afterthought is closing — and in high-stakes domains, it may already be closed.
We'd welcome hearing how other organizations are thinking about structural AI safety in their own domains. This is a problem that demands more than any single team's perspective.