What is Rules as Code?
Australia's regulatory landscape includes an array of legislation, regulations, standards, and policies. Managing this regulatory environment can lead to delays in decision-making, creating complexities for Australian citizens, businesses, and government to understand and comply with their obligations, rules and requirements.
Rules as Code (RaC) makes things easier and faster by converting complex requirements into machine readable code that can be used to power user interfaces such as webforms. These UIs enable users to enter information within a series of defined parameters and receive instant answers. By leveraging this technology people don’t need to make phone calls or email questions that required manual processing to get the advice they need.
RaC streamlines interaction with the Australian Government at all levels and enhances efficiency, providing immediate responses to enquiries using RaC driven user interfaces. The encoded legislation (“the rules”) exist alongside the original version (it doesn’t replace it) to facilitate digital service delivery.
How can Rules as Code be used?
Rules as Code is a versatile tool can be used for a wide range of scenarios, both public facing and behind the scenes:
- Eligibility checkers- use a web form to find out if you are eligible for a benefit or service. Example- find out if you are eligible for a welfare payment or a health or legal service.
- Information distillation- choose from a range of options that describe your situation and get information specific to your requirements. Example- work health and safety requirements for your workplace.
- Compliance checker- use RaC to determine what you need to do to meet compliance requirements. Example- does a proposed investment need to go through an approval process.
- Calculations- enter numerical and situational data to get a tailored result. Example- calculating end of employment entitlements.
- Internal business requirements- follow a series of steps to determine an outcome. Example- procurement process assessments.
We have worked with a range of agencies across the APS to explore the potential of Rules as Code for a variety of use cases as part of our sandpit project. See the videos below for sandpit walkthroughs.
(videos)
Benefits of Rules as Code
Developing Rules as Code for your organisation brings significant benefits.
- Increased transparency- RaC can improve transparency by showing exactly what rules were applied to reach an outcome. The steps and outcomes are also built on a clearly defined user journey, making it logical and repeatable.
- Reduced ambiguity- RaC can help to make legislation easier to understand by translating it into plain English.
- Adaptable- RaC allows the code can be updated as requirements change, such as a change in pay rates, or a variation in who or what a regulation affects. Code can be time boxed and version controlled to ensure the right rules apply at the right time.
- Improving user journeys- through careful design, the number of questions a user needs to answer can be reduced, leading them to their required outcome faster than traditional online or paper forms.
- Legislative clarity- RaC can help to identify gaps, contradictions and inconsistencies in legislation and regulation, providing opportunities to improve clarity and consistency over time.
Making rules machine readable promotes connected services and increased innovation, helping government meet the Australian Digital Economy 2030 goals (Digital Economy Strategy 2022 Update Released | PM&C) (Opens in a new tab/window)and the Digital Transformation Agency’s Data and Digital Government Strategy (Opens in a new tab/window).
Find out more
Rules as Code is a powerful and evolving tool—but like any powerful tool, its value depends on how thoughtfully it's used.
Since March 2024, GovCMS and our technical partners at Salsa Digital have worked closely with agencies across the APS to develop and refine a hands-on methodology for turning rules into reliable, user-friendly code. This process ensures accuracy and accountability by involving subject matter experts (SMEs) at every stage.
Our approach includes:
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 just one approach. 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 focuses on being practical, collaborative, and fast to prototype—particularly for teams new to Rules as Code or looking for early-stage experimentation.
In the videos below, Phillipa walks through our approach step-by-step.
If you're curious about how this could look in practice—or thinking about how it could apply to your agency—watch the walkthroughs and get in touch for pricing and process. We’re here to help you explore what’s possible.
- Introduction to Rules as Code (short): https://vimeo.com/1085542587(Opens in a new tab/window)
- A comprehensive introduction to Rules as Code: https://vimeo.com/1085543527(Opens in a new tab/window)
- Introduction to rules mapping: https://vimeo.com/1085544340(Opens in a new tab/window)
- Introduction to OpenFisca: https://vimeo.com/1085545056(Opens in a new tab/window)
- Introduction to the Webform OpenFisca Drupal module: https://vimeo.com/1085545534(Opens in a new tab/window)
Next steps- moving to production
GovCMS is currently working on adding options for Rules as Code to hosted SaaS, SaaS+ and PaaS websites. Keep an eye out for news and updates via GovCMS communication channels.
Examples of Rules as Code from around the world
Governments around the world are exploring and implementing Rules as Code to assist citizens in their interaction with government.
NSW, Australia. Community gaming check. This allows people to confirm if a community gaming activity or trade promotion needs a permit before it can go ahead.
New Zealand. BenefitMe. Using this Rules as Code flow, New Zealand citizens can see what welfare benefits they are eligible for.
Benefit Me Home | Dac benefits(Opens in a new tab/window)
United Kingdom. Policy Engine. This system has two streams, one to calculate taxes and one to compute the financial impact of policy reforms.