Document and bound native tool payload envelopes and oversized direct-call failure behavior
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Ativa
- Stack de tecnologia
- rust
- Domínio
- backend-api-design, security
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 83
- Forks
- 8
- Merge médio
- 2d 20h
- PRs com merge (30d)
- 29
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de hyperlight-dev/hyperlight-sandbox
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
hyperlight-dev/hyperlight-sandbox#232 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 42/100
hyperlight-dev/hyperlight-sandbox#134 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
hyperlight-dev/hyperlight-sandbox#135 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
hyperlight-dev/hyperlight-sandbox#136 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
hyperlight-dev/hyperlight-sandbox#137 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de hyperlight-dev/hyperlight-sandbox
Issues semelhantes
-
bug P2: medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
-
tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
vfarcic/dot-agent-deck#2512 ·
Mantenedores costumam responder em até 1 dia