Add to Claude

Guides · For agents

Dry run, receipt and undo: how Sift changes a file safely

Tools: sift_fix_dry_run, sift_fix_apply, sift_fix_undo, sift_check_landedWorks with Claude Code

Sift never edits your file. Every fix runs first as a dry run that changes nothing, then writes a new file with a receipt of every change, and undo rebuilds the original from that receipt, byte for byte. Here is each step, and what it checks.

The five steps

1. A rules fileNo rules file with a share-of-rows limit, no fix. Sift refuses and changes nothing.
2. Dry runSays how many rows would change, how many are flagged and why, the share of rows, and whether the limit would stop it. Writes nothing. Gives back a dryRunId.
3. ApplyNeeds that dryRunId when the rules say the first run is report only. Writes a fixed copy, a receipt and a changes-only file. Your file is never written to.
4. UndoRebuilds the original from the receipt and checks it against the original's fingerprint.
5. Landed checkAfter you import the changes, compares a fresh export with the receipt, record by record.

Ask your agent

With Sift connected (setup takes three steps), paste this and swap in your own paths.

Use Sift with /path/to/rules.companies.json on /path/to/crm_companies.csv. Dry run the phone fix and tell me what would change, what was flagged and whether the limit would stop it. Don't apply anything until I say yes. When I do, apply it with the dry run ID, give me the receipt ID and the changes file, then undo it and tell me whether the original came back byte for byte.

What happened on the test file

Dry run260 of 1,200 rows would change, 15 flagged, 21.7% of rows
Apply, no dry run IDStopped: the first run is report only
Apply, with the IDStopped: 21.7% is over the 20% limit
Limit raised to 25% for this jobApplied: 1,200 rows in, 1,200 out, 260 changed
Changes-only file260 rows, one per change
Landed check, fixed copy260 of 260 landed
Landed check, original0 landed, 260 still show the old value
Undo260 rows restored, matches the original byte for byte

The 20% stop is on purpose: the sample rules are strict, so you see Sift refuse before you see it run. The receipt records that the limit was raised for this job. The rules file is not changed.

What each guardrail checks

What the receipt holds

The input and the outputPath, row count and SHA-256 fingerprint of each
The fixWhich fix, which column, any settings, rows changed and flagged
The limitThe share changed, the limit used, and whether it was raised for this job
Guardrails passedNo rows deleted, only the fixed column changed, input not overwritten, dry run ID matched
Every changeRow number, record ID, old value, new value

The changes-only file is the short version for your CRM: record_id, field, old, new, row. Import it with your CRM's update import, matched on the record ID, then run the landed check on a fresh export.

Masked receipts

The receipt holds real values, so treat it like the data. With SIFT_MASK_RECEIPTS=1 in Sift's settings, or maskReceipt on one fix, it keeps record IDs and row numbers but swaps each old and new value for a salted hash. The changes file leaves the old values out. On the test file the landed check still found all 260 changes. Undo refuses instead, and names your original file and its fingerprint, so keep that file until you are done. A hash is not encryption: anyone who already knows a value can test for it.

Questions

Can my agent skip the dry run?
Not when the rules file says the first run is report only, as the sample rules do. Apply then needs the dryRunId from a dry run of that exact file, and stops without it.
What if someone edited the fixed file afterwards?
Undo checks the fixed file's fingerprint first. If it changed, undo stops and writes nothing. Your original file was never touched, so it is still there.
Does the receipt hold customer data?
Yes, every old and new value, unless you mask it. It sits next to your file or in the folder you set, on your machine. siftdata clean deletes Sift's files when the job is done.

Every fix works this way, from phone numbers to prices. The full list is in the docs.

More guides

Guide Fix phone numbers with a receipt and an undo Guide Change prices across a list, with a dry run and an undo Guide Write a rules file for your CRM