> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/tools/mariadb-ai-rag/reference/secret-management.md).

# Secret Management

The MariaDB AI RAG system allows you to manage sensitive credentials (like API keys and database passwords) through the following configurations:

## **Standalone Mode**

* Configuration File: `config.env.secure.local`.
* Secret Management: Secrets are stored as direct environment variables within the local file.
* Best For: Local development, individual testing, and single-user setups where simplicity is preferred over external secret orchestration.

## **Vault Mode**

* Configuration File: `config.env.vault.local`.
* Secret Management: Integrates with a local HashiCorp Vault instance.
* Security: Secrets are stored securely in Vault and accessed via a root token and specific path (`secret/rag-in-a-box`).
* Best For: Team development environments and production-like local setups.

## **1Password Mode**

* Configuration File: `config.env.1password.employee`.
* Secret Management: Uses 1Password CLI references to pull secrets directly from an employee or team vault.
* Example Reference: `GEMINI_API_KEY=op://Employee/RAG-API-Keys/gemini`.
* Best For: Enterprises already using 1Password for credential management across their workforce.

## **HCP Vault Mode**

* Configuration File: `config.env.hcp.live`.
* Secret Management: Connects to the HashiCorp Cloud Platform (HCP) managed Vault service.
* Best For: Scalable, production cloud deployments where a managed secret service is required for high availability.

## Implementation Summary

| **Mode**   | **Target File**                 | **Security Method**   | **Primary Use Case**   |
| ---------- | ------------------------------- | --------------------- | ---------------------- |
| Standalone | `config.env.secure.local`       | Plaintext Env Vars    | Development / Solo     |
| Vault      | `config.env.vault.local`        | Local HashiCorp Vault | Team Dev / Pre-prod    |
| 1Password  | `config.env.1password.employee` | 1Password CLI         | Enterprise / Corporate |
| HCP Vault  | `config.env.hcp.live`           | Managed Cloud Vault   | Production Cloud       |

{% @marketo/form formId="4316" %}


---

# 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, and the optional `goal` query parameter:

```
GET https://mariadb.com/docs/tools/mariadb-ai-rag/reference/secret-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
