SkillEffect: Checked Lowering for Memory-Bounded Agent Tools
Organizations: Department of Computer Science & Engineering University of Notre Dame Notre Dame, IN, USA
Abstract
Agent Skills can specify procedural and resource obligations for tool use, and language models instantiate them as concrete programs. However, when models turn this guidance into code for existing tool interfaces, even a semantically correct program may load an entire input and exceed the memory available to one tool call. We present SkillEffect, a checked-lowering runtime for computations with a recoverable source relation, an audited bounded implementation, and a registered output postcondition. Before granting execution authority, an independent checker rebuilds each proposed lowering from the submitted program and immutable input. Every relation plugin supplies a source recognizer, input-fact extractor, bounded-IR constructor, arena-bound function, and postcondition; one common runtime provides checked selection, bounded-VM execution, atomic capacity leasing, and staged publication. Generality in SkillEffect is architectural rather than automatic: each supported computation requires an audited relation plugin, while the dispatch, resource-control, execution, and publication mechanisms are shared across plugins. Across six operator families, bounded access substantially reduces peak memory and improves completion under externally fixed caps. Six plugins instantiate the same contract across five execution patterns, from streaming reduction to bounded-heap Top-k. The XLSX onboarding study and Top-k extension show that a new relation and a new retained-state pattern reuse the same trust boundary, while the checker accepts all evaluated legal configurations and rejects all adversarial proposals. Together, these results show that one checked-lowering architecture can enforce heterogeneous registered memory relations at Agent tool dispatch.
Figures & tables
| Relation | Source pattern | Execution pattern and retained state | Input facts | Postcondition |
|---|---|---|---|---|
| CSV / Polars | Eager relational pipeline | Streaming relational pipeline: projection, filters, and integer reduction; input window plus constant aggregates | Header and strict stream scan | Schema/range and aggregate invariants |
| FASTA / Biopython | Sequence-list materialization | Iterator/record reduction; input window plus fixed histogram | Bounded-line sequence scan | Record/base cardinality and conservation |
| FCS / FlowIO | Event-payload loading | Metadata projection from header/TEXT; bounded metadata state | File offsets, header, and TEXT segment | Requested metadata reconstructed from input facts |
| Zarr | Full-array materialization | Chunked incremental reduction; one chunk plus fixed histogram | Array metadata and raw chunks | Shape, unsigned sum, and histogram reconstructed from chunks |
| XLSX | Worksheet materialization | Iterator/row-window reduction; row window plus constant aggregates | Workbook metadata and row scan | Three aggregates reconstructed from row facts |
| Audit Top- | Global materialization and sort | Bounded-heap Top- ; input window plus records | Strict JSONL stream scan | Cardinality, unique IDs, value ranges, and registered ordering |
| Proposal class | Checker decision |
|---|---|
| Target-IR semantics | 200/200 rejected |
| Resource understatement | 80/80 rejected |
| Source semantics | 80/80 rejected |
| Immutable input binding | 40/40 rejected |
| Output-gate binding | 40/40 rejected |
| Platform binding | 40/40 rejected |
| Extension | Relation-specific code | Shared-core changes |
|---|---|---|
| XLSX | Checker: 216 VM operator: 63 Builder: 197 | 12 wiring lines Core path unchanged |
| Top- | Recognizer + facts Heap target + arena Postcondition | Registration + routing Dispatch + freeze 7 core files unchanged |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Family | Bounded form | Eager form |
|---|---|---|
| XLSX | load_workbook(read_only=True) or projected read_excel(usecols=...) | The same loaders without the mode or column projection |
| FlowIO | FlowData(..., only_text=True) | The same constructor without only_text , materializing event data |
| AnnData | read_h5ad(..., backed=’r’) | The same reader without backed , materializing the matrix |
| Zarr | Chunked slices and an incremental reduction | array[:] on the same array object |
| Polars | scan_csv(...).collect(engine=’streaming’) | Sibling read_csv followed by the same relational operations |
| Biopython | Single-pass consumption of the SeqIO.parse iterator | The caller wraps the same iterator in list(...) |
| Method | Tasks | Passed | Failures |
|---|---|---|---|
| Direct eager | 0/24 | 0/72 | 72/0/0 |
| Always-pin | 9/24 | 27/72 | 12/33/0 |
| Retry | 4/24 | 12/72 | 9/51/0 |
| Composition | 9/24 | 27/72 | 0/15/30 |
| Bounded lowering | 24/24 | 72/72 | 0/0/0 |
| Family | Direct (s) | Bounded (s) | Ratio |
|---|---|---|---|
| XLSX | 24.381 | 19.727 | 0.811 |
| FlowIO | 0.534 | 0.449 | 0.833 |
| AnnData | 1.355 | 1.098 | 0.846 |
| Zarr | 1.220 | 1.057 | 0.879 |
| Polars | 1.069 | 0.787 | 0.740 |
| Biopython | 3.136 | 1.947 | 0.622 |
| Relation | Bound | Median peak | Peak range | Cert./exec. (s) |
|---|---|---|---|---|
| CSV / Polars | 80.142 | 14.707 | 14.672–14.746 | 0.410/0.418 |
| FASTA / Biopython | 80.142 | 14.770 | 14.641–14.801 | 0.456/0.432 |
| FCS / FlowIO | 80.143 | 14.668 | 14.652–14.785 | 0.398/0.412 |
| Zarr | 80.266 | 14.711 | 14.664–14.746 | 0.409/0.426 |
| XLSX | 80.209 | 71.844 | 71.801–71.844 | 41.700/41.587 |
Runtime Enforcement for AI Agents
Runtime enforcement for AI agents checks and constrains actions as they execute, helping prevent unsafe or unauthorized effects.
See all 270 papers