Skip to content

improvement(workflows): dry-run placeholders echo the writes they stand in for - #10404

Merged
waleedlatif1 merged 3 commits into
stagingfrom
improvement/dry-run-realistic-placeholders
Nov 25, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
improvement/dry-run-realistic-placeholders

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Dry-run placeholders now echo the writes they stand in for, and a partial-secret exposure in sideEffects redaction is closed.

Realistic placeholders

  • Problem: in a dry run (feat(workflows): side-effect-free dry runs #10402), a stubbed write was answered with a generic placeholder built from the tool's output schema. A workflow that wrote a table row and then read row.data.<field> saw null. In benchmark runs, agents reasonably took that for a bug in their own workflow: one spent an extra round, one ran live to prove its output, one restructured to avoid the read.
  • The hook: tools can declare an optional pure dryRunOutput(params) returning the outputs the request alone determines. It runs on the same masked params as sideEffects.request, and its result is redacted again.
  • How the placeholder is built: it follows the declared output schema. Fields with declared properties merge field by field, arrays with declared items merge item by item, and anything else is replaced whole. Undeclared keys are dropped. Tools without the hook keep the generic sample.
  • Covered tools:
    • table_insert_row, table_upsert_row, table_update_row and table_batch_insert_rows return real-shaped rows (id, data, position, timestamps). Ids are distinct per row, and update_row keeps its row id.
    • file_write echoes the name and UTF-8 size.
    • knowledge_create_document echoes the stored document name.
  • One redaction pass: each stubbed write's request and echo are redacted together, in a single PII call.

Redaction fix (affects sideEffects from #10402)

  • Partial-secret exposure: masking a short value inside a longer run secret left the rest of the secret unmatched by the resolved-secret registry, so part of it could appear in sideEffects.request. Masking now applies the registry projection first, then key and value masking.
  • Short values: values under the repo's 8-character non-identifying threshold (isNonIdentifyingSecretLiteral) are masked only in their own field. Before, a short value under a credential-like column name (e.g. reset_token) was replaced everywhere it appeared.
  • Password fields: these are now masked by field name, so short values stay hidden.

Type of Change

  • Improvement
  • Bug fix

Testing

  • dry-run.integration.ts (real Postgres), with literal expected values:
    • an upsert followed by a Function reading row.data gets the written values and the full row shape, with no row written;
    • insert, batch (distinct ids), update and file_write echoes;
    • the knowledge name echo;
    • a hook that throws falls back to the sample;
    • a short reset_token value no longer mangles other fields;
    • a column holding a prefix of the run secret is masked (red before the masking-order fix);
    • a short password-field value stays masked.
  • Every guard was reverted on its own and its test went red.
  • Gate: bun run generate, lint, type-check, root bun run test, check:audits, check:api-validation:strict, check:test-types, test:integration (dry-run suites, 34/34), docs content:verify-compatibility, check-block-registry.ts origin/staging.
  • Reviewed with /simplify (4 angles), /cleanup (comments, test-audit) and an adversarial correctness and secrets pass.

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)

…nd in for

A stubbed write was answered with a generic sample of the tool's outputs, so a
Function reading a dry-run table upsert's row.data.<field> got null and an
agent testing its workflow concluded its logic was wrong.

A tool may now declare a pure dryRunOutput(params) on its config: the outputs
the request alone determines. It receives the params with every secret masked
(as sideEffects.stubbed[].request is built), its result is redacted like that
request, and the sample of the declared outputs fills whatever it leaves out
(ids, nested fields, each array item from the sample's first). Tools without
it keep the sample.

Declared for table insert/upsert/update row (row.data echoes the written data;
update keeps the named row id) and batch insert (rows and insertedCount), file
write (requested name, text byte size), and knowledge create document (the
document name as stored). Filter updates and deletes are left out: their
outputs depend on stored state.
…a and redact once

A dry-run echo was merged into the sample by the sample's value shape, so a
table row declared as bare json came back with the generic sample keys
(name: 'Sample Object', status: 'active') beside its data, and every batch row
shared the id 'item_1'. The echo is now laid over the sample by the declared
schema: field by field where an output declares properties, item by item where
it declares array items, and whole anywhere else (an undeclared field is
dropped). The table hooks return the row as the routes emit it (data, and
placeholder id, position and timestamps, distinct per batch row) with no
ignored columns; update's row holds only the fields it patches. Knowledge
create echoes only the document name, and file write sizes its text with
utf8ByteLength.

Value-based masking replaced every occurrence of any string under a
secret-named field, however short, so a one-letter reset_token column turned
'a@b.co' into '[REDACTED]@b.co' in the request and in what downstream blocks
read; worse, a value masked inside a run secret left the rest of that secret
unmatched by the registry. Values shorter than the repo's identifying-literal
floor (isNonIdentifyingSecretLiteral) are now masked only by their field,
password fields are masked by name like credential-named ones, and the
registry projection runs before key and value masking.

A stubbed write's request and echo are redacted in one pass, one PII call per
write; when that pass cannot vouch for the pair, both are null.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 25, 2026 2:16pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no actionable findings.

Summary

Dry-run writes can now return request-derived values through dryRunOutput, including table data, file names and sizes, and document names.

  • Dry-run writes return values their requests already determine.
  • Dry-run side-effect records mask secrets without exposing partial matches.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Write not sent] --> B[Mask secrets in params]
  B --> C[Build request and echoed values]
  C --> D[Redact both together]
  D --> E[Merge echoed values into schema sample]
  E --> F[Return placeholder and record side effect]
Loading

Reviews (2) · Last reviewed commit: "docs(skills): describe the placeholder o..." · Reviewed by Greptile

@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 18 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread .agents/skills/add-tools/SKILL.md Resolved
Comment thread .agents/skills/add-tools/SKILL.md Resolved
Comment thread apps/sim/tools/table/update_row.ts 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.

No issues found across 18 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 579c7cc into staging Nov 25, 2026
87 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