Skip to content

[Epic] Agent Sandbox & Evaluation — make the ADK a test bench #192

Description

@Sam123ben

Epic — Agent Sandbox & Evaluation: make the ADK a test bench

One line: DevAI can already author agents with the ADK and run them in
production, but there is nowhere in between to run an agent safely and measure whether
it is any good. This epic builds that middle.

BUILD (ADK) → SANDBOX (isolated run) → EVALUATE (scored run) → COMPARE (vs baseline)
  → GATE (thresholds) → PUBLISH / PROMOTE → OBSERVE

The two concepts

A sandbox is the same agent runtime as production with different boundaries — not
a separate "test runtime", or you get works in sandbox, fails in production. It pins
an immutable configuration (agent version, model, prompt version, tool set, dataset
version, token/cost limits, TTL) and, crucially, controls what the agent's actions
actually reach. That last part is what makes an agent sandbox different from an
application sandbox: a normal sandbox isolates a process, an agent sandbox has to
isolate side effects, because the agent decides at runtime to call
refund_customer().

An eval is a test suite for non-deterministic software. You cannot assert
f(x) == y, so you fix a dataset of cases, run the agent over all of them, and score
along several dimensions: deterministic (expected JSON / tool call / schema / task
completed), trajectory (right tools, sensible order, correct arguments, recovered
from failure, no forbidden action), LLM-as-judge (groundedness, helpfulness, reasoning),
and operational (P95 latency, tokens, cost, safety). The output is never just a number —
Evaluation score: 62% tells an engineer nothing; the trace of the failing case tells
them everything.

What we already have (grounded — this epic reuses, it does not rebuild)

Have Where
ADK authoring + publish src/devai/adk/, devai adk new-*/validate/publish
40 agent artifacts + 26 personas architecture/registry-seeds/agents/, specializations/
The agent runtime — on-demand K8s Jobs, resolved tools/skills/prompts pipeline/stages/job_runner.py + runtime/job_spec.py
Ephemeral env with a 4h idle TTL and a reaper preview/service.py
A tool allowlist chokepoint tools/dispatch.py, tools/registry.py
One run-quality scorer + analytics view pipeline/stages/evals.py, /api/analytics/evals
Telemetry adapter, MCP hub, object store adapters/telemetry/, mcphub/, adapters/object_store/

The five real gaps

  1. Sandbox is not a first-class object → [Sandbox] SandboxSpec contract, sandboxes table and REST API #179, [Sandbox] Provision sandboxes through the existing K8s Job runtime (isolation + TTL) #180
  2. The tool layer is binary allow/deny — no mock, replay or block, and no record of what
    was called → [Gateway] Tool gateway modes: real / mock / replay / block #181
  3. No per-invocation trace to look at when something fails → [Trace] Per-invocation trace spine — prompt → LLM → tool → response #182
  4. Evaluation is one hardcoded scorer over a whole pipeline run — no datasets, no
    per-agent eval, no trajectory, no judge → [Evals] Datasets and eval suites — versioned, published, stored independently #184, [Evals] Eval runner and scorer registry #185, [Evals] Trajectory scorer — tool choice, order, arguments, recovery, forbidden actions #186, [Evals] LLM-as-judge scorer, provider-agnostic and version-pinned #187
  5. No comparison and no gate, so quality never blocks a promotion → [Compare] Baseline vs candidate comparison on one dataset version #189, [Gate] Evaluation gates before publish and promotion #190

Issues

Phase 1 — Foundation

Phase 2 — Developer sandbox (MVP ends here, plus a slice of Phase 3)

Phase 3 — Evaluation

Phase 4 — Comparison and gates

UI (after the API)

Cross-cutting

Phase 5 — Scale and governance

Sequencing

#179 ──> #180 ──> #181 ──> #182 ──> #183
                    │        │
                    └────────┴──> #184 ──> #185 ──> #186 ──> #187 ──> #188
                                              │
                                              └──> #189 ──> #190 ──> #191

#194 underpins #180  ·  #195 depends on #182  ·  #196 depends on #185+#189  ·  #197 tracks #191

Guardrails

  • Do not build a second agent runtime. The sandbox is a configuration of the K8s Job
    runtime we already run in production.
  • Tool gateway before eval engine. An eval suite without mode control can issue 500
    real refunds.
  • BLOCK/MOCK is the default for side-effecting tools; engineers opt into real.
  • Eval results outlive sandboxes. Destroying a sandbox never destroys history.
  • Everything versioned and immutable — agent, prompt, dataset, model config — or
    comparison is not trustworthy.
  • Provider-agnostic judging through the LLM adapter + PrincipalLLMResolver.
  • Security from day one: TTL, least-privilege identity, default-deny egress, no
    production secrets, explicit tool policy, immutable audit, token and cost budgets,
    rate limits, destructive tools blocked unless approved.
  • GitOps only; schemas live in tesserix-k8s (repo rule 5).

Relationship to #69 (kagent Agent Substrate)

#69 asks where sandboxed agents execute (WorkerPool + Actor vs on-demand Jobs) and
is gated on #70. This epic is deliberately substrate-agnostic: the sandbox contract,
tool gateway, traces, datasets, scorers, comparison and gates all sit above whatever
executes the agent. If Substrate lands, #180 swaps its backend and nothing else moves.
#75 (the dev → test → deploy → run lifecycle harness) is the natural consumer — its
missing "test" step is an eval run in a sandbox (#185), and #190 is its gate.

Plan

docs/plans/agent-sandbox-evals/IMPLEMENTATION-PLAN.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    adkAgent Development KitepicTracking epic spanning multiple issuesevalsAgent evaluation, datasets, scorerssandboxAgent sandbox / isolated agent execution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions