> ## 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.

Keep part of a traced attempt out of its trace and logs. While a `without_tracing` block runs, the browser trace and the automation logs aren't recorded, so values your automation types or reads there never reach a stored trace or log.

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 without_tracing

async with without_tracing():
    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. Setting `saveTrace` to `false` on the Run request, or `defaults.saveTrace` in [Intuned.json](https://intunedhq.com/docs/main/05-references/intuned-json.md), discards the trace for a whole Run, which also removes the trace you need to debug the rest of the automation. Use `without_tracing` when you only need a gap.

## Function reference

### without\_tracing

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

def without_tracing() -> AbstractAsyncContextManager[None]: ...
```

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

It only has an effect when the attempt is traced. When tracing is off, the block runs normally and its logs are kept.

> [!NOTE]
>
> The TypeScript SDK takes a callback instead: [`withoutTracing(fn)`](https://intunedhq.com/docs/main/05-references/runtime-sdk-typescript/pause-tracing#withouttracing).

**Returns**

Returns an async context manager. The block's own values are unaffected.

**Raises**

Propagates anything the block raises. If tracing can't be paused, entering the block raises and the body doesn't run, so the code you meant to hide never runs while it could still be recorded.

**Example**

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

async with without_tracing():
    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()
```

## What pausing covers

While a `without_tracing` block is running:

* **Browser trace**: no actions, DOM snapshots, screenshots, or network requests are recorded. The trace viewer shows a gap.
* **Automation logs**: anything written to stdout or stderr, including `print` and `logging` output, is left out of the attempt's logs. This applies to deployed runs. Under `intuned dev`, output still prints in your terminal.

This covers everything on the attempt, not only the code inside the block. Code running at the same time outside the block, for example in another `asyncio` task, is also left out.

What is still recorded:

* **What the block leaves behind.** A field it filled, or a token still on screen, appears in the first snapshot after the block. Navigate away or clear the field before the block ends.
* **The session it creates.** Cookies and auth headers on later requests are recorded as usual.
* **Your automation's source code.** Traces include the API's source files, so a secret written directly in your code appears in the trace. Pass secrets in through parameters, an auth session, or environment variables.
* **The Run and Attempt records**: status, timing, and retry history.
* **Your automation's return value**, and the Run's `parameters`. 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 stored on the attempt, even if it was raised inside the block.

> [!WARNING]
>
> Never put a secret in an exception message. Error details are stored on the attempt whether or not tracing is paused.

## Behavior notes

* **Nesting works.** Nested and concurrent blocks are safe: tracing pauses when the first one starts and resumes when the last one ends.
* **Keep the work inside the block.** If the attempt ends while a block is still open, for example in a task that was never awaited, nothing recorded after the block started is kept.
* **Each attempt is separate.** Every attempt has its own trace, so a retry starts traced.
* **Local development included.** Under `intuned dev`, a locally captured trace has the same gaps a deployed one would.

## 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.