Join our Newsletter — 33% off our NHI Course
Home› Glossary› AI Security› Rice’s Theorem
AI Security

Rice’s Theorem

← Back to Glossary
By NHI Mgmt Group Updated October 30, 2026 Domain: AI Security

A theorem stating that any non-trivial semantic property of programs is undecidable in the universal case. In plain terms, if the question is about what a program does rather than how it is written, no single algorithm can answer it for every possible program.

What Rice’s Theorem Means

Rice’s Theorem is a boundary-setting result in computability theory: once a property depends on what a program does, rather than its surface syntax, no general algorithm can decide that property for every possible program. That makes it a foundational warning about the limits of static analysis, automated verification, and universal program reasoning.

The theorem applies to non-trivial semantic properties, meaning properties that are true for some programs and false for others. Trivial properties, such as “all programs have this property” or “no programs have this property,” are excluded because they do not create a meaningful decision problem.

Why Semantic Properties Become Undecidable

The key idea is that program behaviour can encode arbitrarily complex computation. If an algorithm could decide an interesting semantic property in all cases, it could also solve the halting problem indirectly, which is impossible. That is why Rice’s Theorem is so powerful, it does not merely show that one difficult analysis fails, it shows that an entire class of analyses cannot exist in fully general form.

This matters whenever a tool tries to infer intent, safety, reachability, correctness, confidentiality, or other behaviour-dependent qualities from source code or binaries. The more the property depends on execution paths, inputs, environment, or external state, the more likely it is to fall into the theorem’s scope.

Implications for Analysis and Verification

Rice’s Theorem does not say program analysis is useless. It says there is no universal, always-correct decision procedure for every semantic question. In practice, tools work by accepting trade-offs: they may be sound but incomplete, complete but unsound, approximate, scoped to a restricted language, or limited to certain program classes where decidability can be restored.

That trade-off explains why compilers, linters, model checkers, and scanners are usually designed around bounded assumptions. They can prove useful properties, but they cannot honestly promise perfect answers for arbitrary programs without either restricting the problem or allowing false positives and false negatives.

Where Rice’s Theorem Shows Up in Practice

Software security and correctness tools often run into the same wall in different forms. Questions such as “Will this program ever leak data?”, “Can this binary reach an unsafe state?”, or “Does this code always preserve an invariant?” are semantic questions, so fully general automatic answers are impossible. A practical tool therefore narrows scope, models a subset of behaviour, or accepts that human review remains necessary for the hardest cases.

The theorem also helps explain why undecidability is a design constraint, not a failure of engineering. It tells practitioners where to expect impossibility, where to apply approximation, and where to define narrower policy rules that can actually be checked.

Risk and Threat Considerations

Rice’s Theorem matters because attackers and defenders both operate in a world where no general-purpose analyser can perfectly determine arbitrary program behaviour. That creates risk whenever organisations assume a scanner, verifier, or policy engine can conclusively prove safety or maliciousness for every case.

Failure mechanism: An attacker can hide harmful behaviour behind conditions, environment dependence, or complex execution paths that defeat universal semantic checking, while defenders may overtrust an analysis that can only approximate the property being examined.

Impact: False assurance can leave exploitable logic, unsafe code paths, or policy violations undetected until runtime, when the consequences are harder to contain and more expensive to remediate.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, CIS Controls v8 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SI-7 — Software, Firmware, and Information IntegrityRice's Theorem bounds automatic assurance about program behaviour and integrity.
SA-11 — Developer Testing and EvaluationThe theorem motivates scoped testing because universal program properties are undecidable.
RA-5 — Vulnerability Monitoring and ScanningScanning tools must approximate behavioural properties rather than prove all program semantics.
Recommendation — Limit integrity checks to bounded assumptions and combine them with manual review for unbounded semantic questions. Define testable acceptance criteria and verify only the properties your analysis can decide. Use scanning as a bounded detection method, not as proof that no semantic flaw exists.
CIS Controls v8CIS-16 — Application Software SecurityApplication security checks are limited by undecidability for non-trivial semantic properties.
Recommendation — Apply security testing and code review with explicit scope limits and known analysis assumptions.
OWASP ASVSV15 — Secure Coding and ArchitectureSecure design must account for limits on deciding program behaviour automatically.
Recommendation — Architect controls around properties that can be checked within the chosen language and threat model.

Practitioner Guidance

What practitioners should do: Treat Rice’s Theorem as a scope-setting principle when choosing static analysis, formal methods, or automated code inspection. Define the exact property you need to check, then ask whether the problem is decidable under the language, model, or execution constraints you are willing to accept.

Common misunderstanding: The theorem does not mean “nothing can be verified.” It means the verification problem must be bounded carefully, with clear assumptions about the program class, runtime model, or approximation strategy.

Practitioner takeaway: If a tool promises perfect answers for an unrestricted semantic property of arbitrary programs, the claim is stronger than computability theory allows.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org