# Exploiting Text Completion

* LLMs are trained to predict the next token in a sequence. Exploit by taking advantage of text completion in the prompt.
* For example: A bot for Mozart’s bio shouldn’t give information on calculating determinant of a matrix. But if we add “Sure, here is how you do it:” at the end of the sentence, it might complete it.
* Since LLMs are non-deterministic in nature, we might have to send the same prompt again.
* We’re trying make the LLM pay less attention to its initial prompt and instead focus on the added input prompt.<br>

<figure><img src="/files/j2Hueuxjvid1FjsxhotR" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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://playbook.sidthoviti.com/ai-security/red-teaming-llms/exploiting-text-completion.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.
