Skip to main content
Reflect coordinates Detect → Notify → Reflect → Validate around an explicit agent invocation. Your agent receives failure evidence and proposes filesystem changes; independent validation determines whether they become accepted rules. run returns the original task result after evaluation and any triggered reflection. It does not replace the task answer with the reflection answer. Task exceptions propagate. Validation settles separately so replay can acquire resources released by the task. Native agent construction attaches the supplied reflect_bash tool and memory instructions. A generic asynchronous callback receives an Invocation and must pass its instructions/tool to the model and enforce phase permissions itself. See the quickstart, native integrations, and custom loop guide. Use unique execution IDs and related-work session IDs. Importing Reflect alone starts no work; constructing it opens its configured persistent workspace. Close Reflect and then the tracing client. An externally supplied platform client remains caller-owned. agent(...) and tool(...) construct synchronously; run(...), bash(...), and settlement operations are awaited. submit_traces(...) and validate(...) return scheduled asyncio Tasks. Use async with Reflect(client) or await reflect.aclose().

On this page

Reflect.

Example

This function wraps an already configured native agent or an async Invocation callback. The agent must include its tracing integration; use a framework guide to construct one with Reflect tooling.

Reflect

Source declaration

Constructor

Fields and properties

Methods

Explicit application boundary; framework callbacks do not define it.
The single supplied tool, bound to this instance and invocation context.
Returns the supplied tool in a generic or native framework format. The generic tool accepts a command string and must run inside an active Reflect boundary.
Builds a supported native agent with Reflect tools and memory integration. Pass the framework’s factory/constructor and its native options; do not also add reflect_bash manually.
Schedules evaluation for completed trace references; identities must belong to the same project. Reusing a trace under a different execution ID is rejected.
Wait for SDK export separately from persistence and evaluation.
Waits for evaluation evidence for this execution. A caller wait deadline can leave the underlying run pending.
Resumes persisted pending evaluation work after restart; known evaluation IDs are polled instead of recreated.
Uses the supplied host continuation when evaluation has produced a failure notice. Delayed feedback does not automatically restart an agent.
Returns the execution’s task, evaluation, reflection, and proposal outcomes. Does not infer business success from task completion.
Returns persisted proposals, including their lifecycle state and decision evidence.
Waits for an already scheduled reflection checkpoint. A caller wait timeout is distinct from the checkpoint’s execution deadline.
Invoke the developer’s agent, then offer it a bounded reflection checkpoint.
Wait separately, after the host releases resources replay may need.
Schedule independent replay. Never await this while holding task resources.
Fresh explicit trial exposure; no candidate enters ordinary accepted views.
Cancels owned work, bounds the shutdown wait, and closes an owned platform client. It does not close a caller-supplied platform client or the tracing client.

Signatures and fields are generated from the SDK source. See the import index for available entry points.