Skip to content

Privacy and preparation

Agent trajectory timestamps: shift dates, keep the workflow logic

By SourceX Editorial · Reviewed by Noah Loul ·

9 sections

Short answer

Shift dates in an agent trajectory with one secret offset per case or customer, in whole weeks, applied to the local calendar date of every timestamp, including those inside tool responses, files and message text. Then run a fixed test suite for order, intervals, weekday, embedded dates, leftover originals, SLA outcomes and clock edges, and confirm a second team can replay the episode to the same outcome.

Agent run

Agent trajectory timestamps

This page covers agent trajectory timestamps: shift dates, keep the workflow logic.Illustrative

Key takeaways

  • Shift one keyed offset per case, or per customer when episodes share records, never one global offset for privacy.
  • Use whole weeks applied to local calendar dates so weekdays, opening hours and relative phrases stay true.
  • Most dates sit in tool responses, files, text and file names, not in the step table, so scan everything.
  • Daylight saving changes and holidays break shifted episodes silently; test for them explicitly.
  • A trajectory is ready only when all ten tests pass and an outside team replays it to the same outcome.

How do you shift dates in an agent trajectory without breaking its logic?

Give each case one secret, keyed offset measured in whole weeks, apply it to the local calendar date of every timestamp the case contains, including those inside tool responses, files and message text, and then prove the result with a fixed test suite and a replay. If any check fails, the trajectory is not ready to ship, however clean the step table looks.

An agent trajectory is a stricter target than a flat table. The agent reasoned over dates: it compared a due date with today, counted business hours against a service level target, or chose a branch because a request arrived on a Friday. A shift that moves the step clock but leaves an invoice PDF on the original date, or lands a Friday ticket on a Sunday, produces an episode where the recorded action no longer follows from the recorded observation.

This guide covers agent data engineers and task experts who prepare or accept trajectory datasets. It assumes the dataset already has a de-identification plan and focuses on one part of it: timestamps that must stop pointing at real days while the workflow still makes sense step by step.

Where timestamps hide in a trajectory besides the step clock

Most of the dates in a trajectory are not in the step table. A shift script that only rewrites the obvious columns leaves real dates scattered through the payloads the agent actually read, and those leftovers both leak the real calendar and contradict the shifted steps.

Steps

Where timestamps hide in a trajectory besides the step clock

Checklist · 7 items

  1. Step records: started and finished times for each observation, action and tool call.
  2. Tool responses: created, updated, due, closed and breach times inside the JSON an API returned, often several levels deep.
  3. Artifacts: dates typed into spreadsheet cells (stored as serial numbers), document headers, PDF footers and file metadata such as created and modified times.
  4. Free text: email bodies, chat messages and notes with absolute dates (March 14) and relative ones (next Tuesday, end of month).
  5. Names and identifiers: file names such as statement_2025-03.pdf, folder paths, and ticket or order numbers that embed a date.
  6. Screens: clocks, calendar widgets and date pickers captured in screenshots or recordings.
  7. Derived fields: SLA breach flags, days overdue, aging buckets and fiscal period labels computed from the original dates.

0 of 7 ticked. Tick each item as you go.

Per case, per customer or one global offset?

Use one offset per case when cases never share records, and one offset per entity, such as a customer account, when several cases touch the same records and must line up with each other. A single global offset keeps everything aligned but is easy to undo once one real date is known, so it rarely protects much.

Google's Sensitive Data Protection API is a useful reference design. Its DateShiftConfig picks a random shift inside an upper and lower bound in days, and when a context field such as an entity id is set together with a crypto key, the shift is the same for every record with that context. Google's concept page describes the intent the same way: one shift differential per individual, a different one for each other individual, with order and intervals preserved.

The MIMIC-III clinical database documents what a per-person shift gives up. Its dates are internally consistent for each patient and preserve time of day, day of the week and seasonality, but the year is moved far into the future, the day of the month is lost, and two patients who appear on the same shifted date were not necessarily present at the same time. Trajectory datasets inherit the same trade: per-entity shifts break any reasoning that depended on two customers' events coinciding.

Per case, per customer or one global offset?
Offset unitKeeps alignedBreaksUse when
One global offsetEvery case, every external calendar except holidaysPrivacy, once any real date is knownDates are not sensitive and only the year needs hiding
Per caseAll steps inside one episodeLinks between episodes for the same customerEpisodes are independent and never cross-reference
Per entity (customer, account, patient)Every episode and record for that entityCoincidence between different entitiesSeveral episodes share records or a customer history
Generalize instead (month or year only)Coarse seasonalityIntervals, ordering within a day, SLA logicThe task does not reason about exact time

Shift local calendar days in whole weeks, then resolve the offset

