Document and bound native tool payload envelopes and oversized direct-call failure behavior
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start with src/wasm_sandbox/src/lib.rs and src/hyperlight_sandbox/src/tools.rs, then inspect the fixed-revision probe_hyperlight_host_tools.py harness and its native dispatcher entry point. Determine which layer can define the request, response, and refusal-envelope contract, and add or document boundary coverage for malformed, escaped, exact, and oversized inputs. Done means the supported limits and unrecoverable behavior are explicit and reproducible.
索引モデルが issue の本文から書いたものです。
説明
Problem
An embedding host needs a supported way to determine native tool request/response limits and handle oversized direct guest calls. Checking an argument in the host callback is too late if marshalling fails before that callback is reached. Checking only a Python guest helper is bypassable by guest code calling the native dispatcher directly.
The two directions have different limits, and JSON escaping plus lower-level framing make a single character count or fixed overhead allowance insufficient. This request concerns the physical envelope and failure contract; host authorization and application budgets remain the embedding application's responsibility.
Environment and measured evidence
hyperlight-sandbox==0.7.0,hyperlight-sandbox-backend-wasm==0.7.0,hyperlight-sandbox-python-guest==0.7.0.- Windows 11 x86-64/WHP, host Python 3.13.12, packaged Python guest, 400 MiB heap, 200 MiB stack,
HYPERLIGHT_MAX_SURROGATES=0, a bounded disposable native worker. - The following are historical measurements from 2026-10-02, not promised limits or new measurements from 2026-10-03.
For a registered maf_dispatch(payload: str) callback, the guest sends a JSON string containing a tool name and arguments. Request payloads of 12,044, 16,044 and 16,144 UTF-8 bytes reached the parent callback. A request with a 16,200-character ASCII value instead caused worker-pipe EOF before the parent callback observation. Workers were reaped. These observations do not establish the exact maximum or prove which lower-level framing operation failed.
Host responses of 8,000, 16,300, 20,000, 64,000, 256,000 and 400,000 ASCII characters round-tripped in the bounded experiment. Those tests intentionally bypassed the application's conservative response cap to measure the SDK; they are not production-safe ceiling declarations. An escaped/Unicode response needed a different number of bytes when serialized again as a native JSON string.
The audited Wasm implementation configures the guest input buffer from config.heap_size.min(70_000_000). That allocation request does not itself define a supported usable application payload limit. The registry's argument-size check runs after arguments have reached dispatch, so it cannot by itself address failures before dispatch.
Reproduction
The bounded harness at a fixed revision registers the synthetic dispatcher, runs each size in a fresh contained worker, counts UTF-8 payload and IPC-envelope bytes, and records callback arrival and worker retirement. Its guest facade serializes the request and calls the native dispatcher; it does not enforce an application-length check before that call.
From that repository revision on a suitable WHP host, after uv sync --locked:
uv run python scripts/probe_hyperlight_host_tools.py --live --case native-request-16100 --case native-request-16200 --output native-envelope-probe.json
Use a fresh output filename and retain the contained worker boundary; the upper case may terminate native execution. The validator rejects unexpected EOF below the previously observed failing value size. A 2026-10-03 rerun of these two cases failed during native initialization with memory-allocation errors, so neither exercised the intended boundary. Those incomplete results were rejected; they do not confirm or revise the historical size observations. Linux behavior was not measured by these Windows runs.
Requested contract
Please document or expose supported complete-envelope limits for native tool requests, responses and error/refusal responses, and specify the bounded failure behavior for malformed or oversized direct guest calls.
- State how callers account for framing, UTF-8, escaping and serialization expansion for the selected buffer configuration.
- Where possible, reject an oversized request before unsafe native marshalling, including calls that bypass a convenience helper.
- If recoverable refusal is not supported, document the resulting failure and whether the host must retire the sandbox/worker. A bounded, explicit unrecoverable outcome can be integrated; it must not be presented as a recoverable application refusal.
- Exercise just-below, exact and just-above supported limits, malformed input, escaping and refusal envelopes. Distinguish failure to initialize from an exercised transport boundary.
- Identify any lower-layer issue or API that should own the guarantee. If the existing implementation already has a sufficient contract, documentation and reproducible evidence may resolve this without a runtime change.
Simply increasing a buffer, checking only inside the host callback, or asserting a universal approximately 16 KiB cap would not answer the integration question. The embedding application will retain its own worker deadline, revocation and cleanup checks.
Detailed measurements and scope. Downstream adoption tracker: https://github.com/sokolaidev/maf-extensions/issues/1689. This request does not claim a host escape or production native host-tool qualification.
Related request: https://github.com/hyperlight-dev/hyperlight-sandbox/issues/232. Publication confirmation and physical-envelope behavior are separate contracts.
- 主要言語
- Rust
- スター
- 83
- フォーク
- 8
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 29
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hyperlight-dev/hyperlight-sandbox のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
hyperlight-dev/hyperlight-sandbox#232 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
hyperlight-dev/hyperlight-sandbox#134 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
hyperlight-dev/hyperlight-sandbox#135 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
hyperlight-dev/hyperlight-sandbox#136 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
hyperlight-dev/hyperlight-sandbox#137 ·
メンテナーはふだん 2 日以内に返信
hyperlight-dev/hyperlight-sandbox の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vfarcic/dot-agent-deck#2512 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
pop-os/cosmic-applets#1641 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pop-os/cosmic-store#650 ·