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

# Ephemeral parameters

> [!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.

Read values that were passed to a Run as `ephemeral_parameters`. Unlike `parameters`, ephemeral parameters are never stored on the Run record, never sent to sinks, and never appear in logs or traces. They exist only for the lifetime of the Run.

Use them for a secret that belongs to a single Run—a portal password supplied by an end user, a one-time code, or a government ID you must not retain.

```python theme={null}
from intuned_runtime import (
    get_ephemeral_parameter,
    invalidate_ephemeral_parameter,
    resume_tracing,
)

password = await get_ephemeral_parameter("portal_password")
await page.get_by_label("Password").fill(str(password))
await invalidate_ephemeral_parameter("portal_password")
resume_tracing()
```

For how to pass them in and how the platform stores them, see [Ephemeral parameters](https://intunedhq.com/docs/main/02-features/ephemeral-parameters.md).

## Available helpers

* [`get_ephemeral_parameter`](#get_ephemeral_parameter) — Read an ephemeral parameter
* [`invalidate_ephemeral_parameter`](#invalidate_ephemeral_parameter) — Delete an ephemeral parameter

## Function reference

### get\_ephemeral\_parameter

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

async def get_ephemeral_parameter(key: str) -> str | int | float | bool | None: ...
```

Reads an ephemeral parameter for the current Run. Returns `None` if the key wasn't passed to the Run, or if it has already been invalidated.

> [!WARNING]
>
> **This function pauses tracing.** Before returning, it calls [`pause_tracing`](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/pause-tracing#pause_tracing) so the value can't be captured by the browser trace, a screenshot, or an automation log. It does **not** resume tracing for you—call [`resume_tracing`](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/pause-tracing#resume_tracing) once you're done with the value, or the rest of the attempt goes unrecorded.

**Parameters**

**key** `str` *required*

The top-level key of the ephemeral parameter, as passed in the Run's `ephemeral_parameters` map.

**Returns**

Returns the value for that key, or `None` if it isn't available. Values are JSON scalars—`str`, `int`, `float`, or `bool`.

**Example**

Scope the whole sensitive section so tracing resumes on its own, even if a step fails:

```python theme={null}
from intuned_runtime import (
    NonRetryableError,
    get_ephemeral_parameter,
    invalidate_ephemeral_parameter,
    tracing_paused,
)
from playwright.async_api import Page


async def login(page: Page, params: dict | None = None, **_kwargs):
    await page.goto("https://portal.example.com/login")
    await page.get_by_label("Username").fill(params["username"])

    async with tracing_paused():
        password = await get_ephemeral_parameter("portal_password")
        if password is None:
            raise NonRetryableError("portal_password ephemeral parameter is required")

        await page.get_by_label("Password").fill(str(password))
        await invalidate_ephemeral_parameter("portal_password")

    await page.get_by_role("button", name="Sign in").click()
    await page.wait_for_url("**/dashboard")
```

### invalidate\_ephemeral\_parameter

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

async def invalidate_ephemeral_parameter(key: str) -> None: ...
```

Deletes an ephemeral parameter from storage immediately. Call it as soon as the value has done its job. Invalidating a key that doesn't exist, or that was already invalidated, does nothing.

> [!WARNING]
>
> Invalidation is scoped to the **Run**, not the attempt, and it cannot be undone. If an attempt invalidates a key and then fails, the retry gets `None` for that key. See [Invalidation and retries](#invalidation-and-retries).

**Parameters**

**key** `str` *required*

The top-level key of the ephemeral parameter to delete.

**Returns**

Returns `None`.

## Invalidation and retries

Ephemeral parameters are stored per Run and shared by every attempt of that Run. That makes invalidation a tradeoff:

* **Invalidate early** and the value is gone the moment you're done with it—but a retry can no longer read it, so the retry fails.
* **Don't invalidate** and every attempt can read the value. It's still deleted automatically when the Run reaches a terminal state, or by its 24-hour TTL if the Run never starts.

Pick based on how the automation is configured:

| Your setup | Recommendation |
| - | - |
| `maximum_attempts: 1` | Invalidate as soon as you've used the value. |
| Retries enabled, and a retry would need the value again | Don't invalidate. Rely on automatic deletion at the end of the Run. |
| Retries enabled, and re-use would be unsafe | Invalidate, and raise [`NonRetryableError`](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/non-retryable-error) if a later attempt finds the value missing. |

## Related

* [Ephemeral parameters](https://intunedhq.com/docs/main/02-features/ephemeral-parameters.md) — Passing them to a Run, storage, and lifetime.
* [Pause tracing](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/pause-tracing.md) — Control what gets recorded around a sensitive step.
* [Environment variables and secrets](https://intunedhq.com/docs/main/02-features/environment-variables-secrets.md) — For secrets that are the same on every Run.
* [Non-retryable errors](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/non-retryable-error.md) — Stop a Run that can't succeed without new input.


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