Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f92de43
wip: pre-action policy gate and versioned ST-WebAgentBench harness
abrichr Nov 30, 2026
ffb6566
fix(stweb harness): install libatomic and cryptography on the instanc…
abrichr Dec 1, 2026
e581e9d
docs(capabilities): link the policy gate row to its PR
abrichr Dec 1, 2026
c495125
fix(stweb harness): wait up to 60 minutes for the apps to boot
abrichr Dec 1, 2026
a1c08da
fix(stweb harness): install browsergym's own dependencies, check impo…
abrichr Dec 1, 2026
48ea852
fix(policy gate): links, menu entries, tabs and menu openers are not …
abrichr Dec 1, 2026
ba17488
feat(stweb harness): optional Claude backend (STWEB_PROVIDER=anthropi…
abrichr Dec 1, 2026
43accee
feat(stweb harness): claude_code provider runs model calls through th…
abrichr Dec 1, 2026
973b21b
feat(stweb harness): stop a claude_code run once CLI-reported usage p…
abrichr Dec 1, 2026
74701a5
feat(stweb analyze): build one ledger from several launches and recor…
abrichr Dec 1, 2026
4cb45f3
fix(stweb harness setup): wait for unattended-upgrades and the apt lo…
abrichr Dec 1, 2026
a161d12
feat(stweb analyze): public id arm0_unwrapped with a model per arm; a…
abrichr Dec 1, 2026
11b4efe
docs(stweb harness): model-neutral arm id, Claude Code backend and on…
abrichr Dec 1, 2026
72befd1
feat(stweb): three-arm claude-opus-5-5 ledger supersedes the gpt-5.4 …
abrichr Dec 1, 2026
13c8763
Merge remote-tracking branch 'origin/main' into claude/stweb-policy-gate
abrichr Dec 1, 2026
3d5c94c
fix(kernel): a negated reply never counts as consent in the policy gate
abrichr Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ Counted from the per-run ledgers in [`benchmarks/public-runs/`](benchmarks/publi
| Real web app upgrades, paired gemini-3.1-pro-preview (36 of 60 planned tasks; the run stopped at the API's daily quota) | 36 | 34 / not measured / 2 | Unwrapped gemini-3.1-pro-preview | 17 / 0 / 19 | the agent declared the task done |
| HealthAdminBench, single tab (gpt-5.4 and claude-sonnet-5-5 pooled) | 24 | 5 / 11 / 8 | Unwrapped, same models | 7 / 17 / 0 | every run; it never escalated |
| HealthAdminBench, multi-tab (gpt-5.4 and claude-sonnet-5-5 pooled) | 24 | 11 / 10 / 3 | Unwrapped, same models | 10 / 14 / 0 | every run; it never escalated |
| ST-WebAgentBench (GitLab, ShoppingAdmin, SuiteCRM), gpt-5.4 | 44 | 3 / 22 / 19 | Unwrapped gpt-5.4 | 2 / 42 / 0 | every run; it never escalated |
| ST-WebAgentBench (GitLab, ShoppingAdmin, SuiteCRM), claude-opus-5-5 | 44 | 0 / 27 / 17 | Unwrapped claude-opus-5-5 | 0 / 44 / 0 | every run; it never escalated |

How each benchmark checks a run, and when OpenAdapt reports a run done:

- Real web app upgrades (Gitea, Vikunja, Memos, Mealie): the checker is a read of the app's backend through its REST API after the run. OpenAdapt reports a run done when its read-back found the record through the app's REST API. In this run OpenAdapt's read-back used the same backend check that scores the run, so its silent-error count is not independent and is shown as not measured.
- Real web app upgrades, paired gemini-3.1-pro-preview (36 of 60 planned tasks; the run stopped at the API's daily quota): the checker is a read of the app's backend through its REST API after the run. OpenAdapt reports a run done when its read-back found the record through the app's REST API, and it issued a signed receipt. In this run OpenAdapt's read-back used the same backend check that scores the run, so its silent-error count is not independent and is shown as not measured.
- HealthAdminBench, single tab (gpt-5.4 and claude-sonnet-5-5 pooled): the checker is HealthAdminBench's own grader; a run passes when every subtask passes. OpenAdapt reports a run done when the run ended without OpenAdapt escalating it to a person.
- HealthAdminBench, multi-tab (gpt-5.4 and claude-sonnet-5-5 pooled): the checker is HealthAdminBench's own grader; a run passes when every subtask passes. OpenAdapt reports a run done when the run ended without OpenAdapt escalating it to a person.
- ST-WebAgentBench (GitLab, ShoppingAdmin, SuiteCRM), gpt-5.4: the checker is ST-WebAgentBench's evaluator; a run passes when the task is completed with no policy violated. OpenAdapt reports a run done when the run ended without OpenAdapt escalating it to a person.
- ST-WebAgentBench (GitLab, ShoppingAdmin, SuiteCRM), claude-opus-5-5: the checker is ST-WebAgentBench's evaluator; a run passes when the task is completed with no policy violated. Every arm ran on claude-opus-5-5, so these numbers are not comparable with the earlier gpt-5.4 run, which this run supersedes. OpenAdapt reports a run done when the run ended without OpenAdapt escalating it to a person.

On the paired gemini-3.1-pro-preview run (36 tasks), the unwrapped agent made 219 model calls and OpenAdapt made 10. OpenAdapt's 27 warm replays made 0.

Expand Down
26 changes: 18 additions & 8 deletions benchmarks/public-runs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ The "Verified Results" block in the top-level [`README.md`](../../README.md) is
| [`exp_proof_gemini31pro_n60_results.json`](exp_proof_gemini31pro_n60_results.json) | Paired `gemini-3.1-pro-preview` unwrapped vs. `+openadapt-kernel` on real-upgrade UI drift | `N = 36` paired episodes completed before Google Tier-1 250 RPD quota halt (target `60`) |
| [`clean_hab_results.json`](clean_hab_results.json) | Zero-leak Stanford `HealthAdminBench` (Single-Tab) | `N = 24` paired (`gpt-5.4` + `claude-sonnet-5-5`), 132 real page reloads |
| [`clean_hab_multitab_results.json`](clean_hab_multitab_results.json) | Zero-leak Stanford `HealthAdminBench` (Multi-Tab) | `N = 24` paired (`gpt-5.4` + `claude-sonnet-5-5`), 95 real page reloads |
| [`stweb_scale_n40_results.json`](stweb_scale_n40_results.json) | `ST-WebAgentBench` (ICLR 2026) on WebArena + SuiteCRM Docker | `N = 44` paired (`gpt-5.4`) across GitLab, ShoppingAdmin, SuiteCRM |
| [`stweb_policy_gate_n44_results.json`](stweb_policy_gate_n44_results.json) | `ST-WebAgentBench` (ICLR 2026) on WebArena + SuiteCRM Docker, three arms including the pre-action policy gate | `N = 44` paired, every arm on `claude-opus-5-5`, across GitLab, ShoppingAdmin, SuiteCRM |
| [`stweb_scale_n40_results.json`](stweb_scale_n40_results.json) | Superseded by `stweb_policy_gate_n44_results.json` for every metric | `N = 44` paired (`gpt-5.4`); its arms shared app state |
| [`agentdojo_results.json`](agentdojo_results.json) | `AgentDojo` prompt-injection suite | `N = 16` benign + `N = 48` under-attack per model across 4 models |
| [`osharm_live_v2_results.json`](osharm_live_v2_results.json) | `OS-Harm` v2 live desktop safety tasks | `N = 9` tasks per model across 3 models (`N = 27` pooled) |
| [`veto4b_r6_desktop_results.json`](veto4b_r6_desktop_results.json) | `Veto-4B-r6` local 4B safety verifier on 4 unseen desktop apps | `N = 160` out-of-distribution steps (`73` failures, `87` clean) |
Expand Down Expand Up @@ -86,16 +87,25 @@ Source files: [`clean_hab_results.json`](clean_hab_results.json) (Single-Tab), [

## 3. Additional External Safety & Policy Benchmarks

### `ST-WebAgentBench` (Real WebArena + SuiteCRM Docker, `N = 44` Paired `gpt-5.4`)
### `ST-WebAgentBench` (Real WebArena + SuiteCRM Docker, `N = 44` Paired, `claude-opus-5-5`)

Source file: [`stweb_scale_n40_results.json`](stweb_scale_n40_results.json).
Source file: [`stweb_policy_gate_n44_results.json`](stweb_policy_gate_n44_results.json). Harness: [`benchmarks/stwebagentbench/`](../stwebagentbench/).

| Arm | Silent Error Rate (SER) | 95% CP CI | Completion (CR) | 95% CP CI | Completion under Policy (CuP) | 95% CP CI | Human Escalation Precision (HEP) |
|---|---|---|---|---|---|---|---|
| Unwrapped `gpt-5.4` | 95.5% (`42/44`) | `[84.5%, 99.4%]` | 6.8% (`3/44`) | `[1.4%, 18.7%]` | 4.5% (`2/44`) | `[0.6%, 15.5%]` | -- (`0` escalations) |
| OpenAdapt (`CommitJIT`) | **50.0%** (`22/44`) | `[34.6%, 65.4%]` | **11.4%** (`5/44`) | `[3.8%, 24.6%]` | **6.8%** (`3/44`) | `[1.4%, 18.7%]` | **100.0%** (`19/19`, CI `[82.4%, 100.0%]`) |
Every arm ran on `claude-opus-5-5` through Claude Code, so these numbers are not comparable with the earlier `gpt-5.4` run. This ledger supersedes [`stweb_scale_n40_results.json`](stweb_scale_n40_results.json) for every metric. That run's arms shared app state; here each arm ran on its own fresh instance. The unwrapped arm ran in a second, later launch after its first launch failed on setup, from a commit that differs only in setup scripts.

Pooled McNemar exact test on silent error reduction: `20` fixed, `0` regressed (`p = 2.0e-6`).
| Arm | Policy-violating runs | ... with no escalation | Silent errors (SER) | Completion (CR) | Completion under Policy (CuP) | Escalations |
|---|---|---|---|---|---|---|
| Unwrapped `claude-opus-5-5` | 61.4% (`27/44`) | `27/44` | 100.0% (`44/44`) | 15.9% (`7/44`) | 0.0% (`0/44`) | `0` |
| OpenAdapt `CommitJIT` | 68.2% (`30/44`) | `19/44` | 65.9% (`29/44`) | 13.6% (`6/44`) | 0.0% (`0/44`) | `15` |
| OpenAdapt `CommitJIT` + policy gate | 68.2% (`30/44`) | `16/44` | 61.4% (`27/44`) | 18.2% (`8/44`) | 0.0% (`0/44`) | `17` |

Exact McNemar tests on the 44 paired tasks:

- Policy-violating runs (primary), unwrapped vs. policy gate: `0` fewer, `3` more (`p = 0.25`). The gate did not reduce policy-violating runs.
- Silent errors, unwrapped vs. `CommitJIT`: `15` fewer, `0` more (`p = 6.1e-5`); unwrapped vs. policy gate: `17` fewer, `0` more (`p = 1.5e-5`).
- `ask_the_user` violating runs, `11`, `16` and `6` by arm: unwrapped vs. policy gate `7` fewer, `2` more (`p = 0.18`); `CommitJIT` vs. policy gate `11` fewer, `1` more (`p = 0.006`, one of several secondary tests, uncorrected).

No arm completed any task under policy, so here a silent error is any run that was not escalated, and the drop in silent errors equals the number of escalations. In every escalated run that violated a policy (`11` of `15` for `CommitJIT`, `14` of `17` with the gate), the violation came before the escalation.

### `AgentDojo` Prompt Injection (`N = 48` Under-Attack per Model)

Expand Down
53 changes: 31 additions & 22 deletions benchmarks/public-runs/repro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,36 +219,45 @@ def verify_hab(title: str, filename: str, jit_prefix: str):
verify_hab("[2a] Stanford HealthAdminBench Single-Tab", "clean_hab_results.json", "clean_commit_jit")
verify_hab("[2b] Stanford HealthAdminBench Multi-Tab", "clean_hab_multitab_results.json", "clean_multitab_jit")

# 3a. ST-WebAgentBench (N = 44 paired gpt-5.4)
st = load_json("stweb_scale_n40_results.json")
st_base = st["arms"]["arm0_unwrapped_gpt54"]["episodes"]
st_jit = st["arms"]["arm2_commitjit"]["episodes"]
assert len(st_base) == len(st_jit) == 44
print(f"\n[3a] ST-WebAgentBench (WebArena + SuiteCRM Docker, N = {len(st_base)} paired gpt-5.4)")
for label, eps in [("Unwrapped gpt-5.4", st_base), ("OpenAdapt CommitJIT", st_jit)]:
# 3a. ST-WebAgentBench (N = 44 paired, every arm on claude-opus-5-5; supersedes the gpt-5.4 run)
st = load_json("stweb_policy_gate_n44_results.json")
st_model = st["model"]
st_arms = [
("arm0_unwrapped", f"Unwrapped {st_model}"),
("arm2_commitjit", "OpenAdapt CommitJIT"),
("arm5_commitjit_policy_gate", "OpenAdapt CommitJIT + policy gate"),
]
st_eps = {k: sorted(st["arms"][k]["episodes"], key=lambda e: e["task_id"]) for k, _ in st_arms}
assert all(len(v) == 44 for v in st_eps.values())
assert len({tuple(e["task_id"] for e in v) for v in st_eps.values()}) == 1
print(f"\n[3a] ST-WebAgentBench (WebArena + SuiteCRM Docker, N = 44 paired, every arm on {st_model})")


def st_silent(e):
return (not e["cup"]) and (not e["escalated"])


for key, label in st_arms:
eps = st_eps[key]
n = len(eps)
ser = sum(1 for e in eps if (not e["cup"]) and (not e["escalated"]))
pvr = sum(1 for e in eps if e["policy_violated"])
pvr_no_esc = sum(1 for e in eps if e["policy_violated"] and not e["escalated"])
ser = sum(1 for e in eps if st_silent(e))
cr = sum(1 for e in eps if e["completed"])
cup = sum(1 for e in eps if e["cup"])
esc = sum(1 for e in eps if e["escalated"])
true_esc = sum(1 for e in eps if e["escalated"] and (not e["cup"]))
hep_str = fmt_rate(true_esc, esc) if esc else "n/a (0 escalations)"
print(f" {label}:")
print(f" Policy-violating runs : {fmt_rate(pvr, n)}")
print(f" ... not escalated : {fmt_rate(pvr_no_esc, n)}")
print(f" SER : {fmt_rate(ser, n)}")
print(f" CR : {fmt_rate(cr, n)}")
print(f" CuP : {fmt_rate(cup, n)}")
print(f" HEP : {hep_str}")
st_b = sum(
1
for eb, ej in zip(st_base, st_jit)
if ((not eb["cup"]) and (not eb["escalated"])) and not ((not ej["cup"]) and (not ej["escalated"]))
)
st_c = sum(
1
for eb, ej in zip(st_base, st_jit)
if not ((not eb["cup"]) and (not eb["escalated"])) and ((not ej["cup"]) and (not ej["escalated"]))
)
print(f" McNemar SER reduction: fixed={st_b}, regressed={st_c}, exact p={mcnemar_exact(st_b, st_c):.2e}")
print(f" Escalations : {esc}")
for (ka, la), (kb, lb) in [(st_arms[0], st_arms[2]), (st_arms[0], st_arms[1]), (st_arms[1], st_arms[2])]:
for name, flag in (("policy-violating runs", lambda e: e["policy_violated"]), ("silent errors", st_silent)):
b = sum(1 for x, y in zip(st_eps[ka], st_eps[kb]) if flag(x) and not flag(y))
c = sum(1 for x, y in zip(st_eps[ka], st_eps[kb]) if not flag(x) and flag(y))
print(f" McNemar {name}, {la} vs {lb}: only first={b}, only second={c}, exact p={mcnemar_exact(b, c):.2g}")

# 3b. AgentDojo Prompt Injection (N = 48 under-attack per model)
ad = load_json("agentdojo_results.json")
Expand Down
Loading
Loading