---
title: 'Build RL environments from a web app · Reverse Engineer Projects'
url: https://reverseengineerprojects.com/guides/rl-environments/
---

[Home](https://reverseengineerprojects.com/) / [Guides](https://reverseengineerprojects.com/guides/) / RL environments

# Build RL environments.

  Agents learn a web app by using it. A recorded session gives them a copy to practise on: the app's operations as tools, the data the recording saw, and tasks you can score.

## What gets built

- 01 · Record
### One session
Your agent drives the app in a browser while REP records every request and answer.

- 02 · Build
### Tools and data
Each operation the recording proved becomes a tool; what it read becomes the starting data.

- 03 · Run
### A local copy
Agents call the tools; writes change the copy, never the real app.

## Before you start

- Use a staging copy and a practice account, never real customer data.

- Passwords go in environment variables you name; never type them into the chat. Recorded secrets are blanked.

- The recording is the whole truth: an operation it never showed is not served. To support deleting, record an object before the delete and show it gone after.

## Record and build with your agent

    Your coding agentCopy

      ›Use REP to build an RL environment from my staging web app on port 3000. Cover listing, creating, renaming and deleting projects. You may create and remove practice projects; leave existing data alone. Save it in a folder named projects-env, check which operations work, and tell me how to run it.

    The agent maps the app first, then records one scripted session through the app's own forms and buttons: create, read back, list, update, toggle, delete, each read back after it happens. It checks what the environment would serve, records again if something was missing, and exports the folder.

## Or start from a saved recording

    Already have a HAR file from the browser's network panel? Build from it directly:

    TerminalCopy

```
rep environment-build capture.har projects-env
```

## Run it

    The exported folder is an environment bundle: a manifest of tools, the starting data, and a Dockerfile that installs this same package. It runs on a Linux host with Docker; your agent prints the exact command for the folder it built. To check what a manifest serves against its evidence first:

    TerminalCopy

```
rep environment-serve manifest.json --evidence capture.json
```

## Add tasks and reward checks

    A task is a goal plus a check on the final state: “rename the project called Draft to Final” is done when the data holds a project named Final and none named Draft. Ask your agent to write a handful of tasks with their checks next to the bundle; an RL trainer or an eval harness then runs agents against it and scores them.

## Check what works

    Ask for the coverage report: which operations are served, which were seen but held back (and why), which were never recorded. Fix gaps by recording again, not by editing the data by hand.

## Desktop apps

    Linux desktop apps can be exported too, with a task taken from your request. Ask your agent for a desktop application environment and name the app and the task.

  On this page[What gets built](#what)[Before you start](#before)[Record and build](#record)[From a HAR file](#har)[Run it](#run)[Tasks and rewards](#tasks)[Check coverage](#check)[Desktop apps](#desktop)
