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

# sentinelize • AI Agent SDK

> sentinelize: Return an opaque sentinel token standing in for ``secret``.

# sentinelize

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**secrets**](../modules/secrets) module.

Return an opaque sentinel token standing in for `secret`.

The model only ever sees the returned token; the plaintext is held in a
per-process map and never placed in prompts, tool arguments, transcripts or
logs. Calling again with the same secret returns the same token (stable
within a process). The secret is also registered for log redaction so an
accidental leak of the plaintext is still masked.

Any non-empty string is sentinelised — the opaque, randomly-minted token
never collides with ordinary text, so there is no minimum length (a short
PIN or password must be hidden just as a long key is). Only an empty or
non-string value is returned verbatim.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def sentinelize(secret: str) -> str
```

## Parameters

<ParamField query="secret" type="str" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  The result of the operation.
</ResponseField>

## Uses

* `_stdlib_secrets.token_hex`
* `register_secret_for_redaction`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/secrets.py#L421">
  `praisonaiagents/secrets.py` at line 421
</Card>


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