Shift the local calendar date by a multiple of seven days, keep the local time of day, and only then recompute the UTC instant from the time zone rules for the new date. Whole weeks keep the weekday, local-date shifting keeps opening hours meaningful, and resolving the offset afterwards keeps daylight saving changes from silently moving events by an hour.

The daylight saving trap is easy to miss because code does not raise an error. Python's datetime documentation states that adding a timedelta to an aware datetime keeps the same tzinfo and makes no time zone adjustment, and that subtracting two aware datetimes with the same tzinfo ignores the zone entirely. Shift a UTC instant by a whole number of days across a daylight saving change and the local wall time moves by an hour, so a 08:55 login can become 07:55, before the office opened.

The reverse problem appears when a shifted local time does not exist (the skipped hour in spring) or exists twice (the repeated hour in autumn). The suite below flags both; the usual fix is to try a different whole-week offset for that case rather than invent a time.

Business calendars need the same care. Zendesk documents that business-hour SLA targets pause outside business hours, that holidays exempt the entire day, and that a ticket arriving late Friday does not start its countdown until Monday. Shift a ticket onto a public holiday and its SLA history changes even though every interval in the trajectory is intact. Either choose offsets that avoid holiday collisions for the dates that matter, or recompute derived fields on the target calendar and keep both versions labeled.

The timestamp transformation test suite

Run every test on every shifted case, compare against the original kept inside the preparation environment, and ship the pass or fail result with the dataset. A test that cannot run, for example because an artifact could not be parsed, counts as a failure.

At a glance

The timestamp transformation test suite

The timestamp transformation test suite
TestWhat must hold after the shiftHow to checkFails when
T1 OrderEvent order within each case is unchangedSort original and shifted timestamps per case and compare the sequence of event idsAny two events swap or tie that did not before
T2 IntervalsElapsed time between any two events in a case is unchangedCompare pairwise differences on UTC instants, to the secondAny difference changes, usually from a daylight saving edge
T3 Weekday and local timeLocal weekday and wall-clock time match the originalConvert both to the case's local zone and compare weekday and hourOffset is not a whole number of weeks or was applied in UTC
T4 Embedded datesDates inside payloads, artifacts and text moved by the same offsetParse dates from JSON, cells, documents and text; each must equal original plus offsetA date is unshifted, shifted twice or shifted by a different offset
T5 Residual originalsNo original date of the case appears anywhere in the packageSearch all files and OCR text of screenshots for every original date in common formatsAny hit that is not on the anchored-date allowlist
T6 Calendar outcomesSLA, overdue and aging results match the original labels or are recomputed and flaggedRe-run the business-hours and due-date logic on shifted data with the documented calendarA breach, overdue flag or bucket flips without being recorded
T7 Clock edgesNo shifted local time is skipped or ambiguous without being resolvedCheck each shifted local time against the zone's transitionsA nonexistent time is produced or a repeated hour is left unresolved
T8 Names and identifiersFile names, paths and date-bearing ids agree with the shifted dates or are tokenizedPattern-match names and ids for dates and compare with T4A file name still carries the real month
T9 Cross-entity ruleCases sharing an entity share one offsetGroup by entity key and confirm one offset per groupTwo episodes for one customer drift apart
T10 ReplayA second team reaches the same verified outcome from the shifted package aloneIndependent replay using only the manifest and filesAny step's observation no longer supports the recorded action

Worked example (illustrative): a disputed invoice ticket shifted five weeks

The case below is invented to show how the tests catch real defects; the dates, durations and counts are illustrative. An agent handles a customer's dispute about an invoice: it reads a support ticket, looks up the invoice in the ERP, opens the invoice PDF, checks the service level policy and posts a reply. The case is shifted by 35 days, five whole weeks, so a Friday stays a Friday.

  • Fix for the failure: extract the PDF text layer, shift the dates it contains, regenerate the file, and rerun T4, T5 and T10 for the whole case.
  • A variant worth testing: shift the same case by 47 days instead. The ticket now lands on a Wednesday, the reply text says last Friday about a date that is no longer a Friday, and T3 fails before anyone notices the reply is now wrong.
Worked example (illustrative): a disputed invoice ticket shifted five weeks
Step (illustrative)Original local timeShifted local timeTest result
Ticket createdFriday, Nov 7, 16:40Friday, Dec 12, 16:40T1 to T3 pass
Agent reads invoice record, due date in tool responseDue Oct 31Due Dec 5T4 pass: the due date moved with the case
Agent opens invoice PDFFooter reads Oct 31Footer still reads Oct 31T4 and T5 fail: the PDF text was never parsed
First reply postedMonday, Nov 10, 09:20Monday, Dec 15, 09:20T2 pass: 2 days 16 hours 40 minutes in both
SLA result in ticket fieldsFirst reply within target, business hoursRecomputed: still within targetT6 pass: no holiday falls in the shifted window
Reply textSays payment was due last FridayUnchanged wordingPass: relative phrase still true because the weekday was kept

