DevelopmentFramework16 min readPublished August 27, 2026

Which copy your agent reads is a correctness decision · the staleness budget belongs to the question, not the system

Your AI Agent Is Reading a Stale Copy of Your Data

Every AI agent answers from some copy of your data — the system of record, a mirror, a cache, or a derived view. Which copy it reads is a correctness decision, not a performance one. This framework sets a staleness budget per question, and shows how to catch the mirror that quietly stopped syncing.

DA
Digital Applied Team
Senior strategists · Published Aug 27, 2026
PublishedAugust 27, 2026
Read time16 min
Sources9 linked sources
Replica reads right after a write
0.1–0.5%
hit a missing row, per incident.io
Cosmos DB staleness floor
300s
multi-region minimum bound
vs 5s single-region
Eventually consistent reads
1/2
the cost of strongly consistent, per AWS
Postgres replication lag columns
3
write · flush · replay

An AI agent reading stale data is the quietest way to ship wrong answers. The agent doesn’t crash, the query doesn’t error, and the number it returns looks exactly like a correct one — because three hours ago, it was. Every agent answers from some copy of your data, and a stack can hold several: the system of record, a replicated mirror, a cache, a derived rollup. Which copy the agent reads decides whether its answer can be trusted at all.

That decision is easy to make by accident. A mirror exists because someone needed read scaling; the agent’s tool gets pointed at it because that’s the connection string lying around; nobody writes down what lag the questions flowing through that tool can actually tolerate. It works until the one afternoon the sync worker stops applying changes — and the mirror keeps answering, confidently and wrong, because serving stale rows looks identical to serving fresh ones.

This guide is the read-side framework: the vocabulary for the four copies your data lives in, a staleness budget you set per question rather than per system, a classification matrix for which questions a mirror may answer, the replication mechanics that determine how far behind a mirror really is, and the reconciliation habits that catch a silent sync failure before a human acts on its output. It assumes your data is already correct — the data-quality problem is its own trap — and asks the narrower question: which copy of that correct data is current enough for this question, right now?

Key takeaways
  1. 01
    The read path is a correctness decision.Mirror versus system of record is usually framed as a performance choice. For an agent it decides whether the answer is true — a stale read returns a value that was correct and no longer is, with no error to catch.
  2. 02
    The staleness budget belongs to the question.Vendors configure consistency per table or per account. An agent should decide per question: an aggregate trend tolerates hours, a value that authorizes a write tolerates nothing. Classify the question before choosing the connection.
  3. 03
    Freshness is already priced.DynamoDB documents eventually consistent reads at half the cost of strongly consistent ones, and Cosmos DB sells staleness bounds as a configurable K-versions-or-T-seconds setting. Staleness tolerance is a metered commodity, not a philosophical stance.
  4. 04
    Mirrors fail silently, then unrecoverably.A Postgres subscription that stops applying changes still exists as an object, and a CDC connector that falls behind WAL retention cannot resume at all — Debezium's docs require a fresh consistent snapshot at that point.
  5. 05
    Make the agent show which copy it read.Provenance plus a reconciliation check — periodically re-deriving sentinel values from the system of record — is what catches the first silently wrong answer instead of the hundredth.

01The StakesThe read path is a correctness decision.

When engineers argue about read replicas, they argue about load, latency, and isolation. Those are performance arguments, and for dashboards they are the right ones. An agent changes the frame: it reads a value and then acts — it quotes the number to a customer, drafts the email, fills the form, calls the write API. A stale read stops being a display inconvenience and becomes an input to a decision.

The failure is well documented, and recent. On July 21, 2026, the engineering team at incident.io published a detailed account of what happened when they moved background workers to read from a Postgres read replica: workers began hitting intermittent not-found errors — on roughly 0.1 to 0.5 percent of reads that immediately followed a write — when they looked up a row right after a queue message announced that row’s creation. Their write-up traces the root cause to a race: the gap between publishing a message to the queue and a worker picking it up could be shorter than the replication lag to the replica. The row existed on the primary and had already been announced downstream; the copy being queried simply hadn’t received it yet.

Notice what kind of failure that is. Nothing was down. No data was lost. Every system behaved exactly as documented. The answer was wrong anyway, because the question — does this row exist? — was asked of a copy whose lag exceeded the question’s tolerance, which for that question was zero. That is the entire subject of this post, generalized: for every question an agent answers, some copy is fresh enough and some copy is not, and nothing in the infrastructure will tell you which is which unless you decide it deliberately.

