Skip to content

improvement(tools): declare a read/write effect on every tool - #10401

Merged
waleedlatif1 merged 7 commits into
stagingfrom
improvement/tool-effect-labels
Nov 25, 2026
Merged

waleedlatif1 merged 7 commits into
stagingfrom
improvement/tool-effect-labels

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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.
  • The full rule lives in the add-tools skill under "Declaring the effect". The ToolEffect TSDoc and the public v2 description summarise it.

How the labels were set

  • Seeding: all 6,286 tools are labelled: 3,461 read and 2,825 write. HTTP methods seeded the labels (GET/HEAD → read; PUT/PATCH/DELETE → write). POST, in-process and dynamic-method tools were reviewed one by one.
  • Verification: two adversarial passes moved 94 tools to write. The first checked every read-labelled tool, sliced alphabetically. The second sliced by risky verb. The relabelled tools fall into these groups:
    • persistent provider jobs and runs: Firecrawl crawl/batch/extract/agent, Bright Data datasets, video generation, AssemblyAI transcripts, Exa agent, deep-research tools;
    • saved history items: ElevenLabs, ChatCBI conversations;
    • mutating GET endpoints: Upstash INCR/INCRBY/EXPIRE, RevenueCat get-or-create, Reddit mark-read;
    • Slack's message reader, which opens a DM;
    • contact reveals paid with credits: Apollo people, Prospeo, Findymail, LeadMagic, Datagma, Enrow, Hunter, PDL, Enrich, RB2B, Sixtyfour, PitchBook;
    • SQL tools without a read-only guarantee enforced on the server: mssql_query, oracledb_query;
    • CrowdStrike RTR.
  • mssql guard: the read-only screen now also rejects NEXT VALUE FOR, which advances a sequence.

Other changes

  • assistant.effect removed: its consumers (Assistant credential replay, retry gating, tool policy and review) read tool.effect. Behaviour is unchanged for all 67 tools that set it.
  • New audit, check:tool-effects:
    • fails when a GET/HEAD tool is labelled write, or a PUT/PATCH/DELETE tool is labelled read, without a // tool-effect: <reason> annotation;
    • fails when a read tool's function-valued method can return a write verb;
    • fails on a stale or unattributable annotation;
    • type-check enforces that every tool declares an effect.
  • Exposure: the effect appears in the generated tool metadata, the v2 tool summary and detail (sim tools, sim blocks get), per-operation block entries, the workflow-code catalog (a block-level effect plus operationEffects), and sim workflows source params. An id that is not a registered tool, such as a model provider, counts as write.
  • Skills and docs: the add-tools, add-integration, validate-integration and add-block skills, CLAUDE.md and CONTRIBUTING require the field and point to the rule.

Type of Change

  • Improvement

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 FOR is 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.
  • Gate: bun run generate, bun run lint, bun run type-check, root bun run test, bun run check:audits (73 audits), docs content:verify-compatibility, check-block-registry.ts origin/staging.
  • /simplify and /cleanup were run on the reviewable diff.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

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.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 25, 2026 8:54am UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no new blocking issue was found.

Summary

Adds required read/write effects to tools and exposes them through catalogs and workflow references. Assistant policy and retry checks now use tool.effect.

  • Every tool declares whether it reads or writes outside Sim.
  • Assistant policies and retry decisions use each tool’s shared effect.
  • Tool and workflow catalogs show whether calls read or write.
  • The MSSQL read-only screen rejects sequence-advancing queries.

Reviews (3) · Last reviewed commit: "docs(tools): scope the job rule to async..." · Reviewed by Greptile

Comment thread apps/sim/tools/cloudwatch/query_logs.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot 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.

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

Comment thread .agents/skills/add-tools/SKILL.md Resolved
Comment thread .agents/skills/add-integration/SKILL.md Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

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

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

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

@waleedlatif1
waleedlatif1 merged commit bfba9db into staging Nov 25, 2026
88 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/tool-effect-labels branch November 25, 2026 09:12

This branch was successfully deployed

1 active deployment
Preview — 2f63fb41 Deployed Nov 25, 2026 by vercel[bot]
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