TL;DR: Malicious-code judgments in mixture-of-experts models route more through a morality-associated path than through vulnerability or legality paths, Manifold Security found. In production code review, that routing makes framing and expert selection part of the security decision, not just the code itself.
Editorial analysis by NHI Mgmt Group, based on content published by Manifold Security: “Ask a Model If Code Is Malicious and It Reaches for Its Morals”.
Key questions
Q: Why can a model judge malicious code differently from a pure vulnerability check?
A: Because the model may not treat the task as a narrow defect scan.
Q: What should teams do when routing changes the model’s security answer?
A: Treat that as an assurance failure, not a curiosity.
Q: How should security teams test whether an LLM’s code judgments are prompt-framing sensitive?
A: Use paired evaluations with the same code and multiple prompts that vary only in framing, such as malicious, vulnerable, legal, and neutral wording.
Practitioner guidance
- Test prompt-framing sensitivity in security classifiers Run the same malicious-code samples under security, legality, morality, and neutral prompts, then compare output drift and route distance to see whether framing changes the decision boundary.
- Evaluate routing stability under expert-path perturbation Measure whether a model’s security judgement changes when routing is transplanted from another prompt, because that reveals whether the internal path is part of the classification mechanism.
- Validate code-review models against intent and defect separately Separate tests for malicious intent, unsafe behaviour, and ordinary vulnerability detection so that one task does not silently inherit assumptions from another.
Bottom line: Mixture-of-experts models can route the same malicious-code prompt through a morality-associated path rather than a pure vulnerability path.
Glossary terms: Mixture-of-Experts Model, Router, Routing Path, Workspace Lens
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Routing, not just representation, is the control plane in these models. The article shows that the same code can produce different outcomes depending on which expert route the router selects. That is a governance issue, because it means model behaviour can shift through internal selection mechanics that are invisible in the final answer. For security and AI governance teams, the model’s routing policy is part of the assurance boundary, not an implementation detail.
A question worth separating out:
Q: What is the difference between judging malicious code and detecting a vulnerability?
A: Judging malicious code asks whether the code appears intentionally harmful, so the model may weigh context and intent. Detecting a vulnerability asks whether the code contains a technical weakness that can be exploited. A model can be strong at one and weak at the other, so teams should never assume one evaluation covers both.
👉 Read our full editorial: Mixture-of-experts models route malicious-code judgments through morality