> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/platform/liquid/objects/secrets.md).

# Secrets object

The `secrets` object contains write-only shop-level secrets from [Globals and secrets](/platform/globals-and-secrets.md).

Use secrets for credentials and signing material:

```liquid
{{ secrets.api_token }}
```

If the secret exists, this returns an opaque secret reference, not the raw secret value. Mechanic turns that reference into the real value only inside supported actions and filters, such as HTTP actions, specific FTP connection fields, and signing filters like `hmac_sha256` or `rsa_sha256`.

Missing secrets return `nil`, so guards like `{% if secrets.api_token %}` work as expected.

Actions that do not support shop secrets, logs, and ordinary Liquid output receive the placeholder. This lets tasks pass references around without exposing secret values in previews, stored action options, logs, or task output.

For example, this HTTP action sends the resolved value in the outbound request, while Mechanic stores and displays only placeholders or redacted values:

```liquid
{% action "http" %}
  {
    "method": "post",
    "url": "https://api.example.com/orders",
    "headers": {
      "Authorization": {{ "Bearer " | append: secrets.api_token | json }}
    }
  }
{% endaction %}
```

Task options can also let a merchant choose a secret:

```liquid
{{ options.api_token__secret_required }}
```

That option returns the selected secret reference at runtime. See [Task options](/core/tasks/options.md) for option flag details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.mechanic.dev/platform/liquid/objects/secrets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
