Skip to main content
All Python modules · Import and compatibility guidance

Exports

CAPTURE_SCHEMA_VERSION

CaptureEvent

Facts about one finished invocation, offered to the capture rule. The event exists only in memory. user_id, session_id and metadata let a rule target specific traffic, but none is copied into the stored record.
Fields (— means no declared default):

CaptureEvent.failed

Return whether the invocation raised instead of completing.

CaptureEvent.tool_error

Return whether any tool result looked like an error. This is a heuristic over framework-neutral events (an error field or an error status); write an explicit check in the rule when it matters.

CaptureRecord

One invocation with structure-only or team-redacted content. content="omitted" serializes empty input/output text and null tool arguments/results. content="redacted" records that the team’s redactor ran, not a guarantee that all personal data was removed.
Fields (— means no declared default):

CaptureRecord.to_json

Serialize schema version 1 without content unless explicitly redacted.

CaptureRecord.from_json

Read a record, omitting content without an explicit content policy.

CaptureStore

Storage for capture records, registered with @lifecycle.storage.custom.

CaptureStore.start

Open the underlying storage resource.

CaptureStore.close

Release the underlying storage resource.

CaptureStore.append

Persist one structure-only or team-redacted record.

CaptureStore.list

Return records captured at or after since, newest first.

LocalCaptureStore

Reference store writing one JSON Lines file per UTC day. Suitable for local development and single-instance deployments with a persistent volume. Files older than retention_days are deleted on start and whenever a new day’s file is opened.

LocalCaptureStore.start

Create the directory and apply retention.

LocalCaptureStore.close

Nothing to release; every append closes its file.

LocalCaptureStore.append

Append one record to today’s file, serialized across tasks.

LocalCaptureStore.list

Read records newest first, stopping at limit.

ToolActivity

One tool call in a captured invocation, with its result when one arrived.
Fields (— means no declared default):

ToolActivity.to_json

Return a JSON-safe mapping for stores.

ToolActivity.from_json

Rebuild one tool activity written by to_json.

default_redactor

Omit all input, output and tool payloads, preserving only structure. This existing helper name remains importable, but no longer guesses which substrings contain personal data. Register @lifecycle.evals.redact to retain content under a team-owned policy instead.

redact_text

Omit an entire string; retained for import compatibility, not PII detection.