How unipat-ai/saas-bench works
1. What this repository is
SaaS-Bench is an evaluation harness for computer-use agents. It is not a product application itself; it orchestrates real self-hosted SaaS stacks, runs an agent through browser-based workflows, and then scores the outcome with task-specific verifiers.
2. Core execution pipeline
The main flow is: load a task definition → start the required Dockerized SaaS apps → launch a browser and agent → execute a bounded task trajectory → persist the agent trace → run verify.py against the live app state → aggregate results and tear down the environment.
3. Python harness package
The saas_bench/ package is the central control plane. run.py is the CLI entrypoint, loader.py discovers tasks and builds prompts, slot.py manages per-worker container/port isolation, agent.py contains the reference browser-use agent, verify_runner.py executes verifiers, and reporting.py writes summaries and logs.
4. Task model and repository boundary
The benchmark content lives under tasks/, split into uni-m and multi-m tracks. Each task instance is a self-contained directory with description.md, meta.json, and verify.py. This is the key architectural boundary: the harness is generic, while task logic and scoring are embedded per task.
5. Task metadata and app registry
saas_bench/apps.yaml acts as the app catalog for all supported SaaS systems. It encodes what the harness needs to bring up environments: service names, ports, startup commands, and health checks. The task metadata points the harness to the relevant apps/sites for each instance.
6. Multi-app and slot-based isolation
The evaluator supports parallel workers. slot.py assigns each worker a slot and derives deterministic port ranges so multiple SaaS stacks can run concurrently without collision. This makes isolation a first-class architectural concern.
7. Containerized environment layer
The docker/ directory contains Compose templates for specific apps such as Mattermost, OnlyOffice, ownCloud, and Pretix, plus image-loading support. The README indicates that the benchmark depends on prebuilt SaaS images and Docker Compose on a Linux host, so the environment is intentionally heavy-weight and reproducible.
8. Agent layer
The default agent is a browser automation layer built on browser-use and a headless Chromium browser. It talks to an OpenAI-compatible chat-completions endpoint, so the agent boundary is “language model + browser actions” rather than any app-specific integration.
9. Verification layer
Scoring is performed by task-local verify.py scripts, executed via verify_runner.py. Verifiers inspect the live application state inside the running containers, which means the benchmark result depends on the actual SaaS side effects rather than on the agent’s intermediate reasoning.
10. Multimodal inputs
The multi-m track includes supporting assets such as PDFs, images, or audio under tasks/multi-m/inputs/. The README notes that these are resolved by relative paths from verify.py, so input assets are part of the task contract and must be present for verification to succeed.
11. Operational scripts
scripts/run.sh is the main entry for running evaluations, while scripts/load_images.sh loads the required Docker images and scripts/stop_all.sh cleans up stale environments. These scripts are operational wrappers around the Python harness and Docker layer.
12. Result and error handling
Each task produces an agent trajectory JSON and a separate verification JSON in a result directory, with a run-level summary.json and errors.log. This creates a clean separation between execution traces, scoring, and aggregate reporting.
13. Documentation as interface spec
docs/task_format.md and docs/verify_protocol.md define the expected task and verifier contracts. For architecture purposes, these docs are important because they specify the stable interfaces between task authors, the harness, and the per-task verifier logic.
14. External dependencies that shape the system
The benchmark relies materially on Docker, browser automation via Playwright/Chromium, and an OpenAI-compatible model endpoint. Those dependencies define the major runtime boundaries: environment orchestration, browser control, and model inference are all external to the task code itself.
Main entry points: docker docker/ · run.py run.py · uni-m uni-m · tasks tasks
Components 28
Harness
Python control plane that loads tasks, runs agents, verifies outcomes, and reports results.
- run.py · Main evaluation command that orchestrates a benchmark run.
saas_bench/run.py - loader.py · Discovers tasks and constructs prompts / task state.
saas_bench/loader.py - slot.py · Assigns worker slots and deterministic port ranges for concurrent runs.
saas_bench/slot.py - agent.py · Reference browser-use agent driven by an LLM and Chromium.
saas_bench/agent.py - verify_runner.py · Executes task-local verify.py scripts against live app state.
saas_bench/verify_runner.py - reporting.py · Writes summaries, traces, and run logs.
saas_bench/reporting.py - apps.yaml · Catalog of SaaS services, ports, startup commands, and health checks.
saas_bench/apps.yaml
Tasks
Benchmark task corpus and per-task scoring logic.
- tasks · Root of the benchmark task tree.
tasks - uni-m · Single-input task track with task-specific verify scripts.
tasks/uni-m - multi-m · Tasks that include external assets such as PDFs, images, or audio.
tasks/multi-m - Business · Representative uni-m task family with many task instances.
tasks/uni-m/Business - Healthcare · Representative uni-m task family with many task instances.
tasks/uni-m/Healthcare - Software · Representative uni-m task family with many task instances.
tasks/uni-m/Software - Teamwork · Representative uni-m task family with many task instances.
tasks/uni-m/Teamwork - Agriculture · Representative multi-m task family with many task instances.
tasks/multi-m/Agriculture - Media · Representative multi-m task family with many task instances.
tasks/multi-m/Media - Inputs · Shared multi-m supporting assets resolved by verify.py relative paths.
tasks/multi-m/inputs
Environment
Containerized SaaS apps and Docker Compose templates used during evaluation.
- docker/ · Docker Compose templates and image-loading support for supported SaaS apps.
docker - Mattermost · Docker Compose template for a supported SaaS app.
docker/mattermost.yml.tpl - OnlyOffice · Docker Compose template for a supported SaaS app.
docker/onlyoffice.yml.tpl - ownCloud · Docker Compose template for a supported SaaS app.
docker/owncloud.yml.tpl - Pretix · Docker Compose template for a supported SaaS app.
docker/pretix.yml.tpl - code-server deps · Base Dockerfile for image dependencies used by the environment layer.
docker/code-server-deps.Dockerfile
Ops & docs
Scripts and documentation that define and operate the benchmark contract.
- Task format · Specifies the task instance structure and authoring contract.
docs/task_format.md - Verify protocol · Defines how task verifiers interact with the live benchmark environment.
docs/verify_protocol.md - run.sh · Shell entrypoint for running evaluations.
scripts/run.sh - load_images.sh · Loads required Docker images before benchmark execution.
scripts/load_images.sh - stop_all.sh · Stops stale environments and tears down running services.
scripts/stop_all.sh
Connections 29
- run.py → loader.py: loads tasks · Run entrypoint discovers tasks and builds task context.
- run.py → slot.py: assigns slots · Run entrypoint uses slot isolation for parallel workers.
- run.py → agent.py: launches agent · Run entrypoint starts the browser-based agent.
- run.py → verify_runner.py: verifies · Run entrypoint triggers task verification after execution.
- run.py → reporting.py: writes results · Run entrypoint persists traces and summaries.
- loader.py → apps.yaml: resolves apps · Task loading maps benchmark tasks to required SaaS services.
- loader.py → tasks: reads tasks · Task loader discovers task instances under the benchmark corpus.
- slot.py → docker/: isolates ports · Slot allocation ensures concurrent stacks do not collide.
- agent.py → Task format: follows prompt · Agent behavior is constrained by task instructions and format.
- verify_runner.py → Verify protocol: executes by spec · Verifier runner invokes per-task verification according to protocol.
- verify_runner.py → tasks: runs verify.py · Verification is delegated to task-local scripts inside each instance.
- reporting.py → tasks: stores traces · Per-task artifacts are grouped under task results.
- tasks → uni-m: contains · Top-level split for single-modal tasks.
- tasks → multi-m: contains · Top-level split for multimodal tasks.
- uni-m → Business: family · Business is a representative uni-m task family.
- uni-m → Healthcare: family · Healthcare is a representative uni-m task family.
- uni-m → Software: family · Software is a representative uni-m task family.
- uni-m → Teamwork: family · Teamwork is a representative uni-m task family.
- multi-m → Agriculture: family · Agriculture is a representative multi-m task family.
- multi-m → Media: family · Media is a representative multi-m task family.
- multi-m → Inputs: shares assets · Multimodal tasks rely on shared supporting inputs.
- run.sh → run.py: wraps · Shell wrapper invokes the Python evaluation CLI.
- load_images.sh → docker/: preloads · Loads the benchmark's required container images.
- stop_all.sh → docker/: cleans up · Stops containers and removes stale environments.
- docker/ → Mattermost: defines · Compose template for Mattermost.
- docker/ → OnlyOffice: defines · Compose template for OnlyOffice.
- docker/ → ownCloud: defines · Compose template for ownCloud.
- docker/ → Pretix: defines · Compose template for Pretix.
- docker/ → code-server deps: builds on · Docker environment layer includes base image support.