Freshness Contracts for AI Agent Observations
An AI agent can make a perfectly valid decision from an observation that is no longer true.
That failure is easy to miss. The tool call succeeded. The JSON parsed. The policy check passed. The plan still matches its schema. Yet between reading the world and changing it, the world moved.
This is not primarily a reasoning failure. It is a concurrency failure.
I think agent runtimes need a freshness contract: an explicit boundary that states which observation authorizes a decision, how old that observation may become, and what must happen when its validity cannot be proved.
Availability is not freshness
A result in context has three different identities:
- content identity — what bytes or normalized value were returned;
- resource identity — which object, query, branch, account, or environment was observed;
- version identity — which state of that resource produced the result.
Most agent traces preserve the first. Some preserve the second. Very few make the third a precondition for execution.
Consider an agent that reads a deployment, decides that three replicas are safe, waits for approval, and then submits a patch. A timestamp alone cannot tell the runtime whether another controller changed the deployment during that pause. “Observed 40 seconds ago” is weaker than “observed at resource version 10245, and the write is conditional on that version.”
HTTP caching already separates freshness from mere storage. RFC 9111 defines freshness lifetime, current age, validation, and stale responses as explicit protocol concepts. Kubernetes uses resourceVersion to identify object state and rejects stale conditional updates with 409 Conflict. Agent infrastructure should learn the same lesson: a stored observation is evidence, not current authority.
The observation lease
A useful runtime artifact can be small:
{
"observation_id": "obs_7f2a",
"resource": "deployments/prod/api",
"version": "10245",
"observed_at": "2026-07-18T08:20:11Z",
"freshness": {
"max_age_seconds": 30,
"revalidate": "conditional-read",
"on_unknown": "deny"
},
"supports": ["patch_31.replicas", "approval_88"]
}
I call this an observation lease. It does not claim that reality remains frozen for 30 seconds. It states a narrower contract: the runtime may use this observation for the named decisions until the lease expires, unless a stronger version precondition is available.
The distinction matters. A lease is not a cache TTL. Cache policy answers whether a representation may be reused. An observation lease answers whether a decision may still rely on it. A status page might tolerate a five-minute cached value; a destructive action against the same resource might require an exact version match.
Freshness belongs to claims, not whole runs
One global timeout is too crude. Different claims decay at different speeds.
| Observation | Decision it supports | Appropriate boundary |
|---|---|---|
| Repository commit | Generate review comments | Exact commit SHA |
| File contents | Apply a patch | File digest or base revision |
| Kubernetes object | Mutate the object | resourceVersion precondition |
| Account balance | Approve a payment | Short age plus server-side recheck |
| Documentation page | Explain an API | Retrieval date and source URL |
This produces an important runtime rule:
Revalidate the smallest observation that carries the decision, not the entire context.
That rule keeps verification bounded. If a code agent has inspected 200 files but changes one function, the final write should not require replaying every read. It should bind the patch to the base revision and the relevant file identity. This complements the change-set identity model and the idea of load-bearing assumptions: assumptions identify what can invalidate a plan; freshness contracts make one common invalidator mechanically enforceable.
Four deterministic outcomes
When a lease is checked, the runtime should produce one of four outcomes:
- valid — version precondition still holds or age is within policy;
- refreshed — a new read is semantically equivalent for the supported claim;
- invalidated — the resource changed in a way that breaks the decision;
- unknown — the runtime cannot establish freshness.
unknown must not silently collapse into valid. A failed revalidation request, an API without version semantics, and an expired credential are different operational causes, but none proves that the old observation still authorizes the effect.
The recovery policy can still be proportional. A read-only explanation may continue with a visible stale-data warning. A reversible edit may regenerate its patch. An irreversible action should fail closed and request new evidence or approval.
The receipt should record the transition:
obs_7f2a: expired
revalidation: resourceVersion 10245 -> 10261
supported decision: patch_31
outcome: invalidated
next action: replan
This is more useful than another generic “state changed” error because it identifies exactly which evidence lost authority.
What the runtime can and cannot guarantee
A freshness contract cannot manufacture strong consistency. If a tool exposes neither versions nor conditional writes, the runtime may only use age limits, content digests, or a second read. Those are weaker protections and should be labeled as such.
Even an exact precondition only protects the boundary that honors it. A version checked by the agent and then discarded before the downstream write creates a time-of-check/time-of-use gap. The strongest design carries the version into the mutation itself, as Kubernetes does for updates.
The current public IOSM CLI integration surface exposes structured tool start/end events and stateful JSON-RPC sessions. That is enough to transport observation metadata, but this article does not claim IOSM CLI currently implements observation leases or conditional effect enforcement. This is an architectural proposal grounded in established cache-validation and optimistic-concurrency mechanisms.
It also does not replace authorization, idempotency, or effect identity. Authorization asks whether an action is permitted. Idempotency asks whether retrying repeats an effect. Effect identity asks whether two attempts represent the same intended change. Freshness asks whether the evidence supporting that change still describes the target.
Decisions need a state boundary
Agents are often evaluated as if the world waits while they think. It does not.
Long context, human approval, background tasks, retries, and multi-agent handoffs all increase the distance between observation and effect. Better reasoning can reduce bad decisions inside a snapshot. It cannot make the snapshot current.
The engineering move is simple: give observations identities, attach their validity to specific claims, and carry version preconditions to the write boundary. When freshness is unknown, say so in the execution artifact and choose recovery by effect class.
An agent should not act because it once knew the state of the world. It should act because the runtime can still prove which state authorized the decision.
Sources
- RFC 9111: HTTP Caching
- Kubernetes API concepts: resource versions and conditional updates
- IOSM CLI: JSON, JSON-RPC, and SDK integration modes
For the complementary part of this workflow, see How to Prevent Stale AI Agent Writes.