Scope of this framework
This is a read-side framework. Delivery guarantees — whether the change event arrives at all, and what happens when it arrives twice — are a separate engineering problem covered in our webhook reliability and idempotency reference. Here we assume changes do eventually propagate, and ask only: which copy is current enough for the question in hand?

02VocabularyFour copies of the truth, one place it lives.

The term system of record has a formal pedigree. NIST’s glossary, drawing on its identity-guideline series, defines it as “A collection of records that contain information about individuals and are under the control of an agency. The records can be retrieved by the individual’s name, an identifying number, a symbol, or other identifier.” That definition is deliberately narrow — it describes identity records held by a federal agency, not enterprise data generally — so cite it for the term’s provenance, not as the working definition.

The working definition comes from practitioner and master-data-management literature, where it recurs near-verbatim across vendors: a system of record is the authoritative source within an organization for a given data element. Authoritative sources are plural across an organization — one per data domain. The CRM is the system of record for lead status; the billing system is the system of record for invoiced amounts. A fact is born and changed in its system of record, and a write anywhere else must eventually reconcile back to it.

Two neighboring terms are worth separating, because conflating them is exactly the failure this post argues against. A golden record, in MDM vocabulary as documented by Informatica and Profisee, is a derived, reconciled artifact — the consolidated best version of an entity built from systems of record by an MDM process. It is not itself a system of record. And a single source of truth is an organizational practice — managing a given fact in one place — not a specific store. Mirrors, caches, and golden records all sit downstream of a system of record, and they solve different problems.

Authoritative
System of record
facts are created + updated here

The store where a fact is born and changed. One per data domain, plural across the organization. Every other copy is judged by its distance from this one.

Writes reconcile to it
Replicated
Mirror / replica
synced via replication or CDC

A copy kept in sync for read scaling or isolation, updated by a replication pipeline rather than by direct writes. Its lag is the pipeline's propagation delay — real, measurable, and invisible until you measure it.

Lag: measured, never assumed
Invalidated
Cache
TTL or explicit purge

A copy kept for latency, refreshed on a timer or an explicit signal rather than a continuous stream. A different mechanism from replication lag, with a different failure profile — and a different post's subject.

Application-managed
Computed
Derived view
aggregates, rollups, reports

A count, rollup, or joined report built from the copies above. Its staleness compounds whatever lag its inputs carry, plus the materialization delay of the job that builds it.

Staleness compounds

A stack that runs agents against operational data can hold all four copies at once, and a sync pipeline built to get CRM data somewhere queryable is one way it happens. If you’re building that pipeline, our sync-agent tutorial walks through the build; this post owns the question that starts the day the sync goes live and never goes away: which of these copies should each of the agent’s questions be answered from?

03The Core IdeaThe staleness budget belongs to the question.

Distributed-systems vendors have spent a decade building precise machinery for bounded staleness — and then attaching it to the wrong unit. Azure Cosmos DB’s consistency documentation defines the construct cleanly: “In bounded staleness consistency, the lag of data between any two regions is always less than a specified amount. The amount can be 'K' versions (that is, 'updates') of an item or by 'T' time intervals, whichever is reached first.” That is a staleness budget as a first-class, configurable number — and Microsoft publishes its floors: “For a single-region account, the minimum value of K and T is 10 write operations or 5 seconds. For multi-region accounts, the minimum value of K and T is 100,000 write operations or 300 seconds.”

DynamoDB draws the same line per read instead of per account. Eventually consistent reads are the default, and AWS’s documentation is plain that with them “the responses might not reflect the results of a recently completed write operation”; setting ConsistentRead to true instead returns “the most up-to-date data, reflecting the updates from all prior write operations that were successful.” Cross-region, DynamoDB Global Tables under the default mode replicate item changes “typically within a second” — a typical figure the docs hedge themselves, not a guarantee.

And freshness is priced. Per AWS’s own framing, eventually consistent reads are half the cost of strongly consistent reads. Read that as an economic signal: the industry already treats staleness tolerance as a metered commodity you buy more or less of. The interesting pattern beneath the pricing is where the choice is attached. Cosmos DB pins it to an account-level default; DynamoDB exposes it per read. Neither can know what the read is for.

DynamoDB
the price of not waiting
1/2

Eventually consistent reads cost half of strongly consistent ones per AWS's documentation. Freshness is literally a line item — some questions are worth paying it for, some are not.

AWS docs
Cosmos DB floor
single-region minimum bound
5s

The tightest configurable staleness bound: 10 write operations or 5 seconds. For multi-region accounts the floor rises to 100,000 writes or 300 seconds — the budget is topology-dependent.

