/ github.com / gke-labs / eval-runner

dev-agent-sandbox-version · PASS · 180.2s · 22,879 tokens

gs://gkelabs-evalrunner-dev-eval-runner/runs/9e12fb41aa9fce1bbe0354861cfa7ab9bacf3598/docs/readme_comprehension/2026-12-03T22-51-03-00-00_readme-comprehension_F2TwuUyPgh8qfcdFDPHbrD.json
2 large sections Expand all
pass rule
A
grader reason
ANSWER: A
system You are answering multiple-choice questions about the eval-runner project based solely on the provided documents. 235 lines · 16.0 KB
You are answering multiple-choice questions about the eval-runner project based solely on the provided documents.
Answer only from the provided documents. If an answer cannot be determined from the documents, choose the option stating that it is not stated or not mentioned. Do not assume or extrapolate anything not explicitly stated in the documents.

The following documents describe the eval-runner project.

=== File: README.md ===
# eval-runner

[![.evals](https://dev.dotevals.com/github.com/gke-labs/eval-runner/badge.svg)](https://dev.dotevals.com/github.com/gke-labs/eval-runner) ![trend](https://dev.dotevals.com/github.com/gke-labs/eval-runner/sparkline.svg)

CI for evals: efficient statistical estimation of agentic goodness.  
*CI stands for confidence interval.*

`eval-runner` is a Kubernetes-native continuous integration system that discovers the evals in a repository, executes them in isolated sandboxes on every pull request, and uses statistical estimation to determine whether agent changes represent a measurable improvement or regression.

> **Status: early development.** Today the controller performs eval discovery (runs `.evals/list` in an agent-sandbox), documented in [docs/architecture.md](docs/architecture.md); sample execution, statistical verdicts and PR integration are described in [docs/concept/functionality.md](docs/concept/functionality.md) and are not yet implemented.

## Core Concepts

- **An agent is a distribution, not a function:** The same agent input yields variable outputs across runs. The unit of measurement is therefore a success rate with a confidence interval, rather than a binary pass/fail.
- **Eval discovery via code:** Evals are discovered by executing an entrypoint (`.evals/list`) at the repository root. This executable outputs a JSON manifest detailing tasks, working directories, and declarative resource requirements.
- **Isolated sandboxes:** Each sample runs in an isolated pod (e.g. using `kubernetes-sigs/agent-sandbox`) with only the declared resources (such as Docker or Kind).
- **Statistical verdicts:** By running paired samples between the PR head commit and the base commit, `eval-runner` produces a run-level verdict: `IMPROVED`, `REGRESSED`, `UNCHANGED`, or `INCONCLUSIVE`.
- **Framework compatibility:** Built-in native support for UK AISI Inspect (`inspect_ai`), with format-agnostic extensibility for any evaluation framework.

## Documentation

- [System Architecture](docs/architecture.md): Overview of the system as implemented on `main` today, components, trust model, and implementation status.
- [Architecture Decisions](docs/decisions.md): Architectural decision records (ADR log) documenting design choices and rationales.
- [Development Guide](docs/development.md): Prerequisites, local development workflows, running unit and E2E tests, and running local Inspect evals.
- [Functional Description](docs/concept/functionality.md): Detailed architecture, execution lifecycle, statistical gates, and UI mockups.
- [Contributing](docs/contributing.md): Contribution guidelines and community standards.

## Recommended repository setup

1. **Required Status Check**: Add `eval-runner / evals` as a required status check in a repository ruleset or branch protection rule once evaluation verdicts are trusted, ensuring regressions cannot merge into tracked branches.
2. **About Website**: Point your repository's GitHub "About" website URL at the eval-runner repo page (e.g. `https://dotevals.com/github.com/<owner>/<repo>`) so visitors can immediately see current evaluation scores and historical series trends without having to open the README.

## Contributing

This project is licensed under the [Apache 2.0 License](LICENSE).

We welcome contributions! Please see [docs/contributing.md](docs/contributing.md) for more information.

We follow [Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).

## Disclaimer

This is not an officially supported Google product.

This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.


=== File: docs/development.md ===
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Development Guide

This document describes how to set up your local development environment, deploy eval-runner, and run tests.

## Prerequisites

- **Go**: 1.27 or newer
- **Docker**: Docker daemon running (locally or via `DOCKER_HOST`). (The `buildx` plugin is only required if building multi-arch images with `ap`.)
- **Git**
- **Kubernetes cluster with agent-sandbox**: `agent-sandbox` is a prerequisite for running `eval-runner`. When deploying with `./dev/tasks/deploy-to-kube` (or `./dev/tasks/deploy-to-gke`), `agent-sandbox` is installed automatically. To install the pinned `v1.0.7` release manually on any cluster where `eval-runner` is deployed:

  ```bash
  kubectl apply -f https://github.com/kubernetes-sigs/agent-sandbox/releases/download/v1.0.7/sandbox.yaml
  ```

  The controller will verify that the `Sandbox` CRD (`agents.x-k8s.io/v1beta1`) is present upon startup and fail fast with an error message if it is missing.

### Upgrading the `sandboxd` Image

`eval-runner` injects `sandboxd` into discovery sandboxes via an initContainer using the image reference pinned by digest in `pkg/discovery/sandbox.go` (`SandboxdImage` constant).

To upgrade or repin the `sandboxd` image:
1. Locate the target release or staging image from [agent-sandbox](https://github.com/kubernetes-sigs/agent-sandbox).
2. Inspect the multi-architecture manifest list using `docker buildx imagetools inspect <image-ref>` to verify available platforms and obtain its exact `@sha256:` digest.
3. Update `SandboxdImage` in `pkg/discovery/sandbox.go` with the pinned digest reference.
4. Run `ap test` and `ap e2e` to verify.

### Working Against the `agent-sandbox` Fork

For mTLS support between the controller and `sandboxd`, `eval-runner` relies on a prototype fork of `kubernetes-sigs/agent-sandbox` (`github.com/codebot-robot/agent-sandbox` on branch `sandboxd-mtls`).

#### Local Development with `go.work`
For local multi-module development, a `go.work` file at the repository root points to a sibling checkout:
```bash
# Sibling checkout
cd /workspaces
git clone https://github.com/codebot-robot/agent-sandbox.git
cd agent-sandbox
git checkout sandboxd-mtls

# In eval-runner:
go work init . ../agent-sandbox
```
`go.work` and `go.work.sum` are git-ignored so local workspace configurations do not affect CI.

Because container image builds use the repository root as their build context, a sibling module referenced via `go.work` (e.g. `../agent-sandbox`) is not included in the image build context. Multi-module `go.work` setups pointing to sibling directories are therefore local-only workflows (or the sibling module must be vendored into the tree). For container image builds, the pinned `replace` directive in `go.mod` is used instead.

#### CI Builds via `replace`
In `go.mod`, a pinned `replace` directive resolves `sigs.k8s.io/agent-sandbox` to the fork commit on GitHub so CI builds succeed without requiring a multi-module workspace:
```
replace sigs.k8s.io/agent-sandbox => github.com/codebot-robot/agent-sandbox <commit>
```

#### Building the `sandboxd` Image
To build the `sandboxd` image from the fork:
```bash
./dev/tasks/sandboxd-image
```
Pass `--push` to push the image to a container registry, or pass `IMAGE_PREFIX` and `IMAGE_TAG` to customize the tag.
Pass `--clone-only` to prepare the checkout without building the image.

`dev/tasks/sandboxd-image` uses a sibling checkout (`../agent-sandbox`) if present, or clones the pinned commit outside the repository into `${{XDG_CACHE_HOME}:-~/.cache}/eval-runner/agent-sandbox` (configurable via `AGENT_SANDBOX_DIR`). The fork is intentionally never cloned under the repository tree.

For production and multi-platform releases (`linux/amd64,linux/arm64`), maintainers build and push the image using:
```bash
git clone https://github.com/codebot-robot/agent-sandbox.git && cd agent-sandbox && git checkout 0d9e0d2e62d1
docker buildx build --platform linux/amd64,linux/arm64 -f packages/sandboxd/Dockerfile \
  --build-arg GIT_VERSION=v1.0.7-mtls --build-arg GIT_SHA=0d9e0d2e62d1 \
  -t gcr.io/justinsb-knotai-dev/sandboxd:0d9e0d2 --push .
```
Note: Pushing the multi-arch image to the registry is a maintainer step whenever the fork commit changes. After pushing, update the pinned image digest in `pkg/discovery/sandbox.go`.

### CA Bootstrap and Rotation Procedure

The controller maintains a self-signed CA that issues the controller's client certificate and per-sandbox server certificates:
1. **Initial Bootstrap**: At startup, the controller checks for Secret `sandbox-ca` in `eval-runner`. If absent, it generates an ECDSA P-256 keypair and self-signed CA certificate, stores both CA and client keypairs in `eval-runner/sandbox-ca`, and synchronizes the public CA certificate to ConfigMap `sandbox-ca` in `eval-runner-sandbox`.
2. **Restart Idempotency**: Controller restarts read the existing `sandbox-ca` Secret and verify the ConfigMap without regenerating certificates.
3. **Manual CA Rotation Procedure**:
   - **Important**: Because sandboxd instances load the CA certificate pool once at startup and the controller verifies sandbox server certificates against the active CA, rotating `sandbox-ca` breaks mTLS handshakes with in-flight sandboxes (the controller's new client certificate will not be trusted by existing sandboxd daemons, and existing sandboxes' server certificates will not chain to the controller's new CA). Therefore, in-flight Runs will fail upon CA rotation. Operators should allow active Runs to complete (or drain/delete active Runs) before rotating the CA.
   - Delete or replace Secret `eval-runner/sandbox-ca` with a newly minted CA keypair and client keypair.
   - Restart the controller deployment:
     ```bash
     kubectl rollout restart deployment/eval-runner-controller -n eval-runner
     ```
   - On startup, the controller updates ConfigMap `eval-runner-sandbox/sandbox-ca` with the new public CA cert.
   - All subsequent sandboxes created by the controller mount the updated ConfigMap and receive server certificates signed by the new CA.

Tools like `kind` and `kubectl` do not need to be installed beforehand for testing; test scripts can download and manage them automatically under `.build/bin/`.

## Project Automation (`ap`)

This repository uses [`ap` (autoproject)](https://github.com/gke-labs/gke-labs-infra/blob/main/ap/llms.txt) for project automation, manifests, and CI generation.

Common commands:

- `ap generate`: Formats code, stamps copyright headers, runs CRD generation tasks, updates CI presubmit scripts (`dev/ci/presubmits/`), and regenerates `.github/workflows/ci-presubmits.yaml`.
- `ap lint`: Runs Go linters (`govet`, `gofmt`, etc.).
- `ap test`: Runs unit tests (`go test`).
- `ap build`: Builds container images defined under `images/`.
- `ap deploy`: Builds and deploys images and Kubernetes manifests from `k8s/` into the active cluster.
- `ap e2e`: Discovers and executes all end-to-end tests.

### Task Script Discovery in `dev/tasks/`

`ap` automatically discovers executable scripts located in `dev/tasks/` based on reserved prefixes:
- `build-*`: Executed during `ap build` (and therefore `ap deploy`).
- `test-*`: Executed during `ap test`.
- `lint-*`: Executed during `ap lint`.
- `test-e2e*`: Executed during `ap e2e`.

New scripts added to `dev/tasks/` must pick prefixes deliberately. Standalone utility or maintenance scripts (such as `sandboxd-image` or `deploy-to-kube`) must use names outside these reserved prefixes so they are not run unexpectedly during every build or deploy cycle.

## Generating CRDs and DeepCopy

CRD manifests under `k8s/` and Go `runtime.Object` deepcopy methods are generated using `controller-gen`.

Run:

```bash
./dev/tasks/generate-crds
```

This task is also invoked automatically whenever `ap generate` is executed.

## Building Container Images (`ap build`)

`eval-runner` builds the primary Go container image:
- `images/eval-runner/Dockerfile` (packaging the controller, web UI, and GitHub webhook server)

### Full Git Source Tree Builds and VCS Stamping

Each Go image builds from the full git tree using `COPY . .` rather than a hand-maintained list of subdirectories. Builds use Go package paths (`go build -o <bin> ./cmd/<name>`) rather than file arguments:
- **Automatic VCS Stamping**: Go embeds version control metadata (`vcs.revision`, `vcs.time`, and `vcs.modified`) into the binary via `runtime/debug.ReadBuildInfo()` without needing `-ldflags` or manual build arguments.
- **Reporting and Visibility**:
  - The controller logs the stamped VCS revision at startup (`{{"version"}: "<sha>[-dirty]"}`).
  - The UI displays `eval-runner <sha>[-dirty]` in page footers.
  - All three binaries support `--version` (or `-version`) to print the stamped git revision and exit 0 before any Kubernetes client or network connection is initialized (allowing `docker run --rm <image> --version` to work in distroless environments without cluster access).
- **Caching**: Docker dependency caching is preserved by running `COPY go.mod go.sum ./` and `RUN go mod download` with cache mounts (`--mount=type=cache,target=/go/pkg/mod` and `/root/.cache/go-build`) before `COPY . .`.
- **`.dockerignore`**: A top-level `.dockerignore` excludes ephemeral build outputs (`.build/`, `bin/`), local workspace configurations (`go.work`, `go.work.sum`), credentials, editor configs, and temporary caches, while explicitly keeping `.git` in the context so VCS stamping works. Note: because Go's VCS stamping runs `git status --porcelain` inside the build context, `.dockerignore` must not exclude any git-tracked files, or git inside the container will perceive them as deleted and stamp `-dirty`.

## Deploying to a Cluster (`ap deploy`)

To deploy `eval-runner` into a target Kubernetes cluster (with `agent-sandbox` installed), deploys must use a unique image tag rather than `latest`. Deploying with `latest` leaves the Deployment manifest byte-identical when updating an existing installation, causing `kubectl apply` to report `unchanged` and leaving the cluster silently running the previous digest.

The recommended way to deploy is using the `./dev/tasks/deploy` wrapper, which automatically sets `IMAGE_TAG` from git (short SHA, plus a `-dirty` suffix when the working tree is dirty), invokes `ap` at the repository-pinned version via `go run` (never from `PATH`), and applies the manifests:

```bash
IMAGE_PREFIX=<registry> ./dev/tasks/deploy
```

For example, on Google Kubernetes Engine (GKE):

```bash
IMAGE_PREFIX=gcr.io/my-gke-project ./dev/tasks/deploy
```

### Deploying to any Kubernetes cluster in one step (`dev/tasks/deploy-to-kube`)

For generic Kubernetes clusters (kind, kops, EKS, etc.), `./dev/tasks/deploy-to-kube` (bash, standard library tools only) handles cluster bring-up and deployment idempotently in one step:
1. Ensures namespaces `eval-runner` and `eval-runner-sandbox` exist with restricted pod-security labels (`k8s/00-namespaces.yaml`).
2. Installs `agent-sandbox` at the pinned release (`v1.0.7`, shared with the e2e test harness via `dev/tasks/versions.sh`), waits for the CRD to be established, and waits for the controller deployment rollout.
3. Builds and makes the pinned fork `sandboxd` image available under `IMAGE_PREFIX` (or reuses an existing image with `--skip-sandboxd-build`). When built on an arm64 host, it produces a `linux/amd64` image by default so x86 cluster nodes can execute it.
4. Updates the `eval-runner-config` ConfigMap via `./dev/tasks/configure` with `sandboxdImage`, default service portal settings, and any extra settings supplied via `--set KEY=VALUE`.
5. Invokes `./dev/tasks/deploy`, waits for controller, UI, and webhook rollouts, and conf
... [content truncated]
user
Answer the following multiple choice question. The entire content of your response should be of the following format: 'ANSWER: $LETTER' (without quotes) where LETTER is one of A,B,C,D.

Which pinned release version of kubernetes-sigs/agent-sandbox is required according to docs/development.md?

A) v1.0.7
B) v0.9.4
C) v1.2.0
D) v2.0.1
assistant {"reasoning":"EvEECu4EAVjVB3u3mpykjLVOXRUAl5hWIAURsVvbFPDqtqWT/CGH4+R7h3V8bSueLLs+0y6Mpf0Ia5XwZG2lKB0sY7bnpQMDrQIfb2Qtwp... 2 lines · 1.5 KB
{"reasoning":"EvEECu4EAVjVB3u3mpykjLVOXRUAl5hWIAURsVvbFPDqtqWT/CGH4+R7h3V8bSueLLs+0y6Mpf0Ia5XwZG2lKB0sY7bnpQMDrQIfb2QtwpxsKvzl4yAv6Is9tzGfIIEXDe4ut9QP6/63yLctvHKIXzcohBzNnr5sHSXOFkS/wLpT/IVemsjy3nth5MY1PTEz+onz+YC2sRRJDS/uaQuFMb+6yZPOqi97E14jNEo3TumVOKIFxNWA/WiTJIRIaHT9Yw7eERKqehltE4MyY1wSJJF1gNG0M0kZ4WfQ3DGImQCH/JUKSDgVmY7B5l1Cm/MAKeSrnrTknKGq7bv2QmR93N9YGhxV8LWsDe7nWsr+qZ5Joms8JleByoug+VGjzJUJgkh7PA8hJ4b48gGBgyozhOxlp1zKsQjQZiAI5yM5n+kFdjrX2cjAhvfwuRfTRDdzHkWlSnXh/mU+dhw0OqGuXmkIaEyB3errGbQwEv1qUHwsj32gTmWkb/hezhZjOV3omY6J4ormE73srlDOQAk1ogteuQYgz3oUFyJxfH61bQ/78tnUp9LHaeM1Sh8BiKVnC6vRqsJUw80RasyrGJn1Hd7wsky+rCbBgcLIo2mk12yeMrF9itQ0U+IumVyaUxZaL2KZPERUkSrizYWUJRrlq10Kr4g9aVJUTMUtGtyTx0vRO1ht/CEKgV1jW33ikAzZq+d7zpV9BSmbshlFJi6jAwMsEujfbF7j5PuJdnAcYNdYFcxrd2EbnFJT1TFl+3uIt8qnAXJaQEr5WoCuAhrDp7Ev9XjF9DRYPwdx1TsIUrooCKEK9hRCgGvReZedhawyuKSWrQ==","redacted":true,"summary":"Okay, here's my breakdown of this question.\n\n**Analyzing the Kubernetes Agent Sandbox Version Requirement**\n\nRight, so the question is straightforward: which specific, *pinned* version of `kubernetes-sigs/agent-sandbox` is required, according to the `docs/development.md` file? Excellent, I can work with that. My instinct is to go directly to the source – the documentation. Let's see... looking at the provided text, the snippet referencing installation includes the line: \"To install the pinned `v1.0.7` release manually...\". This is pretty explicit. The example configuration uses the release `v1.0.7`. Therefore, the answer is clearly A. Done.\n\n\n","type":"reasoning"}
ANSWER: A