Skip to content

Harden gate, policy, and fixture server after review - #5

Merged
mdabydeen merged 1 commit into
mainfrom
fix/review-findings
Nov 1, 2026
Merged

mdabydeen merged 1 commit into
mainfrom
fix/review-findings

Conversation

@mdabydeen

Copy link
Copy Markdown
Owner

Summary

Follow-up to the senior-engineer review. This branch hardens the decision gate, policy, decider transport, fixture server, revision approval, eval, packaging, and docs.

Gate and policy

  • Narrow Gate API to TargetSpec (role / label / selector); planner code no longer receives Page or Locator.
  • Revalidate the same ElementHandle and fingerprint after model/human approval; block on detach or change.
  • Mask sensitive fill values in model state, approver prompts, evidence, and StoppedByGate; keep the real value only in the execution closure.
  • Guard first navigation with startUrl / allowedOrigins; sanitize title, URL, and page text against prompt injection; read page text in a Chromium isolated world where possible.
  • Record intent and outcome evidence, a policy snapshot, approver identity, and fail closed on policy errors.
  • Validate model answers strictly; unknown choices, non-finite values, and prototype keys fail closed.
  • Broaden hard rules: sensitive fields by name/label/id, dangerous schemes, off-origin links/forms, and Enter in credential fields.
  • Add gateway timeouts, retries, response-size caps, and HTTPS/localhost checks.

Server, approval, eval, packaging

  • Fixture server: 400 on malformed encoding, path.relative containment plus realpath symlink rejection, 404s, security headers, clean shutdown, and missing fixture pages.
  • Revision approval: reject blank identifiers and approvers; optional authorization hook and freshness window.
  • Eval: expected verdicts now use the real policy; add config/policy/case-set hash and NaN-safe metrics; split page fixtures into eval/pages.ts.
  • Remove vercel from production dependencies; require Node >=20.12; add CI and npm run verify; harden the publish script and update docs.

Verification

  • npm run verify — 76 tests pass; typecheck clean.
  • npm audit --omit=dev — 0 vulnerabilities.
  • STOPLINE_BACKEND=keyword npx tsx eval/run.ts — 49/49 answered, 0 errors, 0 unsafe allows, no NaN.
  • npm run demo:revision — matching approval accepted; changed revision rejected.

Limits

These changes narrow the gate but do not sandbox a caller that keeps the raw Page/Locator, and they do not remove the documented TOCTOU, page-controlled-DOM, popup, truncation, or local-evidence limits. See README.md and SECURITY.md for the current boundary.

Constrain the gate API and revalidate elements before acting, mask sensitive fill values, and record intent/outcome evidence. Validate model answers, broaden hard rules, and bound gateway calls. Harden fixture serving and revision approval, align the eval with policy, and add CI, tests, and documentation.
@mdabydeen
mdabydeen merged commit 67823da into main Nov 1, 2026
2 checks passed
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