> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/admin/structural-ai-use/structural-ai-data-flow-privacy.md).

# Data flow and privacy in Structural AI

## Overall interaction flows with an LLM <a href="#llm-overall-flows" id="llm-overall-flows"></a>

The following diagrams show the general interaction between Structural and an LLM based on the Structural deployment.

### Structural Cloud <a href="#llm-flow-cloud" id="llm-flow-cloud"></a>

On Structural Cloud, all users use the same LLM, which is managed by Tonic.ai.

<figure><img src="/files/dccrz0dYR7GwATVtG7lQ" alt=""><figcaption><p>Structural Cloud interaction with the LLM</p></figcaption></figure>

### Self-hosted instances that use the hosted LLM <a href="#llm-flow-hosted-llm" id="llm-flow-hosted-llm"></a>

Self-hosted instances can choose to use the LLM that Tonic.ai maintains.

For each customer, requests to the LLM are routed through a SaaS proxy to the hosted LLM in the appropriate region.

<figure><img src="/files/2itHjjTekfkYe9fXhSVO" alt=""><figcaption><p>Self-hosted Structural interaction with the hosted LLM</p></figcaption></figure>

### Self-hosted instances that use their own LLM connection <a href="#llm-flow-customer-llm" id="llm-flow-customer-llm"></a>

Self-hosted instances can also establish their own connection to an LLM.

<figure><img src="/files/lVGEflHG6zatV818N0wk" alt=""><figcaption><p>Self-hosted Structural interaction with a custom LLM connection</p></figcaption></figure>

## Flows for AI features <a href="#flows-ai-features" id="flows-ai-features"></a>

The following flows show the request and results for specific Structural AI features.

### LLM-based sensitivity detection <a href="#flow-llm-detection" id="flow-llm-detection"></a>

Here is a high-level flow of [LLM-based sensitivity detection](/app/generation/identify-sensitive-data/running-the-structural-sensitivity-scan.md#llm-based-sensitivity-detection-medium-confidence).

<figure><img src="/files/eAxsIf7H37m7u5rXcsd2" alt=""><figcaption><p>High-level flow for LLM-based sensitivity detection</p></figcaption></figure>

To complete the analysis, Structural sends the following to the LLM to complete the analysis:

* Database schema.
* By default, sample source data values.
* LLM-based sensitivity rules

To manage LLM-based sensitivity detection:

* You can exclude the sample data, and only send the schema information.
* You can disable it entirely.

For more information go to the information on configuring AI-based functionality for [Structural Cloud](/app/admin/structural-ai-use/structural-cloud-llm-configuration.md) and on [self-hosted instances](/app/admin/structural-ai-use/self-hosted-llm-configuration.md).

### Structural Agent conversations <a href="#flow-agent-conversation" id="flow-agent-conversation"></a>

Here is a high-level overview of a Structural Agent interaction:

<figure><img src="/files/5Ql51jNMdg3ATYdUGDOV" alt=""><figcaption><p>High-level flow for Structural Agent interactions</p></figcaption></figure>

When it sends your prompts to the LLM, to provide context for tasks such as recommending generators, Structural also sends:

* The database schema.
* By default, representative data samples.

You can configure Structural to never send any sample data to the LLM. This configuration would also prevent data from being sent as part of the LLM-based sensitivity detection.&#x20;

For more information go to the information on configuring AI-based functionality for [Structural Cloud](/app/admin/structural-ai-use/structural-cloud-llm-configuration.md) and on [self-hosted instances](/app/admin/structural-ai-use/self-hosted-llm-configuration.md).

### Generator configuration <a href="#flow-generator-config" id="flow-generator-config"></a>

The [Custom Categorical](/app/generation/generators/generator-reference/custom-categorical.md) and [Text Composition](/app/generation/generators/generator-reference/text-composition.md) generators both include a prompt field to use to configure the generator.

Structural sends the prompt to the LLM. The LLM returns the list of values or the template.

<figure><img src="/files/R77bR6ygrVN8MSlulRza" alt=""><figcaption><p>Flow for LLM-assisted generator configuration</p></figcaption></figure>

### Data connection troubleshooting <a href="#flow-data-connection-troubleshooting" id="flow-data-connection-troubleshooting"></a>

When a data connection test fails, Structural provides an option to use the LLM to troubleshoot the issue.

Structural sends to the LLM the connection details and the error. The LLM analyzes the information and returns suggestions for how to resolve the connection issue.

<figure><img src="/files/dQVCjXU3yB9B7hFKgpFV" alt=""><figcaption><p>Flow for LLM-assisted data connection troubleshooting</p></figcaption></figure>

## How Structural stores Agent conversations <a href="#agent-conversation-storage" id="agent-conversation-storage"></a>

Structural stores your Structural Agent conversations on your computer, in your local browser storage.

## How the LLM uses information <a href="#llm-information-usage" id="llm-information-usage"></a>

On Structural Cloud and on our hosted LLM, our usage of information specifically follows the usage policy for [Anthropic on Amazon Bedrock](https://aws.amazon.com/legal/bedrock/third-party-models/).

For all LLM-based interactions, input prompts and generated responses are only used for workspace data analysis and configuration.

Prompts and responses are never used to train the underlying models.

However, as a best practice, we recommend that you do not include highly sensitive values in your manual prompts.


---

# 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://docs.tonic.ai/app/admin/structural-ai-use/structural-ai-data-flow-privacy.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.
