We use cookies to help understand our community better.Learn More
Department of Planning, Industry and Environment NSW

Rules As Code - Energy Saving Scheme

Regulatory Technology



Our partners sought to evaluate if the Rules as Code model (RaC) and the multidisciplinary Better Rules methodology for co-drafting would improve the process of drafting policy rules and delivering digital services.

Sindhu Harinath
Ram Parameswaran
Yuguang Ipsen
Data Scientist

Forthcoming legislation for the Energy Security Safeguard (ESS) presents a unique challenge for our partners in the Sustainability Programs Branch (SPB). The ESS is made up of a complex set of legislation, previously defined in a 120 page policy document, which also change annually as new energy saving technology makes it way to market.

Our partners in SPB sought to evaluate if the Rules as Code model and the multidisciplinary Better Rules methodology would improve the process of drafting policy rules and delivering digital services for the ESS. Across NSW Government, RaC had previously been implemented as a successful proof of concept for comparatively simple use cases. This project would be groundbreaking given the complexity of the overarching legislation.

The Fellows were tasked with delivering solutions suitable for reuse across NSW, building capability by co-drafting policy as code with non-technical roles in SPB, and making strategic recommendations for future delivery informed by their learnings.


We embedded our team of three Fellows into the Department for a six month engagement to work alongside policy roles in co-drafting complex requirements into code, build a tech stack to support services delivery, champion new processes and deliver a roadmap for future RaC work.

The Fellows utilised Human-centred Design and Agile delivery to build prototypes and evaluate the Better Rules methodology. In addition to comprehensive user research, they also introduced a new technique called Variable Mapping - a design facilitation that helps reduce complexity during the development of coded rules.

The Fellows introduced a new multidisciplinary policy-making process by working alongside Policy Officers from the Department to both translate rules into code, but also to set up a co-drafting process for future changes. By working in the open the Fellows were able to transfer technical knowledge to the team, define new practices, deliver a roadmap and prioritisation framework for future RaC work and provide the Department with knowledge of how to hire for, manage and run RaC projects.


In six months the Fellows:

  • Investigated ways to digitally deliver the Energy Security Safeguard using RaC

  • Investigated ways to improve the policy development processes

  • Demonstrate the viability of Open Government delivery

  • Conducted discovery research on internal processes and with external stakeholders

  • Built a ‘Rules Dashboard’ for the Safeguard and future use cases

  • Built an API for the Safeguard’s energy savings and future use cases

  • Evaluated and reflected on the ‘Better Rules’ process

  • Delivered a comprehensive Roadmap for future RaC projects

  • Provided the Department with knowledge of who to hire for future RaC work

  • Empowered the Department to manage projects and build capability through experimentation


The Fellows produced three major solutions throughout their work, that will be useful for the Energy Security Safeguard and beyond...

  1. The ‘Variable Mapping’ facilitation was created by the Fellows and meets a need that was not previously being addressed in RaC work in NSW.

  2. The Rules Dashboard is a web application that helps visualise the structure and complexity of a coded ruleset.

  3. The team built an Rules Calculation API that provides a user-friendly way for policy makers to run calculations and view documentation for rules defined in the OpenFisca platform.

  • A method of mapping created by the Fellows that acts as a middle ground between the rules and code.

  • It enables the team to look at parts of the rule from the perspective of Inputs, through some Logic or Calculation, to Outputs.

  • This technique meets a visualisation need that was not previously being addressed in RaC work.


The Dashboard is a frontend single-page web application built using React to help communicate the contents and structure of a complex, coded ruleset.

It has proven especially useful for policy-makers, as it allows them to see the rules and experiment with different scenarios and compare different rule versions, without needing to interact with the code.

The Dashboard will promote consistent rule creation methods and tools across the Department and allows for transparency on historical and current rules.

The Rules Dashboard codebase is available on Github.

The Rules Dashboard


  • A REST-ful API for performing calculations on our coded rules

  • Self-documenting

  • “Handrails included” - built in validation and suggestions

What is its value?

  • Ensures provenance of calculation methods

  • Make compliance easier & reduces barriers to entry for new participants

The Fellows built a user-friendly API wrapper for the OpenFisca RaC framework. OpenFisca is a rules engine designed for complex policy situations ie. where inputs and calculations methodologies change over time. The benefits include:

  • Recording the relationships between OpenFisca variables, and allows frontend applications to make generalised queries with respect to those relationships.

  • Providing a REST-ful API service for performing OpenFisca calculations which has input-validation and user-friendly error messages;

  • Self-documenting by way of auto-generated Swagger documentation

  • Outlines learnings from the Fellowship and stakeholders interviews.

  • Details, assesses and recommends ‘project ideas’ to pursue.

  • Informs the Department’s strategy with RaC for the next 10 years.

  • Synthesised learnings from research and stakeholder interviews.

  • Detailed 11 potential ‘project ideas’ for the Department to pursue.

  • Rated them based on six assessment criteria.

  • Recommended a staged project delivery schedule.

The Fellows also created a set of assessment criteria to weight and prioritise the potential projects.

By releasing their work as Open Source, the team have left a legacy for Rules as Code practitioners to utilise and have provided a useful starting point for future work in NSW and beyond.

The API solution has been released as a template for anyone else working with OpenFisca to leverage in their own project

Problems the team solved while building the Dashboard were used to improve how ReactJS components are supported by the NSW State Design System.


How we’re using Rules as Code to translate complex policy into easy to use online services

Sindhu Harinath

Talking About a More Digital Government: Episode 2 - Rules as Code


Esther Semo

How we used design to understand, inform and experiment within the Rules as Code space

Sindhu Harinath

This presentation by our Fellows highlights how to make rules simple, adaptable and digital ready.

Back to Case Studies

Read more of our Case Studies to dig deeper into the work we've done.

Aboriginal FlagTorres Strait Islander FlagLGBT Flag

We're based in Melbourne, on the traditional lands of the Woiwurrung and Boon Wurrung peoples of the Kulin nation. We acknowledge that sovereignty was never ceded and pay our respects to elders past, present and emerging across Australia.

As an organisation we benefit from the rich history of contributions that Aboriginal and/or Torres Strait Islander people have made to the world.

Copyright © 2022 Code for Aus Pty Ltd.