What is Rules as Code?
Rules as Code (RaC) is a method of delivering government rules (legislation, regulations and policy) in a machine-executable format.
It translates rules into computational logic that can power digital services, support decision-making and test how rules operate in practice. This can improve consistency, efficiency, transparency and accessibility, while helping governments identify ambiguities or unintended effects before rules are implemented.
Benefits of Rules as Code
Implementing RaC in your organisation can bring significant benefits.
Consistent, repeatable decisions
Encode rules and apply them consistently across digital channels, including websites, chatbots, apps and third-party platforms. Citizens and businesses get the same authoritative answer regardless of where or how they ask.
Increased transparency
RaC can improve transparency by showing exactly what rules were applied to reach an outcome. This makes decisions easier to understand and audit.
Adaptability and responsiveness
Coded rules can be updated as requirements change, such as a change in pay rates or a variation in who or what a regulation affects. Rules can be date-bounded and version-controlled, ensuring the correct rules apply at the correct time.
Improved user experiences
Through careful design, RaC solutions can reduce the number of questions users need to answer, helping them reach the right outcomes faster than traditional forms.
Greater policy clarity
RaC can help identify gaps, contradictions and inconsistencies in legislation, creating opportunities to improve clarity and consistency over time.
GovCMS Rules as Code Discovery Program
13 agencies. 16 prototypes. 18 months.
Between 2024 and 2025, GovCMS and our technical partners worked with agencies across government to develop Rules as Code prototypes. This was a multidisciplinary effort, bringing together subject matter experts, developers, service designers and policy advisers to co-design each stage of the process.
Our approach included:
- Scoping and refining a suitable use case
- Writing rules in plain English
- Mapping rules into clear, logical user journeys
- Converting those journeys into structured questions and pseudocode
- Building the code in OpenFisca
- Building and testing a Rules as Code interface in Drupal
This is the approach we explored. There are a variety of other methodologies, tools and platforms that agencies may wish to explore depending on their technical capabilities, regulatory complexity or delivery goals. Our method is designed for practical, rapid prototyping - particularly for teams new to Rules as Code or looking for early-stage experimentation.
If you're curious about how this could look in practice or would like to learn more – you can explore video walkthroughs in the Rules as Code video library.
Enterprise-grade Rules as Code capability is now available on the GovCMS platform.
Rules as Code has now moved from experimentation into production. Government agencies on GovCMS can now access RaC as part of the GovCMS Digital Experience Platform (DXP).
What this means for your agency:
- Your existing GovCMS site can integrate with RaC solutions using new enabling functionality now available on the platform.
- When legislation or policy changes, rules can be updated and version-controlled independently of the front-end interface.
- You can begin with a single use case and expand as you build confidence and capability.
Ready to get started?
Contact us to discuss your use case and begin scoping a RaC implementation for your agency.