Repository navigation
improvement(tools): declare a read/write effect on every tool - #10401
Conversation
Every ToolConfig now declares `effect: 'read' | 'write'`. `read` means the tool changes nothing outside Sim, so a dry run may execute it; anything that creates, updates, deletes, sends, charges, triggers, persists, or depends on its params is `write`. It replaces `assistant.effect`, which Assistant's policy, binding, review, retry, and mothership payload now read from the tool. The label was seeded once across all 6,286 registered tools (3,555 read, 2,731 write): GET/HEAD read, PUT/PATCH/DELETE write, and POST and in-process operations from their documented semantics. Six GET tools that write after reading carry a `// tool-effect:` justification. check:tool-effects loads the registry and fails a tool without an effect, a static verb that contradicts its label without a justification, and a stale or unattributable justification. The label is public: generated tool metadata, the v2 tool and block catalogs (`sim blocks get`, `sim tools`), and the source block catalog (block `effect` and per-operation `operationEffects`, shown by `sim workflows source params`).
…ition `read` now means the call changes nothing outside Sim: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in an account; no credit-funded reveal; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including input-dependent effects. The definition is stated the same way in ToolEffect, the v2 catalog schema (and OpenAPI), the source catalog types, check:tool-effects, the skills, and CLAUDE.md, and no longer promises dry-run behaviour that has not shipped. 54 tools move from read to write: provider jobs and runs (Firecrawl, Bright Data, Exa, Parallel, You.com research, Harmonic, LogRocket, Coda and Slack List exports, CloudFormation drift, CloudTrail Lake queries, NetSuite async batch reads), media generation and transcription that persist in the provider account (video, image, Higgsfield, ElevenLabs TTS/STS/SFX/isolation/STT, AssemblyAI), parse runs kept by Extend, Reducto, and Pulse, Apollo people reveals, Wiza reveals, Icypeas records, ChatCBI conversations, Fivetran setup tests, Slack reader DMs, Reddit mark-read, RevenueCat get-or-create, and Upstash EXPIRE/INCR/INCRBY. The five GET tools carry `// tool-effect:`. check:tool-effects also flags a read tool whose function-valued method can return PUT, PATCH, or DELETE. Unregistered access ids (model providers) count as write in the source catalog too, matching the block detail.
…writes Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`. ToolEffect, the v2 catalog schema (and OpenAPI), check:tool-effects, the add-tools, add-integration, and validate-integration skills, and CLAUDE.md now state it that way. 37 contact reveals move to write: Prospeo, ZoomInfo, Findymail, LeadMagic, Datagma, Dropcontact, Enrow, and Hunter email/phone finders and person enrichment, Hunter domain search, Firecrawl enrich, and the Enrich, RB2B, Sixtyfour, People Data Labs, and PitchBook person contact lookups. The 14 GET tools among them carry `// tool-effect:`. crowdstrike_execute_rtr_command is write: the read-tier eventlog family includes export and backup subcommands that write files on the host, and a queue_offline session enqueues commands. mssql_query is write: its only guard is the lexical read-only screen, with no server-enforced read-only transaction. The screen now also rejects NEXT VALUE FOR, which advances a sequence from inside a single SELECT. oracledb_query is write too: its read-only transaction does not bind a function with an autonomous transaction or a package such as UTL_HTTP called from the SELECT.
…d drop a history phrase
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
[High impact] The PR appears safe to merge; no new blocking issue was found. SummaryAdds required read/write effects to tools and exposes them through catalogs and workflow references. Assistant policy and retry checks now use
Reviews (3) · Last reviewed commit: "docs(tools): scope the job rule to async..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 3000 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
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
…f unregistered tools count as write
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 3000 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Turn on auto-fix | Re-trigger cubic
…ronous read-only queries
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 3000 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Turn on auto-fix | Re-trigger cubic
Summary
Every tool now declares what calling it does outside Sim, as a required
effect: 'read' | 'write'field. This is the foundation for side-effect-free test runs (a follow-up PR) and is public catalog metadata.What the labels mean
read: the call changes nothing outside Sim. No create, update, delete, send, post, trigger, enqueue, consume or mark-read; no persistent job, run, conversation, history item or other resource left in an account; no credits spent to reveal a person's contact data; no external delivery. Usage billing for the call itself does not count.write: anything else, including effects that depend on the input, and anything uncertain.add-toolsskill under "Declaring the effect". TheToolEffectTSDoc and the public v2 description summarise it.How the labels were set
mssql_query,oracledb_query;NEXT VALUE FOR, which advances a sequence.Other changes
assistant.effectremoved: its consumers (Assistant credential replay, retry gating, tool policy and review) readtool.effect. Behaviour is unchanged for all 67 tools that set it.check:tool-effects:// tool-effect: <reason>annotation;sim tools,sim blocks get), per-operation block entries, the workflow-code catalog (a block-level effect plusoperationEffects), andsim workflows source params. An id that is not a registered tool, such as a model provider, counts as write.add-tools,add-integration,validate-integrationandadd-blockskills, CLAUDE.md and CONTRIBUTING require the field and point to the rule.Type of Change
Testing
scripts/check-tool-effects.test.ts: each audit guard was disabled in turn, and each turned its test red.tools/assistant-execution.test.ts: a read is replayed after a 401 and a write is not. It goes red without the gate.mothership/assistant/tool-policy.test.ts: asserts the sealed binding effect.lib/internal/mssql/query.test.ts:NEXT VALUE FORis rejected. It goes red on the old screen.bun run test:integration tool-permissions.integration.ts(72 passing): the Assistant policy migration on real Postgres and Redis.bun run generate,bun run lint,bun run type-check, rootbun run test,bun run check:audits(73 audits), docscontent:verify-compatibility,check-block-registry.ts origin/staging./simplifyand/cleanupwere run on the reviewable diff.Checklist
test-auditauthoring gate)