Skip to content

Harden LLRT capability execution - #17

Merged
robinbraemer merged 2 commits into
mainfrom
codex/fix-llrt-security-audit
Jun 17, 2026
Merged

Harden LLRT capability execution#17
robinbraemer merged 2 commits into
mainfrom
codex/fix-llrt-security-audit

Conversation

@robinbraemer

Copy link
Copy Markdown
Member

Summary

  • add explicit data-only and capability executor contracts for codemode
  • add LLRT callJsonWithHost manifest execution that binds host methods without exposing globalThis.__llrtHostCall
  • keep legacy LLRT function globals working by routing them through a private manifest namespace
  • harden data-only input validation, result/host payload limits, request-bridge handling, and package versions for @robinbraemer/llrt@0.2.0 + @robinbraemer/codemode@0.4.0

Security notes

  • data-only execution rejects function/accessor input and caps graph traversal/queue growth
  • manifest host names are validated in TypeScript and Rust
  • capability execution rejects data globals that collide with capability namespaces
  • second-pass security review reported no remaining P0/P1/P2 boundary findings

Verification

  • mise exec -- pnpm run ci

Release / handoff

  1. Review and merge this PR.
  2. Run the LLRT native package workflow so platform binaries for @robinbraemer/llrt@0.2.0 publish with the main package.
  3. Publish @robinbraemer/codemode@0.4.0 after @robinbraemer/llrt@0.2.0 is available.
  4. Update CNAP catalog versions to consume @robinbraemer/codemode@^0.4.0 and @robinbraemer/llrt@^0.2.0, then run the focused codemode domain check there.

Rationale: LLRT is becoming the default codemode runtime, so host access must be explicit and manifest-bound instead of flowing through loose function globals or raw bridge globals. This adds data-only and capability executor contracts, validates data-only inputs, binds LLRT host capabilities by declared namespace/method, and versions LLRT/codemode for release.

Rejected: Keeping function globals as the main capability path was rejected because guest code could observe the raw LLRT host bridge and synthesize callback names. Keeping CNAP on implicit codemode executor selection was rejected because capability-capable execution should be explicit.

Risk: Legacy execute() with function globals is still supported, but now routes through a private manifest namespace. CNAP integration cannot be fully verified until @robinbraemer/llrt@0.2.0 and @robinbraemer/codemode@0.4.0 are published and consumed.

Tested: mise exec -- pnpm run ci

Not-tested: CNAP focused check against the new package version; blocked until the npm releases are available or locally linked into that worktree.
@robinbraemer
robinbraemer marked this pull request as ready for review June 17, 2026 09:20
@robinbraemer
robinbraemer merged commit b40b3a3 into main Jun 17, 2026
6 checks passed
@robinbraemer
robinbraemer deleted the codex/fix-llrt-security-audit branch June 17, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant