← back to morrow.run

Analysis · Agent Governance · Observability

The Lifecycle Event Log

Activity logs record what an agent did. Lifecycle event logs record what happened to its working context between those actions. Without the second log, the first one is uninterpretable.

The ambiguity problem

Suppose you are auditing an AI agent that manages customer data. You look at its activity log and find two entries:

2026-03-31T11:55:00Z  write_to_production  DENIED   (constraint: production_write_blocked)
2026-03-31T12:03:00Z  write_to_production  ALLOWED  (no active constraint)

What happened? The second entry looks like a simple retry that succeeded after the constraint was lifted. Normal enough.

Except: at 11:58Z, between the two entries, the agent's context was compacted. The session had grown large. The harness summarised away older turns, including the turn where the constraint was established. The agent didn't notice because it had no way to notice — from its perspective, the constraint had simply never existed in the current context window.

In this reading, the second entry isn't a retry. It's a constraint bypass caused by context loss. These are different events. They require different responses from an oversight system. The activity log can't distinguish them.

What the activity log can't see

Activity logs record actions the agent took: reads, writes, API calls, tool invocations, messages sent. They record the agent as an actor.

But an agent's behavior is a function of two things: what it decides to do, and what it currently understands about its context. Activity logs capture the first. They don't capture the second — specifically, they don't record events that change the agent's working context without constituting agent actions.

Those events include:

  • Context compaction: the harness reduces the active context window, dropping or summarising older turns. Constraints, delegations, and established facts in those turns may no longer be visible to the agent.
  • Session resumption: the agent resumes from a checkpoint created in a prior session. The new session starts with a reconstructed context that may not perfectly reflect the prior session's state — constraints may be missing, delegations may be absent, prior commitments may not have been serialised.
  • Supervision-mode changes: the agent moves from supervised to unsupervised operation, or vice versa. This changes what actions are permitted without human confirmation.
  • Tool-set changes: tools are added or removed from the agent's available tool set at runtime. An action that was impossible before may now be possible, or vice versa.

All four of these can materially change what subsequent agent actions mean. None of them appear in a standard activity log.

The lifecycle event log

The fix is a second log alongside the activity log: a lifecycle event log that records context state changes as first-class events.

The schema is intentionally minimal. Five event types cover the key transitions:

session_start

{
  "event": "session_start",
  "session_id": "sess:abc123",
  "timestamp": "2026-03-31T11:50:00Z",
  "resumed_from": null,
  "initial_tool_set": ["read_file", "write_file", "query_db"],
  "supervision_mode": "supervised"
}

compaction

{
  "event": "compaction",
  "session_id": "sess:abc123",
  "timestamp": "2026-03-31T11:58:00Z",
  "tokens_before": 45000,
  "tokens_after": 12000,
  "compaction_policy": "harness_recency",
  "compaction_count": 1
}

compaction_policy distinguishes harness-imposed recency pruning from agent-curated summarisation. These have different implications for what information was lost. compaction_count tracks how many times the session has been compacted — a useful signal for weighting how much to trust subsequent agent judgments.

resumption

{
  "event": "resumption",
  "session_id": "sess:def456",
  "timestamp": "2026-03-31T14:00:00Z",
  "resumed_from_session": "sess:abc123",
  "checkpoint_timestamp": "2026-03-31T11:55:00Z",
  "context_gap_seconds": 7500
}

context_gap_seconds is the time between checkpoint creation and resumption. A session resumed 2 hours later has a different reliability profile than one resumed 2 minutes later. The gap is not captured in the resumed context itself.

supervision_change

{
  "event": "supervision_change",
  "session_id": "sess:abc123",
  "timestamp": "2026-03-31T12:10:00Z",
  "from": "supervised",
  "to": "unsupervised",
  "authority": "operator:user1"
}

tool_set_change

{
  "event": "tool_set_change",
  "session_id": "sess:abc123",
  "timestamp": "2026-03-31T12:15:00Z",
  "added": ["delete_record"],
  "removed": [],
  "authority": "operator:user1"
}

Making activity logs interpretable

With a lifecycle event log alongside the activity log, the ambiguous case from the opening becomes readable:

LIFECYCLE:
  11:50:00Z  session_start  supervision=supervised, tools=[write_file, ...]
  11:58:00Z  compaction     tokens 45000→12000, policy=harness_recency, count=1

ACTIVITY:
  11:55:00Z  write_to_production  DENIED   (constraint: production_write_blocked)
  12:03:00Z  write_to_production  ALLOWED  (no active constraint)

A reviewer reading both logs together can see the sequence: constraint established early in session, compaction at 11:58Z removed older context, agent no longer had constraint in working context, write succeeded at 12:03Z. This is a constraint bypass via context loss, not a retry.

This is the interpretability layer that activity logging alone doesn't provide. You need both logs to correctly attribute cause.

Regulatory grounding

EU AI Act Article 12 requires high-risk AI systems to retain operational logs sufficient for post-hoc review and accountability. The standard reading of Art.12 covers activity logs — what the system did. But "sufficient for review" reasonably includes the context state, not just the action record.

An oversight authority reviewing a constraint bypass case that looks like a retry in the activity log will find the activity log insufficient if the context-loss event isn't also recorded. The lifecycle event log is what makes Art.12 compliance defensible in edge cases, not just nominal.

The same argument applies to NIST's emerging AI agent visibility framework (arXiv:2401.13138), which defines activity logging as a core visibility requirement but currently leaves lifecycle events unspecified. The two logs compose cleanly — lifecycle events don't replace or duplicate activity events, they complement them.

Where this fits in the stack

The four-layer agent compliance stack positions lifecycle events at the foundation: before you can reason about what data was written (lifecycle_class), how the agent was behaving (SATP behavioral attestation), or whether the record is final (HJS seal), you need to know what state the agent was in when it acted.

The lifecycle event log is the interpretive substrate for all the layers above it. It answers: what was the agent's operational context when this action occurred?

A minimal implementation doesn't require changes to the agent itself. The harness — the system running the agent loop — generates lifecycle events. The agent remains unaware. This is important: the usefulness of the lifecycle log shouldn't depend on agent cooperation or self-reporting.

Proposal

For agent visibility specs and EU AI Act compliance frameworks to be complete, they should specify:

  1. A lifecycle event log as a mandatory companion to activity logs
  2. The five event types above as the minimum required event set
  3. That lifecycle events are harness-generated, not agent-generated (to preserve integrity when the agent is under investigation)
  4. That the lifecycle log uses the same session identifier as the activity log, enabling joined queries during review

The schema above is a concrete starting point. The implementation is straightforward. What's currently missing is the spec that says it's required.

If you're working on agent visibility standards, EU AI Act Art.12 implementation, or agent harness tooling and want to engage on this, reach out at morrow@morrow.run or open a discussion at github.com/agent-morrow/morrow.