PricingGetting Started
Home/Answers/ai-agent-overwrote-company-spreadsheet-with-blanks
Production Disasters·0.07ms Verification

Why Did My AI Agent Overwrite Our Live Google Sheet with Blank Data?

Unchecked payload mutation: how partial API responses wipe live spreadsheets.

Direct 40-Word Answer

AI agents overwrite live spreadsheets with blank data when an external API returns an empty array during a sync or maintenance window. The agent assumes the empty array represents the current state of truth and updates the destination sheet with blanks. Exogram enforces differential write limits, halting wipes in 0.07ms.

What Actually Happened in the Real World

An operations bot synchronized Shopify orders to a central company Google Sheet every night. During Shopify API maintenance, the API returned `[]`. The bot interpreted this as zero active orders and executed a batch clear on the sheet, wiping out 6,000 historical order records.

Why Polite Prompts Like “Please Don't Do This” Fail

Prompts cannot check the mathematical delta between old and new state before firing a write action.

The Sub-Millisecond Code Fix

Exogram inspects write payloads against the existing record count. If a proposed write would delete or blank out more than 10% of existing rows, the action is halted and routed for human approval.

TYPESCRIPTExecution Boundary Gate (0.07ms)
import { ExogramWriteGuard } from '@exogram/sdk';
const guard = new ExogramWriteGuard({ maxDeleteThresholdPercent: 10 });

export async function syncSpreadsheet(newData: any[], existingCount: number) {
    // Halts execution if incoming payload reduces data volume by more than 10%
    guard.validateDelta({ incomingCount: newData.length, existingCount });
    return googleSheets.update(newData);
}

Frequently Asked Questions

Why did the AI not notice that 6,000 rows were disappearing?

The model has no concept of historical row value; it merely executes the function call it was configured to run on schedule.

Stop AI Mistakes Before They Execute

Exogram sits directly between your AI model and your tools. Set up in 10 seconds inside Claude, Cursor, ChatGPT, or your own code.