> ## Documentation Index
> Fetch the complete documentation index at: https://mirrors.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Modes and rollout controls

> Use shadow, active, and off modes to control optional context delivery.

The agent's runtime mode controls whether context may be returned. Correction
activation and agent mode are separate: an active correction does not cause the
SDK to return context while the agent is in shadow or off mode.

| Mode | Context returned to your application | Evaluation |
| - | - | - |
| `shadow` | Empty | With a confirmed shadow observation, the SDK schedules bounded background evaluation. Results stay server-side. |
| `active` | Eligible matching context, or empty | Subject to server controls, traffic allocation, and context validity. |
| `off` | Empty | No context evaluation is scheduled by the SDK. |

Capture and mode refresh continue in all three server modes. Turning context
delivery off does not stop trace capture. Use `setEnabled(false)` to disable the
client locally, or `dispose()` to stop it permanently.

## Start with shadow

Verify capture, review matches and exclusions, and measure the application's
baseline behavior. Then enable active delivery deliberately and increase traffic
only when the observed results support it. The server's emergency stop and traffic
allocation remain authoritative.

## Mode freshness and fallback

The SDK refreshes mode in the background, by default about once per second.
An observation expires within three seconds. Before the first valid observation,
or when an observation expires, retrieval returns empty immediately. This local
fallback does not change the configured server mode.

Remote changes become known through communication; a mode switch is not an
instantaneous recall of previously returned context. Use returned text promptly,
check expiry if dispatch is deferred, and retrieve again if the history changes.

## Application cancellation

Pass your existing `AbortSignal` to `getContext` and preserve the application's
cancellation handling before calling the model. A canceled context request must
not restart or retry a canceled model call. Mirrors does not invoke the provider.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.