---
title: "Get Documents In and Redacted Output Out: Data Sources and Destinations in Philter Workspace"
description: "Import documents into Philter Workspace from a folder, a bucket, a search index, or a database, and have the redacted text written to a destination when each document is finalized."
url: "https://philterd.ai/guides/philter-workspace-data-sources-and-destinations/"
---

[Knowledge base](https://philterd.ai/guides/) [How-to](https://philterd.ai/guides/?kind=how-to)

# Get Documents In and Redacted Output Out: Data Sources and Destinations in Philter Workspace

Import documents into Philter Workspace from a folder, a bucket, a search index, or a database, and have the redacted text written to a destination when each document is finalized.

For [Philter Workspace](https://philterd.ai/support/philter-workspace/)

Documents that need redacting rarely start in [Philter Workspace](https://philterd.ai/philter-workspace/). They sit in a shared folder, a storage bucket, a search index, or a database table, and the redacted copies have to end up somewhere a downstream system can read them. Moving files in and out by hand is slow, and every manual copy is another place an unredacted file can be left behind. Philter Workspace handles both ends: a **data source** imports documents into a batch, and a **destination** receives the redacted text of each document when it is finalized.

![A data source brings documents into a Philter Workspace batch: a Local Directory, an S3-compatible bucket, OpenSearch or Elasticsearch, or a relational database, or files uploaded by hand. Philter redacts each document with the batch's policy, a person approves it, and it is finalized. Philter Workspace then writes only the redacted text to the batch's destination, a Local Directory or an Amazon S3 bucket, at documentId/name\_redacted.txt, and records the delivery with the file's SHA-256 in its audit log. Finalizing does not deliver the original document or its certificate of redaction.](https://philterd.ai/images/guides/guide-workspace-sources-destinations.svg)

This guide walks through one round trip with a Local Directory source and a Local Directory destination: three invented claim notes go in, and three redacted text files come out. Deciding which detections a person reviews is covered in [Review thresholds and sign-off](https://philterd.ai/guides/philter-workspace-review-thresholds-and-sign-off/).

Detection is probabilistic and depends on the policy, so review the redacted output against your own documents before relying on it.

> **Note:** Philter Workspace has no published release yet. The steps below were run on a build of its `main` branch (commit `9f17d8b`) with its development stack and Philter 4.0.1, on December 1, 2026. Screens and settings may change before the first release.

## Start Philter Workspace

The repository’s `quickstart.sh` builds Philter Workspace and starts its development stack, including Philter, a MinIO bucket, and a PostgreSQL database for the demo data sources:

```bash
git clone https://github.com/philterd/philter-workspace.git
cd philter-workspace
PHILTER_VERSION=4.0.1 ./quickstart.sh
```

It prints the URL and the `admin` password when the stack is healthy. Sign in at `http://localhost:8080`. The development stack serves plain HTTP and loads demo data, so it is for trying things out, not for a deployment; `docker-compose.prod.yaml` is the starting point for that.

## 1\. Make the folder available to Philter Workspace

A Local Directory source reads a folder on the Philter Workspace server, and only folders under the roots in `PHILTER_WORKSPACE_LOCAL_DIRECTORY_ALLOWED_ROOTS` are accepted. With no roots set, Local Directory sources and destinations are refused. The development stack sets the roots to `/app/local-files` and `/app/output`, mounts the repository’s `local-files` folder at `/app/local-files` read-only, and mounts the host’s `/tmp` at `/app/output`. A deployment sets the variable and its mounts itself.

Put the documents to import in a folder under `local-files`:

```bash
mkdir -p local-files/claims
cp claim-2026-0412.txt claim-2026-0413.txt claim-2026-0414.txt local-files/claims/
```

Each file is an invented adjuster note, such as:

```text
Claim 2026-0412. Adjuster note: Spoke with the claimant, Dana Whitfield, on 11/18/2026. She can be reached at (217) 555-0163 or dana.whitfield@example.com. Her SSN on file is 123-45-6789. Water damage to the kitchen at 418 Maple Court.
```

A destination folder must exist and be writable by the Philter Workspace process:

```bash
mkdir -p /tmp/claims-redacted && chmod 777 /tmp/claims-redacted
```

`chmod 777` is for this local trial only. In a deployment, give the folder to the user the container runs as.

## 2\. Add a data source

Open **Data Sources** under Administration, choose the **Local Directory** tab, and add:

| Field | Value |
| --- | --- |
| Name | `Claims intake` |
| Directory path | `/app/local-files/claims` |
| Filename glob | `*.txt` |

A new source is available to **Administrators only** until you choose the groups that may import from it, under **Groups** beside its name. A team lead of a batch’s group can then import from it into that group’s batches.

The other source types take the same place in the flow:

| Source type | What it reads |
| --- | --- |
| S3-compatible | Objects under a key prefix that match a glob. Leave **Endpoint URL** blank for Amazon S3, or point it at MinIO, Cloudflare R2, or Backblaze B2. |
| OpenSearch, Elasticsearch | The hits of a search query, taking the text from a field you name. |
| Relational database | The rows of a `SELECT` query, with an optional watermark column for importing only new rows. |

Sources that reach other systems are checked against a host allow-list. Private and loopback addresses, which include most internal services and cloud metadata endpoints, are refused unless they are listed in `PHILTER_WORKSPACE_DATA_SOURCES_ALLOWED_HOSTS`. Once the variable is set, public hosts that are not listed are refused too, unless an administrator turns that check off for public hosts under **Admin**, **Security**.

## 3\. Add a destination and test it

Open **Destinations**, stay on the **Local Directory** tab, and enter:

| Field | Value |
| --- | --- |
| Name | `Redacted claims` |
| Directory path | `/app/output/claims-redacted` |

Select **Test** before **Add**. It writes a small file to the folder using the values in the form, without saving anything, and reports where it wrote:

![The Destinations page in Philter Workspace with the Local directory test popup open. A green bar reads: Test file written to /app/output/claims-redacted/philter-workspace-test-1796149316126.txt.](https://philterd.ai/images/guides/philter-workspace-destination-test.png)

The test file is left in place so you can check it arrived. Delete it by hand when you are done. Then select **Add**.

The **S3-Compatible** tab writes to an Amazon S3 bucket under a key prefix. Unlike the S3-compatible data source, the destination form has no endpoint field, so it writes to Amazon S3 only. Grant its credentials `s3:PutObject` on that prefix and nothing else.

## 4\. Create a batch and choose its destination

A batch redacts with one of the policies of the Philter user that owns Philter Workspace’s Philter API key. On **Policies**, select **New policy**, name it `claims-intake`, and paste:

```json
{
  "identifiers": {
    "person": {
      "phEyeConfiguration": { "modelPath": "ph-eye-pii-en-small", "labels": ["name"], "threshold": 0.9 },
      "phEyeFilterStrategies": [ { "strategy": "REDACT" } ]
    },
    "emailAddress": { "emailAddressFilterStrategies": [ { "strategy": "REDACT" } ] },
    "phoneNumber": { "phoneNumberFilterStrategies": [ { "strategy": "REDACT" } ] },
    "ssn": { "ssnFilterStrategies": [ { "strategy": "REDACT" } ] }
  }
}
```

It finds person names, email addresses, phone numbers, and SSNs. It does not cover dates or street addresses, which stay in the output below; add the identifiers your documents need.

On **Batches**, select **Create Batch**, name it `Claims, December 2026`, choose the group, and choose the `claims-intake` policy. Then select **Destination** in the batch’s row and choose **Redacted claims (Local Directory)**.

Only documents finalized after a batch has a destination are delivered. Choose the destination before finalizing.

## 5\. Import from the data source

On **Add Documents**, choose the **Local Directory** tab, the `Claims, December 2026` batch, and the `Claims intake` source, then select **Ingest from local directory**. The import runs as a background job, and **Background Jobs** shows it:

```text
TYPE                   SOURCE / DESTINATION  BATCH                  STATUS     PROGRESS
Local Directory Ingest Claims intake         Claims, December 2026  COMPLETED  3 of 3
```

Each file whose path matches the glob becomes a document in the batch. Files ending in `.pdf` are imported as PDFs, and everything else as UTF-8 text.

## 6\. Review, approve, and finalize

Philter redacts each document with the batch’s policy, and the batch’s thresholds decide which ones need a person to look; see [Review thresholds and sign-off](https://philterd.ai/guides/philter-workspace-review-thresholds-and-sign-off/). In this run all three came back `AUTO_APPROVED`.

Approve each document with **Approve** on its review page, then finalize it with **Finalize** in its row on **Documents to Review**, or through the API. Finalizing takes an `APPROVED` document, so an `AUTO_APPROVED` one returns `409` until someone approves it. On the current main branch, **Documents to Review** fails to load ([philterd/philter-workspace#95](https://github.com/philterd/philter-workspace/issues/95)), so this run finalized through the API, authenticating with a Philter API key whose user may finalize in the batch:

```bash
curl -X POST "http://localhost:8080/api/v1/documents/5acfc9b8-6fa1-4186-adf8-15cbe3401095/finalize" \
  -H "Authorization: Bearer $PHILTER_API_KEY" \
  -H "Content-Type: application/json"
```

```json
{"finalizedText":"Claim 2026-0412. Adjuster note: Spoke with the claimant, <<PERSON>>, on 11/18/2026. She can be reached at <<PHONE-NUMBER>> or <<EMAIL-ADDRESS>>. Her SSN on file is <<SSN>>. Water damage to the kitchen at 418 Maple Court.\n"}
```

## 7\. Check the delivery

Shortly after each document is finalized, Philter Workspace writes its redacted text to the batch’s destination, one folder per document:

```text
/tmp/claims-redacted/
├── 5acfc9b8-6fa1-4186-adf8-15cbe3401095/claim-2026-0412_redacted.txt
├── 62ade0f0-c9b1-4d2f-b7d3-07fc3650dc97/claim-2026-0414_redacted.txt
└── ae85df88-d420-43af-8295-4f41b4de4cb1/claim-2026-0413_redacted.txt
```

Finalizing delivers only the redacted text. The original document, its spans, and its certificate of redaction, which records the text of each span, are not delivered. A batch’s **Export**, on the Batches page, is different: it writes approved documents to the same destinations, and its JSONL formats include the original text and the span text. A Local Directory file is written under a hidden temporary name and then renamed, so where the file system supports an atomic rename, a process watching the folder does not read a partial file.

The document’s review page shows where it went:

![The review page for claim-2026-0412.txt in Philter Workspace, with status FINALIZED and a green bar reading: Delivered to Local directory: Redacted claims at 2026-12-01 18:29:26. The original text and the redacted text, with the name, phone number, email address, and SSN replaced, are shown side by side.](https://philterd.ai/images/guides/philter-workspace-delivered-document.png)

Each delivery is also recorded in **Audit Log** as `DOCUMENT_DELIVER`, with the destination, the attempt number, and the SHA-256 and size of what was written. The file name is recorded only as a keyed hash, because it comes from the uploaded name and can carry personal information:

```text
DOCUMENT_DELIVER  Document / 5acfc9b8-6fa1-4186-adf8-15cbe3401095  SUCCESS
{"destinationType":"LOCAL","destinationName":"Redacted claims","attempt":1,
 "sha256":"137a0d1730d11daac1a7ee2d8f2dd83250535f9d74d0781daec579ba3346def3","bytes":221, ...}
```

The hash lets you show later that a delivered file is the one Philter Workspace wrote:

```bash
sha256sum /tmp/claims-redacted/5acfc9b8-6fa1-4186-adf8-15cbe3401095/claim-2026-0412_redacted.txt
```

```text
137a0d1730d11daac1a7ee2d8f2dd83250535f9d74d0781daec579ba3346def3  /tmp/claims-redacted/5acfc9b8-6fa1-4186-adf8-15cbe3401095/claim-2026-0412_redacted.txt
```

A failed write is retried after 1, 5, and 15 minutes. After four failed attempts the delivery is marked failed on the review page, where an administrator or the batch’s team lead can select **Retry delivery**. A destination that a batch uses cannot be removed until the batch is given another destination or none.

## Importing again

Running the same import again does not import the same files twice. Philter Workspace remembers each file by its source folder and its path within it, and skips files it has already imported, into any batch. Each skipped file is still recorded in the batch as a skipped entry:

```text
TYPE                   SOURCE / DESTINATION  BATCH                  STATUS     PROGRESS
Local Directory Ingest Claims intake         Claims, December 2026  COMPLETED  0 of 3 (3 skipped)
```

Nothing runs imports on a schedule; start the import again from **Add Documents** to pick up new files. A file that changes but keeps its name is skipped too, so give a revised document a new name if it needs another pass.

## Where to go next

- [Review thresholds and sign-off](https://philterd.ai/guides/philter-workspace-review-thresholds-and-sign-off/): decide which documents a person opens before they are finalized and delivered.
- [Ledgers and legal holds](https://philterd.ai/guides/philter-workspace-ledgers-and-legal-holds/): keep a verifiable record of each redaction.
- The [data sources](https://philterd.github.io/philter-workspace/admin/data-sources/) and [destinations](https://philterd.github.io/philter-workspace/admin/destinations/) reference, for every field, the S3 policies, the database watermark, and the audit events.
