Skip to content

Resource limit configuration (fuel, memory, timeout) #239

Description

@aallan

Add first-class resource limit configuration for running untrusted agent-generated code.

Motivation

When LLMs generate and execute code, treating that code as untrusted is the only safe default. Wasmtime supports fuel-based execution (limiting CPU instruction count), memory caps, and stack depth limits. Vera should expose these as first-class configuration rather than requiring host-level setup.

Proposed interface

vera run --fuel 10000000 --memory 64MB --timeout 30s program.vera
  • --fuel N — limit to N WASM instructions (wasmtime fuel)
  • --memory SIZE — cap linear memory allocation
  • --timeout DURATION — wall-clock execution limit
  • --stack-depth N — limit call stack depth

Implementation notes

All limits are enforced by the wasmtime runtime, not by generated code — the agent cannot bypass them. These flags configure the wasmtime Store before execution.

Dependencies

  • None (wasmtime already supports these features)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestruntime-gcWASM runtime, host bindings, and GC

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions