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

```typescript theme={null}
import { withoutTracing } from "@intuned/runtime";

await withoutTracing(async () => {
  await page.getByLabel("Password").fill(params.password);
  await page.getByRole("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 `withoutTracing` when you only need a gap.

## Function reference

### withoutTracing

```typescript theme={null}
import { withoutTracing } from "@intuned/runtime";

function withoutTracing<T>(fn: () => Promise<T>): Promise<T>;
```

Runs `fn` with tracing paused, and resumes tracing when `fn` finishes. Tracing resumes even if `fn` throws, so a failure in the middle of a sensitive step doesn't leave the rest of the attempt unrecorded. The error is rethrown.

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

**Parameters**

**fn** `() =\> Promise\<T\>` *required*

The code to run without tracing.

**Returns**

Returns whatever `fn` returns.

**Throws**

Rethrows anything `fn` throws. If tracing can't be paused, `withoutTracing` throws without running `fn`, so the code you meant to hide never runs while it could still be recorded.

**Example**

```typescript theme={null}
import { withoutTracing } from "@intuned/runtime";
import { TOTP } from "totp-generator";

const code = await withoutTracing(async () => {
  const otp = TOTP.generate(params.secret, { digits: 6 }).otp;
  await page.getByLabel("One-time Password").fill(otp);
  await page.getByRole("button", { name: "Login" }).click();
  return otp;
});
```

## What pausing covers

While a `withoutTracing` 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 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 a parallel `Promise.all` branch, 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-typescript/ephemeral-parameters.md).
* **Errors.** A thrown error's message and stack trace are stored on the attempt, even if it was thrown inside the block.

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

## Behavior notes

* **Nesting works.** Nested and overlapping blocks are safe: tracing pauses when the first one starts and resumes when the last one ends.
* **Always await it.** If the attempt ends while a block is still running, for example because `withoutTracing` wasn't 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-typescript/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.