Skip to content

alan-turing-institute/smoke-and-mirrors

Repository files navigation

Smoke and Mirrors

Prototype dynamic AI emulators for OT hardware.

May 2025: Technical Snapshot

Description

This repository contains code samples relating to the use of LLMs for emulating devices on industrial Operational Technology (OT) networks. This is the sanitised version of our full codebase. If you require access to the full version, please get in touch.

The current prototype focuses on the Modbus protocol, the de facto standard in industrial cyber-physical systems.

Contents

  • LLM response generation. A Jupyter notebook demonstrating several approaches to generating Modbus responses by direct LLM prompting with requests in the form of hexadecimal strings.

  • LLM code generation. A Jupyter notebook containing prompts for generating a standalone Python module capable of handling requests in the Modbus protocol. An example of automatically-generated code can be found in modbus_handler.py.

Note: these notebooks make calls to the OpenAI API, which requires access to an API key. To do this, create a file named .env at the root of the repository, containing the following line:

OPENAI_API_KEY="<INSERT YOUR KEY HERE>"

Installation

To install this package with dev dependencies:

pip install -e ".[dev,modbus]"

Install pre-commit hooks with:

pre-commit install

About

Prototype dynamic AI emulators for OT hardware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •