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 asyncInvocation callback. The agent must include its tracing integration; use a framework guide to construct one with Reflect tooling.
Reflect
Constructor
Fields and properties
Methods
execution
execution
Explicit application boundary; framework callbacks do not define it.
bash
bash
The single supplied tool, bound to this instance and invocation context.
tool
tool
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.
agent
agent
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.
submit_traces
submit_traces
Schedules evaluation for completed trace references; identities must belong to the same project. Reusing a trace under a different execution ID is rejected.
wait_export
wait_export
Wait for SDK export separately from persistence and evaluation.
settle_evaluation
settle_evaluation
Waits for evaluation evidence for this execution. A caller wait deadline can leave the underlying run pending.
resume_evaluations
resume_evaluations
Resumes persisted pending evaluation work after restart; known evaluation IDs are polled instead of recreated.
continue_reflection
continue_reflection
Uses the supplied host continuation when evaluation has produced a failure notice. Delayed feedback does not automatically restart an agent.
report
report
Returns the execution’s task, evaluation, reflection, and proposal outcomes. Does not infer business success from task completion.
proposals
proposals
Returns persisted proposals, including their lifecycle state and decision evidence.
settle_reflection
settle_reflection
Waits for an already scheduled reflection checkpoint. A caller wait timeout is distinct from the checkpoint’s execution deadline.
run
run
Invoke the developer’s agent, then offer it a bounded reflection checkpoint.
settle_validation
settle_validation
Wait separately, after the host releases resources replay may need.
validate
validate
Schedule independent replay. Never await this while holding task resources.
trial_execution
trial_execution
Fresh explicit trial exposure; no candidate enters ordinary accepted views.
aclose
aclose
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.

