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

# Secrets

Read a secret from a secret store while your automation runs. Intuned resolves the reference with your Project's credentials for the store. Your code gets the secret's value but never sees the credentials.

```python theme={null}
from intuned_runtime import without_tracing
from intuned_runtime.secrets import resolve_secret

async with without_tracing():
    password = await resolve_secret("op://Portal/Login/password")
    await page.get_by_label("Password").fill(password)
```

## Supported stores

The reference's scheme picks the store.

| Store | Reference | Setup |
| - | - | - |
| 1Password | `op://<vault>/<item>/<field>` | [1Password integration](https://intunedhq.com/docs/main/04-integrations/1password.md). AuthSessions don't have to be enabled. |

## Available helpers

* [`resolve_secret`](#resolve_secret) — Read a secret from a secret store
* [`is_secret_reference`](#is_secret_reference) — Check that a string is a supported secret reference

## Function reference

### resolve\_secret

```python theme={null}
from intuned_runtime.secrets import resolve_secret

async def resolve_secret(reference: SecretReference | str) -> str: ...
```

Resolves a secret reference and returns its value. Each call reads from the store again.

> [!WARNING]
>
> **Call it inside [`without_tracing`](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/pause-tracing).** On a traced Run, calling it outside an `async with without_tracing():` block raises, so the secret can't be captured by the browser trace, a screenshot, or an automation log. On a Run that isn't traced, the block isn't required.

**Parameters**

**reference** `str` *required*

The secret reference. For 1Password, a [secret reference](https://developer.1password.com/docs/cli/secret-reference-syntax/): `op://<vault>/<item>/<field>`, or `op://<vault>/<item>/<section>/<field>`, optionally followed by a query such as `?attribute=otp`.

Python type checkers can't check a string's format, so the format is checked when the function runs. `SecretReference` is exported to document intent in your own signatures.

**Returns**

Returns the secret's value as a `str`.

**Raises**

* `ValueError` if `reference` isn't a supported secret reference.
* `SecretResolveError` if the Run is traced and no `without_tracing` block is open.
* `SecretResolveError` if the secret can't be read. This happens when the store's integration isn't enabled, its credentials are missing or can't read the item, or the machine running the Run doesn't answer in time. The message names the reference, never the secret.

> [!NOTE]
>
> For 1Password, every call counts toward your service account's [rate limits](https://developer.1password.com/docs/service-accounts/rate-limits/). Resolve a secret once per Run and reuse it rather than calling it in a loop.

### is\_secret\_reference

```python theme={null}
from intuned_runtime.secrets import is_secret_reference

def is_secret_reference(value: object) -> bool: ...
```

Returns `True` if `value` is a supported secret reference.

## Related

* [1Password integration](https://intunedhq.com/docs/main/04-integrations/1password.md): Set up the vault, the service account, and the token.
* [Pause tracing](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/pause-tracing.md): Control what gets recorded around a sensitive step.
* [Ephemeral parameters](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/ephemeral-parameters.md): For a secret that belongs to a single Run.


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