Repository navigation
feat(workflows): dry runs stub code's network writes instead of listing code unchecked - #10412
Conversation
An Agent, Router or Evaluator lists the model providers it may call in tools.access; they are not registered tools, so both catalog projections labelled them write. A model call changes nothing outside Sim and a dry run sends it, so one accessIdEffect (blocks/access-effect.ts) labels them read for both projections, keeping any other unregistered id write. A block that runs tools its user chooses (a tool-input field, as an Agent has) stays write whatever its access ids say, so only Router and Evaluator become read.
…ng code unchecked Isolate code (Function blocks, Condition expressions, While/Do While loop conditions, an Agent's run code) now meets the run's side-effect policy at the isolate host's fetch handler. Options are normalized once (the fetch standard's method normalization), the target is validated as a live fetch would be (URL length, egress policy), and then a read (GET/HEAD/OPTIONS without a method-override header) is sent while any other request gets an empty 200 with x-sim-dry-run: stubbed and is recorded in sideEffects.stubbed as function_execute. The recorded request keeps the method, a capped URL with query names only, header names and a capped body, with the code's env and personal secrets masked alongside the usual redaction. An allowed block sends everything and is recorded allowed on its first write. Only code in a remote sandbox is listed unchecked. The policy is trusted in-process state threaded through executeFunctionTool, executeFunction and executeFunctionRequest into executeInIsolatedVM. A Function block that fails after stubbed writes says how many got an empty response and that --allow '<block>' sends them. http_request declares readsWhen, so a GET/HEAD/OPTIONS API call without a method-override header is sent as a read in a dry run while its catalog effect stays write. Contract, CLI help, workflow-test descriptions and docs updated.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[High impact] The PR appears safe to merge; no new blocking issues were found. SummaryDry runs now block network writes from isolate code and record the requests they would send.
|
There was a problem hiding this comment.
All reported issues were addressed across 31 files
This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
An isolate result now waits for fetch-policy decisions still pending, so a write the code never awaited is recorded before the run reads its side effects. Remote-sandbox code of an allowed block stays listed unchecked instead of claiming a sent write. The egress test asserts the refusal itself, and the CLI and workflow-test guidance name the method-override exception.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
sideEffects.stubbedwith origin, path, query names, header names and a capped body, secrets masked (every env var value counts as a secret)unchecked; isolate code is no longer listed just for running--allow '<block>'sends themhttp_request(the API block) sends GET/HEAD/OPTIONS for real in a dry run through a newreadsWhenrule; its catalog effect stayswriteopenai_chat, …) count asreadin the catalog projections; a block that can call user-chosen tools (atool-inputsub-block) stayswrite, so Router/Evaluator read and Agent writesType of Change
Testing
dry-run.integration.ts(real Postgres/Redis, real isolate, loopback HTTP server): POST never arrives, lowercase/non-string methods, un-awaited fetch, allowed block, method-override GET, egress refusal, secret in path and body under a non-credential name, loop condition, API GET vs POST; each guard red-proofedtools/side-effects.test.ts, isolated-vm tests, catalog build tests, loop tests, sim-cli follow test; type-check; lint; generateChecklist
test-auditauthoring gate)