AI & automation

Verifying automation output with dry runs

Prevent database errors by running dry runs, generating change manifests, and comparing two independent runs before granting write access.

To prevent automation from making incorrect changes to your database, decouple plan generation from execution. Configure your script to output a detailed dry run manifest listing intended changes without writing to the database. Run the simulation twice, compare the output of the second run against the first, and grant live write access only when both manifests match.

Designing Read Only Simulation Modes

Structure your script to accept a simulation flag that forces read-only operations. Instead of executing direct updates or using function calling parameters to mutate records, the script queries target rows, processes business rules, and outputs a manifest file formatted as structured text. This file must document the target record primary key, original attribute state, and proposed new value Google Cloud function calling.

Restricting the script service account to read-only database permissions provides an absolute operational boundary. If a logic error or dynamic process attempts an unapproved write, the database engine rejects the command. This isolation forces the automation to output its full action plan as an intermediate artifact, ensuring no state changes occur during the planning phase.

Comparing Manifests across Dual Simulation Runs

Verify script deterministic behavior by executing a second dry run immediately following the first. A stable automation workflow processes identical input data to produce identical change manifests. Your verification pipeline must run an automated diff utility between the first manifest and the second manifest Google Cloud agentic workflows.

Consider an operational task updating customer billing tiers. Input dataset: 100 customer records in CSV format. Run 1 generates manifest-a.json listing 12 account updates from Tier A to Tier B. Run 2 runs against the same database state and generates manifest-b.json listing 12 identical account updates. Output diff result: 0 file differences. The manifest pair is verified, proving that the calculation logic is deterministic across independent executions.

Diagnosing Non Deterministic Simulation Failures

If the diff utility detects discrepancies between the first and second manifest, the automation has failed verification and must not receive write access. Non-deterministic output typically occurs when a script relies on un-ordered queries, system timestamps, or dynamic external API responses that change between runs Google Cloud robotic process automation.

If manifest-a.json flags 12 records for update, but manifest-b.json flags 14 records because a background system modified a timestamp between runs, the diff check fails. Diagnosing this failure requires checking database ordering parameters and forcing explicit sorting on all SELECT queries. Never grant live write access to a script that produces diverging change manifests from identical starting parameters.

Enforcing Gated Execution and Human Sign Off

Pass live write access to the script only after the dual-run manifest diff returns zero discrepancies. Connect the verification pipeline to an authorization gateway where a human operator reviews the verified manifest summary. The reviewer checks the total change counts against expected operational thresholds before approving live execution.

Upon human sign-off, the deployment platform provisions temporary write credentials or toggles the script execution flag. The script reads the verified manifest file directly to execute the exact changes listed, rather than re-calculating values on live data. Confirm successful application by running a final post-execution read query to verify that target record count updates match the manifest total precisely.