# OpaquePrompts

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/llms/opaqueprompts/OpaquePrompts)

LLM that uses OpaquePrompts to sanitize prompts.

Wraps another LLM and sanitizes prompts before passing it to the LLM, then
    de-sanitizes the response.

To use, you should have the ``opaqueprompts`` python package installed,
and the environment variable ``OPAQUEPROMPTS_API_KEY`` set with
your API key, or pass it as a named parameter to the constructor.

## Signature

```python
OpaquePrompts()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import OpaquePrompts
from langchain_openai import ChatOpenAI

op_llm = OpaquePrompts(base_llm=ChatOpenAI())

## Extends

- `LLM`

## Properties

- `base_llm`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/opaqueprompts/OpaquePrompts/validate_environment)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/llms/opaqueprompts.py#L14)