Engineering, AI & Security

Delegated Work Needs Expiring Instructions

The connection recovered, the agent resumed and the API accepted its request. The action still arrived too late. Technical recovery does not automatically renew a business instruction.

By Josué Trindade Engineering & AI ~8 min

You ask an agent to find transport for a delivery and reserve an allowed option by 16:00. At 15:50, the supplier’s portal becomes unavailable. The task enters a queue. Service returns at 17:30, the agent obtains a new credential and makes the reservation.

In this hypothetical scenario, infrastructure recovered and the supplier accepted the request. The objective had already lost its execution window. If 16:00 was the commitment deadline, a reservation at 17:30 does not become valid because it was technically possible.

I would treat instruction validity as part of task state. An old conversation can explain where work originated. It should not act as permission extending for as long as enough memory exists to reread it.

The instruction must outlive the conversation as verifiable data

A long task can cross restarts, queues and process changes. Saving only “reserve the transport today” forces every component to reinterpret “today”, the allowed transport and whether the request remains active.

In an AI integration performing delegated work, I would preserve an identifiable objective, permitted actions, the authorising person, the start and end of validity and the conditions on which it depends. I would bind that record to the version of the decision data.

Every request does not need its own programming language. A simple task can have few fields. It does need a way for the executing service to check boundaries without treating the agent’s unconstrained interpretation as sufficient evidence.

At least three different deadlines exist

It is easy to use expiry for several controls and conclude that they solve the same problem. In our example, I would separate:

Boundary Question answered What it does not establish
Credential validity Does the service accept this access mechanism now? The reservation is still wanted
Attempt duration How long do we wait for this step? The objective remains authorised
Instruction validity Until when, and under which conditions, may we act? The external call will respond

RFC 7519 defines a JWT’s expiration claim. A JWT is a token format that can carry verifiable information. When present, that claim limits token acceptance. It does not independently define our reservation’s business window.

AWS Step Functions task documentation distinguishes duration limits from signals that a process remains active. These are useful execution mechanisms. A running process does not establish that the business instruction remains valid.

A queue must not return time already spent

Suppose the task was created at 15:40 and expires at 16:00. There were twenty minutes to act. If it waits fifteen minutes in a queue, five remain when a worker picks it up. Starting an attempt should not restore the original twenty minutes.

I would store the task’s final instant and check it when collecting queued work and before another significant effect. Each attempt’s limit must also fit the objective’s execution policy. When no useful time remains, reporting a missed window may be the correct outcome.

That requires distinguishing “not yet attempted” from “permitted to attempt now”. A request can be new to a worker and old to the business. The same rule should apply when work returns from a failure queue or manual recovery.

Renewing access does not renew the objective

RFC 6749 describes refreshing access tokens. That mechanism obtains access under the relevant service’s authorised conditions. An application needs an additional rule if it wants to bind renewal to a particular task’s validity.

In our scenario, a credential obtained after recovery might be valid for consulting other reservations while providing no justification for completing a task that expired at 16:00. Renewing access must not silently change the delegation record.

I would also avoid placing a long-lived credential inside every queue message. The task should identify the required execution context; the responsible service obtains access according to current rules. It must still check whether that action belongs to a valid instruction.

A condition can invalidate work before the clock does

A final deadline is useful in many processes but insufficient when an instruction depends on changing facts. The customer cancels delivery. A supplier becomes disallowed. The delegating person loses authority for that cost centre. A price no longer meets the limit.

I would define which changes suspend execution and how they reach the service accepting the commitment. An event can accelerate state updates; the absence of that event should not be the sole evidence that nothing changed. Before acting, the service must compare relevant conditions with the state it treats as authorised.

In enterprise software platforms, this distinction prevents an old process from acting merely because its final date has not arrived. Time is one validity condition rather than a replacement for other permissions.

Verification must reach the point of commitment

Checking validity at 15:59 differs from actually submitting a reservation at 16:02. If submission depends on another service or downstream queue, the first check does not protect the entire path.

Within the application, I would coordinate version and deadline checks with authorisation of the attempt. A worker resuming with old data must not bypass a task that has since expired. If another component sits before the final effect, that component must also enforce the appropriate boundary.

Guaranteeing a supplier-side deadline requires a supplier contract that supports it, such as a validity condition the supplier itself checks. Without that control, explaining where the local guarantee ends is more accurate than promising that no request could be accepted after the deadline.

That limitation influences the design: an operational margin, earlier suspension or explicit outcome confirmation may be necessary. The margin should be deliberately agreed rather than added by an agent trying to finish its work.

Revalidation creates a new decision without rewriting the old one

If reserving different transport still makes sense at 17:30, an authorised person can renew or replace the instruction. I would retain the earlier version as expired and record the new decision with its own boundaries.

Old attempts should remain bound to the version they received. Otherwise, a delayed worker might discover a new date and act on an old price or destination. Renewing the deadline does not make all stored information current.

A task can retain the same business identifier while having several delegation versions. An explicit relationship explains which version authorised each effect and allows rejection of execution that mixes conditions from different versions.

Expiry does not erase an outcome

If a reservation was accepted at 15:58, reaching 16:00 does not undo it. If the request was in flight and its response disappeared, we cannot conclude that nothing happened either.

I would separate preventing new actions from reconciling requests already made. Checking an outstanding reference may be necessary after expiry, under the permissions appropriate to that lookup. Cancelling a confirmed commitment is a different action requiring suitable rules and authority.

The record should show why the instruction expired, confirmed actions and unresolved outcomes. Marking everything cancelled because the deadline passed invents certainty the system does not possess.

Time must be understandable to people and verifiable by the server

An instruction saying “by four” needs a date and time-zone context. I would preserve an unambiguous server-side instant and display the date, time and zone relevant to the operation. The browser’s clock must not decide whether an action is accepted.

The discussion of infrastructure clock synchronisation provides background on that dependency. An interface countdown informs the person; effective enforcement belongs to the service applying the rule.

Longer delegation needs renewed context as well as memory

If agents move from short tasks to work distributed across several days between 2026 and 2030, retaining more context can support continuity. It can also preserve instructions that have lost their purpose.

I would evaluate delegation in stages: a longer information-gathering window, shorter validity for commitments and explicit revalidation when participants or conditions change. This does not require confirmation for every lookup. It requires recognising when the intended effect needs a current decision.

In a business application, I would start a rehearsal with a task expiring in its queue. I would then resume an old version after renewal, withdraw a permission and simulate a late external response. These are proposed checks for the design rather than results already obtained.

Before delegating a long task, ask a concrete question: if this process resumes only tomorrow, which data lets it establish whether it may still act?

[+] On this page 17 topics ▼
FAQ · Common Questions

Frequently Asked Questions

If a credential still works, may the agent continue its task?

The credential alone cannot establish that. The instruction's validity, current permissions and operational conditions also require checking. Technical access and the objective's deadline can end at different times.

Should another attempt receive a new deadline?

Not automatically. An attempt can have its own execution limit but must respect the task's original deadline. Extending delegation requires an authorised decision recorded as a new version.

What happens to completed work when an instruction expires?

Expiry should prevent new effects within the defined boundary. It does not erase completed actions or prove that an in-flight request failed. Preserve the history and clarify outstanding outcomes.

Start your project

Need a website that earns trust, ranks in search, and gives your business a stronger digital presence? Start the conversation here.

Official sources used on this page