Microsoft Learn
Global Tables
cross-region, typically
~1s

AWS says item changes replicate 'typically within a second' under the default multi-region mode. The hedge word is the vendor's own — treat it as a typical figure, never an SLA.

Not a guarantee

Here is the reframe this post exists for: an agent sits at the one layer of the stack that does know what the read is for. It parsed the question. It knows whether it’s about to summarize a quarter or authorize a refund. So the staleness budget should not be a property of the connection the agent happens to hold — it should be decided per question, in the agent’s tool layer, the way DynamoDB lets a caller decide per read. The same vendor machinery, pointed at the right unit.

One boundary to draw before the matrix: read-your-writes consistency — a client being guaranteed to see its own prior writes — is a per-client session property, not a property of the mirror. (The definition here is synthesized from common usage across the distributed-systems literature rather than any single vendor’s wording.) Cosmos DB’s session level names the guarantee explicitly: “In session consistency, within a single client session, reads are guaranteed to honor the read-your-writes, and write-follows-reads guarantees.” An agent that just wrote a row and needs to see it has a session problem. An agent answering questions about data other actors write has a mirror problem. This post is about the second.

"Bounded Staleness in a multi-write account is an anti-pattern. This level would require a dependency on replication lag between regions, which shouldn't matter if data is read from the same region it was written to."— Microsoft Learn, Azure Cosmos DB consistency-levels documentation

Even the vendor selling the staleness bound names the boundary condition where it stops making sense. That is the discipline to copy: a staleness budget is only meaningful when you can say which questions it covers and which it never may.

04The FrameworkThe Staleness Budget Matrix.

The matrix below classifies the question classes that recur in agent workloads. It is our synthesis — no vendor publishes this mapping — but its anchors are vendor-documented. On the mirror-safe end, Microsoft’s Cosmos DB docs give the canonical worked example: “Eventual consistency is ideal where the application doesn’t require any ordering guarantees. Examples include count of Retweets, Likes, or nonthreaded comments.” On the other end sits DynamoDB’s ConsistentRead — the read you pay double for because the caller is about to act on the answer. The budget values are starting points to tighten against your own operations, not universal constants.

The Staleness Budget Matrix: six recurring agent question classes mapped against whether a mirror may serve them, a starting staleness budget, and the mechanical reason.
Question classServe from a mirror?Staleness budget (starting point)Why
Aggregate / trend countYesMinutes to hoursThe direction of a trend survives a lagging input; no single row decides anything. The vendor-endorsed home of eventual consistency.
Historical report on a closed periodYesEffectively unboundedA closed period stops changing; once the mirror has converged past the period’s end, its copy of those rows is as good as the source’s.
Current status shown to a humanConditionalSeconds — and label the readThe human acts on it now. Either read the source, or serve the mirror with an explicit as-of timestamp so the human can judge.
Value used to authorize a writeNoZero — read the system of recordA write gated on a stale read re-injects the past into the present. This is the read that must never come from a copy.
Denominator in a rate or percentageConditionalMatch the numerator’s windowA denominator that moves mid-read invalidates the snapshot the rate was computed from. Numerator and denominator must come from the same copy at the same as-of point.
Value quoted to a customer right nowNoZero — read the system of recordThe customer hears a commitment, not an estimate. A mirror cannot make commitments on the source’s behalf.

Two rows deserve emphasis. The write-authorization row is absolute because it is where staleness turns into damage: an agent that reads an account balance, a stock level, or an approval status from a mirror and then acts on it is making a decision on data the source may have already contradicted. And the denominator row is the subtle one — an agent that fetches a numerator from the source and a denominator from a lagging mirror produces a rate no copy of the system ever contained. Mixed-copy arithmetic is stale data’s least visible form.

05The MechanicsHow mirrors actually fall behind.

To enforce a budget you have to measure lag. Postgres logical replication streams committed row-level changes from publisher to subscriber via the write-ahead log, and its pg_stat_replication view then exposes lag as three separate named columns — write_lag, flush_lag, and replay_lag — each a time interval measuring a different stage of propagation. The last one is defined as “Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it.”

Our reading of those three definitions — an inference from the docs, not a claim they state — is that replay_lag is the only one a read path should care about. Write and flush lag describe durability on the standby; only once WAL is applied can a query against the standby actually see the change. A replica can be fully caught up on receipt and still behind on visibility.

Downstream of the database, the open-source CDC tool Debezium rides the same machinery: its Postgres connector uses logical decoding through a replication slot, takes an initial consistent snapshot, then “continuously captures row-level changes that insert, update, and delete database content and that were committed to a PostgreSQL database,” streaming change events onward. It tracks its position in the WAL per event, which is what makes restarts safe — the connector resumes from its last recorded position.

