# Data handling

> Where Corfedo stores your code, conversations, audit entries and credentials, what leaves the installation, and what deleting removes.

Source: https://docs.corfedo.ai/operate/security/data-handling/

A self-hosted installation keeps your data in its own database, index storage and indexer's cache, and its keys in its installation directory or Secrets. Data leaves it only for the forges and identity providers you connect, the AI providers you add, and the addresses that describe coding agents and the CLI.

## What is stored where

| Data | Stored in |
| --- | --- |
| Indexed code: file text, symbols, modules | Index storage (the bucket on Kubernetes), one index per build. Credentials found in the code are masked first when [credential masking](https://docs.corfedo.ai/workspace/privacy/credential-masking/) is on. |
| Repository copies fetched from the forge | The indexer's cache. It is rebuilt when lost and needs no backup. |
| Dependencies, security findings and advisories | PostgreSQL |
| Workspaces, members, groups, roles, sources and repositories | PostgreSQL |
| Conversations, answers, files Corfedo AI wrote and AI traces | PostgreSQL |
| Recent searches | PostgreSQL, visible only to the person who searched |
| Audit log | PostgreSQL, kept for the [installation's retention](https://docs.corfedo.ai/operate/settings/) or indefinitely |
| Forge, AI provider, sign-in and Slack credentials | PostgreSQL, encrypted with the installation's encryption key, see [Where secrets are kept](https://docs.corfedo.ai/operate/security/#where-secrets-are-kept) |
| People's accounts and passwords | Your identity provider, or the bundled account service's own database |

> **Warning:** A backup holds the installation's keys and code from conversations, and your indexes when it includes a recovery set or a copy of the bucket. Store it like a secret, on a [single host](https://docs.corfedo.ai/operate/single-host/backup-and-recovery/) and on [Kubernetes](https://docs.corfedo.ai/operate/kubernetes/backup-and-recovery/).

## What leaves the installation

| To | What | When |
| --- | --- | --- |
| Your forges | Requests with the source's credential, to list repositories and fetch commits | On each source's schedule and for each build |
| AI providers you add | The question, the conversation so far, the profile's instructions and the code and results the tools returned | Each time Corfedo AI answers |
| Your identity provider | Sign-in requests | Each sign-in and test sign-in |
| Slack | Answers and replies, written in the Slack workspace that asked | Each question in Slack |
| `clients.corfedo.ai` for the Corfedo CLI, and the address each coding agent gives | A download of the client's description | When a coding agent or the CLI signs in |
| The OSV export at `storage.googleapis.com` | Downloads of advisory data, with no workspace data | When advisories are refreshed |

The AI provider sees only code the asking person may read, after masking. Its own terms govern what it does with the requests. A profile's provider and model decide where requests go, so choose providers that meet your requirements.

## What administrators can see

- **The audit log** records changes and who made them, and optionally the network address they came from, see [Privacy](https://docs.corfedo.ai/workspace/privacy/).
- **AI traces** show how an answer was produced. What members see of their own and administrators see of everyone's is set on the Privacy page. Opening the content of another member's trace is recorded in the audit log.
- **Conversations** open only for the person who had them. When **All traces** includes **Content** on the [Privacy](https://docs.corfedo.ai/workspace/privacy/) page, administrators and AI administrators can read the content of their traces. Each such view is recorded in the audit log.

## What deleting removes

| You delete | Removed | Kept |
| --- | --- | --- |
| A conversation | The conversation, its answers, its files and its traces | Audit entries and spend counters |
| A repository | The repository and its builds. Search stops finding it. | Audit entries |
| A single-host installation, with `install.sh uninstall` | Its containers and network | The data volumes, the installation directory and the recovery sets, until you delete them, see [Cleanup and uninstall](https://docs.corfedo.ai/operate/single-host/cleanup-and-uninstall/) |
| A Kubernetes release, with `helm uninstall` | Its workloads | The database, the bucket's contents, the Secrets and the volume claims, see [Uninstall](https://docs.corfedo.ai/operate/kubernetes/upgrade-and-operate/#uninstall) |

Masking cannot be undone from Corfedo: a masked credential is not stored in the index. Read the file in your forge when you need it.

## Related

- [Security](https://docs.corfedo.ai/operate/security/) covers each deployment's network exposure and secrets.
