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. Import Reflect from pandaprobe/reflect; alias it to ReflectRuntime when also using JavaScript’s built-in Reflect. Await agent(...), tool(...), run(...), and close(). Supported native framework identifiers and agent options are listed below.

On this page

Agent, AgentOptions, Framework, NativeAgent, Reflect, ReflectInit, SubmissionOptions.

Example

This function accepts your native agent builder. It must include the tracing integration and use reflect.agent(...) to attach Reflect tooling; see the framework guides.

Agent

Type parameters: I = any, R = any. Source declaration

AgentOptions

Source declaration

Fields and properties

Framework

Source declaration

NativeAgent

Type parameters: I = any, R = any. Source declaration

Fields and properties

Methods

Reflect

Source declaration

Constructor

Fields and properties

Methods

Advanced adapter lifecycle hook. Ordinary applications use run/execution and the settlement methods so attribution, scheduling, and cleanup stay paired. Do not expose this hook to the agent.
Advanced adapter lifecycle hook. Ordinary applications use run/execution and the settlement methods so attribution, scheduling, and cleanup stay paired. Do not expose this hook to the agent.
Advanced adapter lifecycle hook. Ordinary applications use run/execution and the settlement methods so attribution, scheduling, and cleanup stay paired. Do not expose this hook to the agent.
Advanced adapter lifecycle hook. Ordinary applications use run/execution and the settlement methods so attribution, scheduling, and cleanup stay paired. Do not expose this hook to the agent.
The callback must encompass actual work, including consuming streams.
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.
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.
Waits for an already scheduled reflection checkpoint. A caller wait timeout is distinct from the checkpoint’s execution deadline.
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.
Advanced adapter lifecycle hook. Ordinary applications use run/execution and the settlement methods so attribution, scheduling, and cleanup stay paired. Do not expose this hook to the agent.
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.

ReflectInit

Source declaration

Fields and properties

SubmissionOptions

Supporting contract used by the API below; it is not a separate package export. Source declaration

Fields and properties


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