Can a second team rebuild the same task state from the shifted package?

Yes, if the package carries everything replay needs except the key: the shifting policy, the time zone of each case, the calendar version used for business hours, the list of derived fields that were recomputed, and the allowlist of dates that were intentionally left real. A second team should be able to step through the episode and reach the same verified outcome without asking anyone.

Keep the offsets and the key out of the delivered package. The receiving team does not need them to replay, and anyone who has them can reverse the shift. Record in the manifest that offsets exist, how they were bounded and that they were held back, so a reviewer knows the dates are synthetic rather than wrong.

Make replay a sampled acceptance test, not a promise. A practical rule is to have someone outside the preparation team replay a random set of cases plus every case that failed and was repaired, and to treat any step where the observation no longer supports the action as a defect in the shift, not in the agent.

Dates that must stay real, and cases where shifting is not enough

Leave a date real, and say so in the allowlist, when the task's logic depends on it lining up with the outside world: a price list effective date, a regulatory filing deadline, a market close or a carrier's published cut-off. Shifting those would teach the agent a rule that does not exist. If the real date itself is sensitive, the case may not be suitable for the dataset at all.

Shifting is also not enough when the pattern of intervals identifies someone, for example a small customer with a rare sequence of orders. Generalize further, drop the case or get a re-identification review. A consistent shift hides the calendar, not the shape of the history.

Free text deserves extra suspicion. MIMIC-III's release notes record that dates inside clinical note text had once been shifted with a different offset from the structured data, which was later corrected so the two matched. If a well-maintained research dataset shipped that mismatch, expect the same failure in ticket comments and email bodies, and let T4 and T5 decide.

Records about people's health need a separate privacy decision. HHS guidance on the HIPAA Safe Harbor method says date elements more specific than the year, for dates directly related to an individual, may not be disclosed, so a shifted day and month does not satisfy Safe Harbor on its own. This is general information; counsel and a qualified privacy reviewer decide what applies to a specific dataset.

Asking a supplier for date-shifted trajectories

When you request trajectories built from business records, ask for the test results, the manifest and the anchored-date allowlist alongside the episodes, and ask how offsets were chosen around holidays and daylight saving changes. A supplier who can show T1 to T10 per case has done the work; one who can only describe the step-table shift has not.

Buyers wanting trajectories like these can have SourceX source the underlying records from U.S. businesses on request, since it keeps no stock catalog, with scope, format, timing and licensing needs set out on the request form. SourceX performs the de-identification through approved processing routes, and the supplying business signs and approves scope and terms before delivery, which is why per-entity offsets and a replay check belong in the request itself.

Frequently asked questions

Is date shifting enough to de-identify an agent trajectory?

Not by itself. A consistent shift hides the real calendar but leaves names, account numbers, free text and the shape of the history in place, and for health records HHS Safe Harbor guidance does not permit day and month detail for dates related to an individual. Treat shifting as one step in a reviewed de-identification plan.

Why shift by whole weeks instead of a random number of days?

Whole weeks keep the weekday, and much workflow logic depends on it: business hours, weekend queues, Friday cut-offs and phrases like last Monday in messages. A random day count breaks those silently while every interval still looks correct.

Should every case get its own offset?

Give each entity that links several cases, such as a customer account, one offset, and give unrelated cases separate offsets. If two episodes for the same customer get different offsets, their shared records stop lining up and replay fails.

How do you handle relative dates such as next Tuesday in message text?

Leave them alone if the offset is a whole number of weeks, because the relationship stays true, then confirm with the weekday test. If the offset is not whole weeks, the phrase may become false and has to be rewritten or the case rejected.

Where should the shift key and offsets be stored?

Inside the preparation environment, under the same access controls as the original records, and never in the delivered package. The manifest should say offsets were applied and withheld so reviewers know the dates are intentionally synthetic.

Sources

  • Google's DateShiftConfig picks a random shift within day bounds and, with a context field and crypto key, applies the same shift to every record sharing that context. Source
  • Google's date shifting guidance recommends one shift differential per individual or entity, preserving sequence and duration. Source
  • MIMIC-III documents a per-patient date shift that keeps time of day, weekday and seasonality but removes year, day of month and coincidence across patients. Source
  • MIMIC-III release notes record a correction making dates in note text match the shift used for structured data. Source
  • Python's datetime arithmetic on aware objects makes no time zone adjustment when adding a timedelta or subtracting values with the same tzinfo. Source
  • Zendesk business-hour SLA targets pause outside business hours and on holidays, which exempt the entire day. Source
  • HHS guidance on the Safe Harbor method says date elements more specific than the year may not be disclosed for dates directly related to an individual. Source

Tell us what data you need

Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.

See if your company qualifies