SKILL.nb: Selective Formalization and Gated Execution for Durable Agent Workflows

Amine El Hattami, Nicolas Chapados, Christopher PalarXiv 2026

TL;DR

SKILL.nb introduces a notebook-native framework that treats AI agent workflows as versioned, auditable software artifacts rather than static prompt contexts. By dynamically balancing natural-language instructions and executable code based on real-world execution evidence, it drastically improves the long-term reliability of web automation agents facing environment drift.

What Problem Does This Paper Address?

LLM-based agents are highly capable of generating reusable workflows, code snippets, and procedural memories from past experiences. However, when these agents operate over long periods—especially in web environments—they face a lifecycle reliability problem. Websites constantly change their UI layouts, DOM structures, and data formats.

Existing agent architectures typically treat past experiences as passive prompt context or rigid, all-or-nothing scripts. When a website updates, these rigid scripts break, and append-only memory systems often absorb erroneous or regressive updates. The core challenge is managing the software-maintenance lifecycle of agent workflows: knowing when to harden a step into code, when to fall back to flexible natural language, when to repair a broken step, and when to retire a workflow entirely.

Methods

The authors present SKILL.nb, an online-offline framework that manages reusable agent workflows through evidence-calibrated lifecycle policies. Its architecture relies on three core pillars:

  1. Selective Formalization: Instead of translating an entire workflow into code, SKILL.nb uses accumulated execution evidence to decide which steps should be hardened into executable code and which should remain guided by natural language (NL).
  2. Gate-Conditioned Execution: Workflows are executed step-by-step. Each step features deterministic pre- and post-condition "validation gates" that check the browser state. If a gate validates, the agent executes the hardened code block. If environment drift invalidates the code, the agent locally falls back to the underlying NL procedure or step intent.
  3. Auditable Notebook Representation: Workflows are stored natively as Jupyter notebooks. This allows the framework to interleave markdown instructions, multi-language executable cells, validation gates, and multimodal execution evidence (such as screenshots, error traces, and outputs) within a single version-controlled file.

An offline controller continuously calibrates the thresholds for workflow creation, step formalization, demotion (moving from code back to NL), and retirement by replaying historical execution logs and applying an empirical-Bayes-style shrinkage heuristic to optimize the maintenance-versus-runtime cost trade-off.

Datasets

The framework was evaluated across several challenging web automation benchmarks:

  • WebArena-Verified: A suite of 812 tasks across five self-hosted web applications (Shopping, Admin, Reddit, GitLab, Maps). A harder subset of 258 tasks was used for detailed mechanism ablations.
  • Mind2Web: Used to evaluate zero-shot generalization across cross-task, cross-website, and cross-domain splits.
  • GitLab Version Drift Test: A realistic, custom-configured environment migration where 180 tasks originally learned on GitLab 15.7 were executed on upgraded deployments of GitLab 16.11 and GitLab 18.9 to simulate real-world application updates.

Key Insights and Ideas

  • The Spectrum of Formalization: Hardening agent steps entirely into code provides tight control but introduces extreme brittleness under environment drift. Leaving everything as natural language maintains flexibility but sacrifices reliability. SKILL.nb successfully operates in the middle of this spectrum.
  • Notebooks as Agent Substrates: Storing workflows as notebooks solves a major logging infrastructure problem. Because notebooks natively bind code, markdown, and execution outputs (including visual data like screenshots), they serve as an ideal, self-contained, and auditable trace format for both agents and offline maintenance processes.
  • Gated Promotion Over Append-Only Memory: Traditional memory-centric agents suffer from "negative transfer" when old memories conflict with new UI realities. By enforcing deterministic gate checks and offline verification before any workflow is updated or promoted, SKILL.nb prevents regressive updates from corrupting the agent's skill library.

Key Results

SKILL.nb demonstrated substantial improvements in both initial task execution and long-term reuse stability:

  • Benchmark Superiority: On WebArena-Verified, SKILL.nb achieved a 53.7% single-round success rate, outperforming the strongest baseline (ReasoningBank) by 3.9 percentage points.
  • High Reuse Consistency: Across three perturbed re-executions without updates, SKILL.nb retained 91.7% of its initially successful tasks—15.5 points higher than the next best method, proving the stability of its gated workflows.
