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

# Pause tracing

> [!NOTE]
>
> This feature is in **preview**. The API may change before general availability. To try it out, contact [support@intunedhq.com](mailto:support@intunedhq.com) and we'll enable it for your workspace.

Stop Intuned from recording part of an attempt. While tracing is paused, the browser trace, screenshots, and automation logs are not captured—so sensitive values your automation types or reads never reach a stored trace.

Use it around the few lines that touch secrets: filling a password, entering a one-time code, or reading a record you aren't allowed to retain.

```python theme={null}
from intuned_runtime import tracing_paused

async with tracing_paused():
    await page.get_by_label("Password").fill(params["password"])
    await page.get_by_role("button", name="Sign in").click()
```

> [!NOTE]
>
> Pausing tracing is narrower than turning tracing off. [`saveTrace`](https://intunedhq.com/docs/main/05-references/intuned-json#param-save-trace) discards the trace for a whole Run, which also removes the trace you need to debug the other 99% of the automation. Pause when you only need a gap.

## Available helpers

* [`tracing_paused`](#tracing_paused) — Async context manager that pauses tracing for a block
* [`pause_tracing`](#pause_tracing) — Pause tracing until it is resumed
* [`resume_tracing`](#resume_tracing) — Resume tracing

## Function reference

### tracing\_paused

```python theme={null}
from intuned_runtime import tracing_paused

def tracing_paused() -> AsyncContextManager[None]: ...
```

An async context manager that pauses tracing for the body of the `async with` block and resumes it on exit. Tracing resumes even if the block raises, so a failure in the middle of a sensitive step can't leave the rest of the attempt unrecorded.

Prefer this form. Reach for [`pause_tracing`](#pause_tracing) only when the sensitive work spans function boundaries—for example, pausing in a hook and resuming in your automation.

> [!NOTE]
>
> The TypeScript SDK exposes this as [`withTracingPaused(callback)`](https://intunedhq.com/docs/main/05-references/runtime-sdk-typescript/pause-tracing#withtracingpaused) instead, so it reads naturally in each language.

**Returns**

Returns an async context manager. The block's own value is unaffected.

**Example**

```python theme={null}
from intuned_runtime import tracing_paused
import pyotp

async with tracing_paused():
    code = pyotp.TOTP(params["secret"]).now()
    await page.get_by_label("One-time Password").fill(code)
    await page.get_by_role("button", name="Login").click()
```

### pause\_tracing

```python theme={null}
from intuned_runtime import pause_tracing

def pause_tracing() -> None: ...
```

Pauses tracing for the current attempt until [`resume_tracing`](#resume_tracing) is called. Calling it while tracing is already paused does nothing.

> [!WARNING]
>
> If your code raises between `pause_tracing` and `resume_tracing`, tracing stays paused for the rest of the attempt and you lose the trace for everything after that point. Use `try`/`finally`, or use [`tracing_paused`](#tracing_paused) instead.

**Returns**

Returns `None`.

**Example**

```python theme={null}
from intuned_runtime import pause_tracing, resume_tracing

pause_tracing()
try:
    await page.get_by_label("SSN").fill(params["ssn"])
finally:
    resume_tracing()
```

### resume\_tracing

```python theme={null}
from intuned_runtime import resume_tracing

def resume_tracing() -> None: ...
```

Resumes tracing for the current attempt. Calling it while tracing is already active does nothing.

**Returns**

Returns `None`.

## What pausing covers

While tracing is paused:

* **Browser trace** — No actions, DOM snapshots, or network requests are recorded. The trace viewer shows a gap.
* **Screenshots** — No screenshots are captured, including the ones taken automatically around actions.
* **Automation logs** — Anything your code writes to stdout or stderr is dropped rather than stored on the attempt.

What is still recorded:

* The Run and Attempt records themselves—status, timing, and retry history.
* Your automation's **return value**, and the Run's `parameters`. Tracing has no effect on either. To keep a value out of the Run record entirely, use [ephemeral parameters](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/ephemeral-parameters.md).
* **Errors.** A raised exception's message and traceback are still stored on the attempt, even if it was raised while tracing was paused.

> [!WARNING]
>
> Never put a secret in an exception message. Error details are stored on the attempt regardless of tracing state.

## Behavior notes

* **Nesting works.** Nested `tracing_paused` blocks are safe; tracing resumes when the outermost block exits.
* **Scope is the attempt.** Tracing state resets at the start of every attempt, so a retry always begins with tracing active.
* **Local development included.** The helpers behave the same under `intuned dev`, so a locally captured trace has the same gaps a deployed one would.
* **Ephemeral parameters pause automatically.** [`get_ephemeral_parameter`](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/ephemeral-parameters#get_ephemeral_parameter) pauses tracing on your behalf before it returns a value.

## Related

* [Ephemeral parameters](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/ephemeral-parameters.md) — Pass secrets to a Run without storing them.
* [Monitoring and traces](https://intunedhq.com/docs/main/02-features/observability-monitoring-logs.md) — How traces and attempt logs are captured and viewed.
* [Intuned.json reference](https://intunedhq.com/docs/main/05-references/intuned-json.md) — `saveTrace` defaults for dev and deployed runs.


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