fix(runtime): authored-code import enforcement + empty-messages foot-gun#219
Merged
Conversation
…ot-gun Two fixes the trusted flywheel run + audit surfaced (all our own code): 1. Empty-messages foot-gun (the real cause of the authored strategy scoring 0/12): the shot executor treated `messages: []` as a CARRIED conversation, so an authored body passing an empty array started the worker with a BLANK prompt (no system, no task). Fixed at the executor chokepoint (covers every caller): empty-or-absent messages = a fresh conversation. The author contract now states it explicitly. 2. Breach 1 (unconfined authored import — was prompt-only): assertAuthoredCodeSafe is a runtime static lint run before the dynamic import — rejects foreign imports, require, eval, new Function, process/globalThis, fetch, node builtins; allows only the defineStrategy import. NOT a sandbox (semi-trusted authors); fully untrusted authors still need a container, documented. Verified: all five escape-hatch cases blocked, a legit strategy allowed. Breach 2 (trusted self-report) was fixed in #217; Breach 3 (ShotResult.score in body control flow) is by design — bodies SHOULD branch on the verified score; the firewall is that they never see the verifier/expected values, which holds (StrategyCtx.surface is open/close only). 680 tests pass.
tangletools
approved these changes
Jun 10, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — ec52d87e
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-10T09:27:52Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes from the trusted flywheel run + audit. (1) The authored strategy scored 0/12 because the executor treated
messages: []as a carried conversation → blank worker prompt; fixed at the chokepoint (empty = fresh) + documented in the author contract. (2) Breach 1 (unconfined import, prompt-only):assertAuthoredCodeSafestatic-lints authored code before import (blocks foreign imports/require/eval/process/fetch/node-builtins; allows only the defineStrategy import) — verified all 5 escapes blocked, legit allowed. Breach 2 fixed #217; Breach 3 is by-design (bodies branch on the VERIFIED score; they never see the verifier). 680 tests pass.