The recoverability cliff
Postgres purges WAL segments after a retention period. A connector that falls behind the purge horizon cannot resume — Debezium’s documentation states the connector no longer has the complete history of changes at that point, and a fresh consistent snapshot is required. A lagging mirror is a degraded mirror; a mirror past WAL retention is an unrecoverable one wearing the same connection string.

Each replication ecosystem names lag differently, measures it in different units, and breaks differently when the number is ignored. The cross-reference below puts the four vocabularies this post has touched side by side — a comparison none of the four vendors’ docs draw themselves.

CDC lag vocabulary cross-reference: how PostgreSQL, Debezium, DynamoDB, and Azure Cosmos DB each name and measure replication lag, and what breaks when each measure is ignored.
SystemWhat “lag” means thereUnitWhat breaks if you ignore it
PostgreSQL logical replicationThree staged columns on pg_stat_replication: write, flush, and replay lag — receipt, durability, and visibility measured separately.Time (interval)Reading a standby before WAL is applied returns a view missing rows that are already durably received — caught up on paper, behind in practice.
Debezium (CDC connector)Position in the WAL, recorded per change event; restart resumes from the last recorded position.Log position (byte offset)Fall behind WAL retention and resuming is impossible — the docs require a fresh consistent snapshot, a full resync.
DynamoDB Global TablesCross-region propagation under the default mode, documented as “typically within a second”; per-read choice of eventually or strongly consistent.Time (typical, not guaranteed)An eventually consistent read may not reflect a recently completed write — the vendor says so plainly, at half price.
Azure Cosmos DBBounded staleness: lag held under K versions or T seconds, whichever is reached first; a PBS metric reports how eventual the eventual level runs in practice.Versions or time, whichever firstConfigure the bound for the wrong topology and it becomes what Microsoft itself calls an anti-pattern in multi-write accounts.

The Cosmos DB row carries one more idea worth stealing: Probabilistically Bounded Staleness, a metric Microsoft describes as showing how eventual your eventual consistency is — how often reads come back fresher than the configured level. The academic lineage (Bailis et al., VLDB 2012) matters less than the framing: staleness is a probability distribution, not a single number. A mirror whose lag is usually small and occasionally large has an average that flatters it and a tail that defines the risk.

06Failure ModesThree failure modes that keep answering.

Mechanically there are three distinct failures, each with a different primary-source anchor and a different detection strategy — and all three share the property that makes them dangerous under an agent: the system keeps answering throughout.

Failure 01
Silent stop
the sync halts, the answers continue

A Postgres subscription whose apply worker has crashed shows zero rows in pg_stat_subscription — but the subscription object still exists and the replica still serves queries. Existence checks pass while the copy quietly freezes. You must verify the apply process exists and its position advances.

pg_stat_subscription
Failure 02
Correct and stale at once
announced downstream, invisible upstream

A change can be published to consumers before it is readable at the destination. Debezium documents this hazard in its own connector; incident.io hit the same shape in production when queue delivery outran replication. Nothing is wrong — and the read still fails.

Read-after-write hazard
Failure 03
The number nobody can re-derive
derived views compound their inputs' lag

A rollup computed from a mirror inherits at minimum the mirror's replay lag, plus the aggregation job's own delay. When an agent reports that number without provenance, no one can say which copy, as of when, produced it — so no one can check it.

Compounded staleness

Failure 02 deserves its primary source verbatim, because a CDC vendor documenting the hazard in its own tool is rarer than it should be. From Debezium’s Postgres connector documentation:

Debezium, in its own docs
“Because logical decoding replication slots publish changes during commit — and not post commit — undesirable side-effects can occur... publishing changes that cannot be read (i.e., read-after-write consistency) temporarily because they are being replicated. For example, a DebeziumEngine consumer receives a notification of a row that was created but it cannot be read by a transaction.”

The incident.io write-up adds the operational lesson on detection. Their engineers argue against alerting on raw time-based replication lag, pointing out that a replica can clear several minutes of accumulated delay in seconds once write volume drops — the same wall-clock lag means different things at different write rates, so they prefer measuring lag by log position (bytes of WAL outstanding) rather than by a wall-clock delta alone. Translated to the agent context: a freshness check that asks how old is this copy is weaker than one that asks how much change has this copy not yet applied.

07The PlaybookDesigning the agent’s read path.

Everything above compresses into four working rules for the tool layer — the place where the agent’s question meets a connection string.

