For AI labsPartnersTrustResearch
← All posts

AI labs5 min read

What an RL environment actually is

An RL environment is a sandbox with a starting state, a set of actions and a way to score outcomes. For workplace agents, the hard part is making that sandbox look like real work.

"RL environment" gets used loosely enough that it can mean anything from a single prompt with a grader to a full simulated company. Underneath the jargon, the idea is simple: an environment is a place where an agent can act, see what happened and be scored. For agents meant to do office work, the difficult part is not the scoring loop. It is making the place feel like a real workplace.

The plain definition

Reinforcement learning trains a model by letting it try things and rewarding the attempts that go well. The environment is everything outside the model during that process. It holds the current state of the world, accepts the agent's actions, changes in response and reports back.

In older RL research the environment was a game board or a physics simulator. For language-model agents it is usually a software sandbox: a mock ticketing system, an inbox, a code repository, a chat workspace, a spreadsheet. The agent reads, searches, types, calls tools and writes code. The environment decides what those actions do.

The parts that make one up

Almost every environment, however elaborate, is built from the same handful of pieces.

  • Initial state. What the world looks like when an episode begins: which tickets are open, what is in the repository, who has said what in which channel.
  • Action space. What the agent is allowed to do: search, read a thread, post a reply, edit a file, run tests, update a record.
  • Observations. What the agent sees after each action. This is usually partial, just as a new employee only sees part of a company.
  • Transitions. The rules for how the state changes when the agent acts. Closing a ticket should close it; pushing broken code should fail the build.
  • Task. The instruction the episode is built around, such as resolving a customer escalation or preparing a release.
  • Reward or grader. The check, at the end or along the way, that says how well the agent did.
  • Reset. The ability to put everything back and run the episode again, many times, with different attempts.

Most of the engineering effort goes into transitions and reset, because those are what make an environment run reliably at scale. Most of the judgment goes into the initial state, the task and the grader, because those determine whether the agent learns anything useful.

Where environments go wrong

The most common failure is an environment that is too clean. If the mock inbox holds twelve tidy emails, all relevant and clearly written, the agent learns to solve a world that does not exist. Real inboxes are full of half-finished threads, forwarded chains, people who reply to the wrong message and decisions that were made somewhere else.

A second failure is a task distribution nobody would recognize. When tasks are invented by the same people who write the grader, they tend to cluster around what is easy to check. That produces agents that are good at checkable work and brittle at everything else.

A third failure is reward hacking. If the grader only checks that a ticket was marked resolved, the agent will learn to mark tickets resolved. Graders that compare against what actually happened, such as the fix that shipped or the reply the customer accepted, are harder to game. We have written more about why agents need realistic material in why agents need workplace data, not more web text.

What real company history contributes

This is where anonymized operational data comes in. A company's chat, email, tickets, code and CRM records, licensed for training and evaluation, can feed several parts of an environment at once.

It can seed the initial state. Instead of twelve tidy emails, the sandbox starts with a realistic slice of a real company's history: the backlog as it actually stood, the channels as they actually read, with every person and customer replaced by a consistent token. PERSON_014 in the chat log is the same PERSON_014 who filed the ticket and reviewed the pull request, so the agent has to work across tools the way an employee would.

It can supply the task distribution. Real companies generate real work: escalations, migrations, onboarding, month-end close, incident response. Sampling tasks from what a team actually did keeps the mix honest.

It can anchor the grader. When the historical record shows how a problem was resolved, that outcome becomes a reference. The agent does not need to match it word for word, but a grader can check whether it reached a comparable result without breaking anything along the way.

None of this works with fragments. An environment seeded with chat alone cannot test whether an agent can trace a complaint to a code change. The value comes from connection depth, the same project traceable across several tools, and from enough years of history to cover many kinds of work.

Questions worth asking before you build

If you are designing environments for workplace agents, a few questions tend to separate useful ones from demos.

  • Does the initial state contain noise, contradictions and irrelevant material, or only what the task needs?
  • Are tasks drawn from real work, or written to fit the grader?
  • Can the grader be satisfied by a shortcut that a human reviewer would reject?
  • Do identities stay consistent across every tool in the sandbox?
  • Is there enough variety across sectors, company sizes and tool stacks that the agent is not just learning one company's habits?

The last point is where sourcing matters. A single company's history makes one convincing environment. A balanced set across many companies makes an agent that generalizes. Martal Group sources that variety through outbound: a lab sends a brief describing the sector, headcount, tool stack, years of history and regions it needs, and our reps reach the people who can license a company's data. Every dataset is anonymized in house before delivery and licensed for training and evaluation only, with no right to contact, profile or re-identify anyone in it.

The short version

An RL environment is a starting state, a set of actions, rules for what those actions do, a task and a way to score the result. For workplace agents, the starting state and the scoring are where realism lives, and realism is hard to invent from scratch.

If you are building environments and need connected company histories to seed them, send us a sourcing brief.

Need company data for your models?

Send a sourcing brief and Martal Group's outbound team will find the companies that fit it.