cd /news/ai-agents/stale-approvals-re-check-the-draft-b… · home › topics › ai-agents › article
[ARTICLE · art-157219] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Stale Approvals: Re-Check the Draft Before You Execute It

A developer outlined a fingerprinting technique for preventing "stale approvals" in AI workflows, where a human approves an AI-drafted action that becomes invalid before execution. The approach hashes the action together with its context—such as the latest message ID, order status and amount—at approval time, then recomputes the fingerprint before execution and routes the action back to the reviewer if anything has changed. The code also uses the action ID as an idempotency key to avoid duplicate execution.

by read1 min views1 publishedOct 25, 2026

A reviewer approves an AI-drafted refund at 4 pm. The workflow executes it at 4:05. Between those times, the customer wrote "never mind, found it." Who is right? This is the stale approval problem, and it shows up in almost every human-in-the-loop approval step in an AI workflow once volume grows.

Approve a specific snapshot, not "the refund for customer X."

import hashlib, json

def fingerprint(action, context):
    payload = {"action": action, "last_msg_id": context["last_msg_id"],
               "order_status": context["order_status"], "amount": action.get("amount")}
    return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest()

def request_approval(store, action, context):
    fp = fingerprint(action, context)
    store.save(action_id=action["id"], fingerprint=fp, status="pending")
    return fp
python
def execute_if_still_valid(store, action, load_context, run):
    record = store.get(action["id"])
    if record.status != "approved":
        return "not_approved"
    if fingerprint(action, load_context(action)) != record.fingerprint:
        store.update(action["id"], status="needs_review")
        return "stale_back_to_reviewer"
    run(action, idempotency_key=action["id"])
    store.update(action["id"], status="done")
    return "done"

We write about scoping these decisions in our guide to auditing a workflow first.

── more in #ai-agents 4 stories · sorted by recency
── more on @nxflowai.com 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/stale-approvals-re-c…] indexed:0 read:1min 2026-10-25 · —