Figure 1: SKILL.nb improves task success over repeated rounds, maintains the highest reuse consistency, and optimizes the recovery–regression trade-off. (a) Task success over five perturbed rounds. (b) Reuse consistency: fraction of workflows surviving three perturbed re-executions without updates. (c) Recovery vs. regression under each method’s native update path. Emphasized markers denote repair budget 2 (Table 10). Error bars indicate 95% Wilson CIs.
  • Robustness to Real-World Drift: In the GitLab migration test, when reusing frozen state learned on version 15.7, baselines suffered severe performance drops (up to 14.4 points) due to stale procedural assumptions. SKILL.nb preserved target-version performance, maintaining a fresh-versus-frozen gap of only -1.7 points on GitLab 16.11 and actually improving by +0.6 points on GitLab 18.9.
Performance under real GitLab version drift, comparing fresh starts to frozen-state reuse.

Limitations and Future Work

  • Reliance on Deterministic Gating: The framework's safety and fallback mechanisms depend heavily on the accuracy of its pre/post-condition gates. False positives or negatives in gate validation can lead to execution failures or unnecessary fallbacks.
  • Bounded by Logged Evidence: The offline threshold calibration is strictly replay-relative and cannot offer absolute safety guarantees against completely novel or arbitrary future distribution shifts.
  • Workload Assumptions: The benefits of group-specialized thresholds rely on a recurring workload structure (e.g., enterprise or help-desk automation) and may underperform in highly heterogeneous or entirely novel task environments.
  • Cost Proxy: The maintenance cost model currently only accounts for LLM inference tokens, omitting operational metrics like wall-clock latency, storage overhead, or human-in-the-loop review effort.

Summary updated

Abstract

AI agents increasingly turn past experience into reusable artifacts such as code, workflows, and procedural memories. Reuse can improve efficiency, but it also creates a lifecycle reliability problem: artifacts that succeed once may fail under environment drift, underspecified tasks, or changing task distributions, especially in web automation. We introduce SKILL.nb, a framework for governing reusable agent workflows with evidence-calibrated lifecycle policies. SKILL.nb uses selective formalization: execution evidence decides which workflow steps should become executable code, which should remain natural-language guided, and when those choices should be revised. Workflows are stored as auditable, versioned notebooks that interleave natural-language guidance, multi-language executable cells, validation gates, fallback paths, and multimodal evidence such as outputs, screenshots, and error traces. At runtime, gate-conditioned execution lets each step run code when its gates validate, or fall back locally when drift invalidates the executable realization. On WebArena-Verified, SKILL.nb achieves 53.7% single-round success, improving over the strongest baseline by 3.9 percentage points. Across three re-executions, it retains 91.7% of initially successful tasks, 15.5 points above the next best method. Under bounded repair, it recovers 72.9% of subsequent failures while limiting post-repair regressions to 4.2%, compared with 15.0% to 17.0% for persistent baselines. It also leads on Mind2Web cross-website and cross-domain splits. In a GitLab migration test, SKILL.nb preserves performance when reusing frozen state learned on GitLab 15.7, with frozen-versus-fresh target-version gaps of -1.7 points on GitLab 16.11 and +0.6 points on GitLab 18.9. These results identify lifecycle governance and gate-conditioned execution as reliability axes beyond one-shot task success.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
WebArena-VerifiedSKILL.nbRecovery at budget 272.9%budget=2 update attempts
Source quote
L809: \textsf{SKILL.nb} │ 72.9 [63.3, 80.8] │ 4.2 [2.4, 7.4]
WebArena-VerifiedSKILL.nbRegression at budget 24.2%budget=2 update attempts
Source quote
L809: \textsf{SKILL.nb} │ 72.9 [63.3, 80.8] │ 4.2 [2.4, 7.4]
WebArena-Verified GitLab single-site migrated-task subsetSKILL.nbsuccess rate60.0%subset=GitLab migrated-task subset (180 tasks) · version-transfer=GitLab 15.7 to 16.11
Source quote
L867: \textsf{SKILL.nb} │ 54.4 [47.2,61.6] │ 61.7 [54.4,68.5] │ 60.0 [52.7,66.9] │ 61.1 [53.8,67.9] │ 61.7 [54.4,68.5]
BibTeX
@misc{hattami2026skill,
  author = {Amine El Hattami and Nicolas Chapados and Christopher Pal},
  title = {{SKILL.nb: Selective Formalization and Gated Execution for Durable Agent Workflows}},
  year = {2026},
  eprint = {2606.08049},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.08049},
}
Figure