Aggregates & trends
Dashboards, rollups, trend counts

The vendor-endorsed home of eventual consistency — the question survives lag by construction. Serve from the mirror, stamp the answer with its as-of time, and spend your freshness budget elsewhere.

Read the mirror
Human acts now
Status a person will act on

Route to the source when it's cheap; when it isn't, serve the mirror with an explicit as-of label so the human can judge the answer's age. An unlabeled stale status is the one that gets acted on.

Source — or label the read
Gating a write
Values that authorize a mutation

Zero budget, no exceptions, no economizing. This is the read equivalent of a foreign-key constraint: the check is only meaningful against the copy that the write itself will land in.

System of record only
Unclassified
Question class unknown

A question the router can't classify defaults to the system of record, and the miss gets logged. The classification table grows from its own gaps — the default just has to fail safe while it does.

Default to the source

Then make the pipeline prove itself, continuously. The reconciliation check is deliberately boring: pick a handful of sentinel values — row counts per recent day, the latest updated-at timestamp per synced table, one or two business totals — and re-derive them from the system of record on a schedule, comparing against the mirror’s answers. Alert on divergence, and alert on the apply worker itself: for Postgres logical replication that means checking via the subscription-monitoring view that the subscription’s worker exists and its position advances, not merely that the subscription object is present. A mirror that stops syncing fails every one of these checks within one cycle — which converts the silent failure mode into a paged one.

Provenance closes the loop. An agent’s answer should carry which copy it read and as of when, both to the human reading it and to the log line behind it — an audit trail that omits the read path cannot support the reconciliation this section describes, a design concern our agent audit-trail guide treats in full. The write side of this same boundary — what may change a value, and in which direction — is its own discipline, covered in our workflow state-guardrails pattern. And the read/write boundary has a rollout dimension too: our read-only-first rollout guide covers when a new system earns the right to write at all. Note, finally, that which copy an agent reads and which rows it may see are different controls — permissions scope the rows; the read path scopes their age.

If your agents answer from CRM or operational data today and nobody can say which copy each tool reads, that inventory is a one-afternoon exercise with outsized return — it’s where our CRM automation engagements usually begin, because the read-path map is the same artifact the sync monitoring hangs off.

08ConclusionA budget per question, not per system.

The read-side discipline

The question owns the freshness requirement. The system just serves it.

The machinery in this post is not new — Postgres names its lag in three columns, Debezium documents its own read-after-write hazard, DynamoDB prices freshness per read, Cosmos DB sells a staleness bound with published floors. What agent stacks are missing is the unit conversion: every one of those mechanisms attaches the freshness decision to infrastructure, while the agent is the first component in the stack that actually knows the question. Move the budget to where the knowledge is.

Our expectation — a projection, not a sourced claim — is that agent frameworks will grow an explicit consistency choice per tool call, the way DynamoDB exposes one per read, and that read-path provenance will become a standard field in agent audit logs. Teams that classify their questions now will find that shift a formality; teams that let the connection string decide will keep discovering their mirrors’ lag from the one answer that mattered.

Until then the discipline is small enough to start this week: name the system of record per domain, classify the questions your agents actually receive, give each class a budget, route the zero-budget reads to the source, and reconcile sentinels on a schedule. A mirror that quietly stops syncing will keep answering either way. The difference is whether anything is listening for the moment its answers stop being true.

Audit your agent's read paths

An agent is only as truthful as the copy it reads.

Our team maps which copy every agent tool reads, sets staleness budgets per question class, and wires the reconciliation checks that catch a silent sync failure — delivered in days, not quarters.

Free consultationExpert guidanceTailored solutions
What we work on

Agent data-architecture engagements

  • Read-path inventory — which copy each agent tool reads
  • Staleness-budget classification for your question classes
  • Sync monitoring — lag, apply-worker health, sentinels
  • Reconciliation checks against the system of record
  • Provenance & audit-trail design for agent answers
FAQ · Agent read paths

The questions this decision raises.

In the practitioner and master-data-management sense used throughout this guide, a system of record is the authoritative source within an organization for a given data element — the store where that fact is created and updated. Authoritative sources are plural across an organization, one per data domain: the CRM for lead status, the billing system for invoiced amounts. A golden record is a different artifact: the consolidated, validated best version of an entity that an MDM process derives from multiple systems — built from systems of record, not itself one. NIST's glossary also defines the term formally, but in a narrower federal-identity context (records about individuals under an agency's control), so it is best cited for the term's provenance rather than as the general enterprise definition.
Related dispatches

Continue exploring agent architecture.