Policy
A policy is the part of a reinforcement learning system that decides which action to take in each situation; it is usually the model being trained.
In reinforcement learning, the policy is the rule that maps what the agent observes to what it does next. For a language model, the policy is the model itself, and its actions are the text and tool calls it produces. A policy is usually random to some extent, so the same situation can lead to different actions. That randomness lets it try new actions and find better ones.
Training changes the policy so that actions that led to high rewards become more likely. Each update is based on trajectories the policy itself produced. When the policy changes, its old trajectories describe a policy that no longer exists. Training therefore keeps generating fresh episodes with the current policy, which is why it needs a lot of compute to run them.
When the policy is an AI agent, its actions reach the outside world through tools. A policy that runs code or edits files needs an environment that accepts those actions and reports the results. Sandboxes provide that environment, one per episode, so an action can be any command the task allows. The policy cannot be trusted to act safely while it is learning, so the sandbox limits what its actions can affect.