You can upload files to any environment via the Files tab:These files are stored at /orwd_data/ on the environment server. Your environment server code always has full access to everything in /orwd_data/.Sandboxes, on the other hand, only see what you explicitly mount. This separation is critical: it lets your server hold ground truth data (answers, test cases, rubrics) that the agent in the sandbox never sees.
The environment server always has access to everything in /orwd_data/. This is where you store data that only your server should see — ground truth answers, expected outputs, rubrics, and evaluation data.
import jsonfrom pathlib import Path# The server reads ground truth directly from /orwd_data/with open("/orwd_data/answers.json") as f: answers = json.load(f)# Use ground truth in your reward functiondef compute_reward(self, agent_answer: str) -> float: expected = answers[self.task_id] return 1.0 if agent_answer == expected else 0.0
The agent never has access to these files — they exist only on the server.
/orwd_data/ only exists when your environment is deployed to OpenReward. When developing locally, your files live alongside your code. Use a simple check to handle both cases:
import osfrom pathlib import Pathif os.path.exists("/orwd_data"): DATA_PATH = Path("/orwd_data")else: DATA_PATH = Path(__file__).parent # local development — files next to your code# Now use DATA_PATH everywherewith open(DATA_PATH / "answers.json") as f: answers = json.load(f)
This way you can test locally with the same data files in your project directory, and everything switches to /orwd_data/ automatically when deployed.
To give the agent access to files, you mount a directory from /orwd_data/ into the sandbox using SandboxBucketConfig. The key parameter is only_dir, which restricts the mount to a specific subdirectory.
from openreward import SandboxSettings, SandboxBucketConfigself.sandbox_settings = SandboxSettings( environment="YourUsername/MyEnv", image="python:3.11-slim", machine_size="0.5:1", bucket_config=SandboxBucketConfig( mount_path="/workspace", # Where files appear in the sandbox read_only=True, # Agent can't modify the files only_dir="agent", # Mount ONLY the agent/ subdirectory ))
With this configuration, the sandbox at /workspace will contain only the files from /orwd_data/agent/ — nothing else.
If you mount the entire bucket without using only_dir, the agent can see all of your files — including ground truth answers, test cases, and rubrics. Try to avoid this!
Structure your uploaded files with separate directories for server data and agent data:
/orwd_data/├── ground_truth/ ← Server only (never mounted)│ ├── answers.json│ ├── rubrics.json│ └── test_cases.csv└── agent/ ← Mounted to sandbox ├── transactions.csv └── instructions.txt
Then mount only the agent/ directory:
bucket_config=SandboxBucketConfig( mount_path="/workspace", read_only=True, only_dir="agent", # Only this subdirectory is visible to the agent)
Use only_dir to mount a specific subdirectory rather than the entire bucket. This ensures a clear boundary between what the server knows and what the agent sees.
Do not do this if your bucket contains ground truth data.
# DANGEROUS: mounts ALL of /orwd_data/ to the sandboxbucket_config=SandboxBucketConfig( mount_path="/workspace", read_only=True, # no only_dir — the agent sees everything!)
With this configuration the agent can read your answers, rubrics, and test cases directly. Always use only_dir to restrict access to a specific subdirectory.