Skip to content

fix(runtime): authored-code import enforcement + empty-messages foot-gun#219

Merged
drewstone merged 1 commit into
mainfrom
fix/author-hardening
Jun 10, 2026
Merged

fix(runtime): authored-code import enforcement + empty-messages foot-gun#219
drewstone merged 1 commit into
mainfrom
fix/author-hardening

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

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): assertAuthoredCodeSafe static-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.

…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.
@drewstone drewstone merged commit 425cf77 into main Jun 10, 2026
@drewstone drewstone deleted the fix/author-hardening branch June 10, 2026 09:27

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

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.

2 participants