---
title: "Find Sensitive Data in API Traffic with Model-Assisted DLP | Speedscale"
description: "Use local model-assisted DLP to find names in support notes. Compare proxymock recommendations, then preview whole-field redaction on synthetic traffic."
canonical: "https://speedscale.com/blog/find-sensitive-data-in-api-traffic/"
---

[Site index](https://speedscale.com/blog/llms.txt) | [Markdown](https://speedscale.com/blog/find-sensitive-data-in-api-traffic/index.md) | [Canonical page](https://speedscale.com/blog/find-sensitive-data-in-api-traffic/)

![A glass inspection square highlights one line on a sheet of abstract support notes.](https://speedscale.com/_astro/featured-image.DOzkzyDZ_Z2fvIzL.webp)

# Find Sensitive Data in API Traffic with Model-Assisted DLP

Nov 24, 2026

[By Matt LeRay](https://speedscale.com/blog/author/matt-leray/)

[Security](https://speedscale.com/blog/category/security/) [API testing](https://speedscale.com/blog/category/api-testing/)

* * *

A support ticket might put a customer’s name in a sentence like “Call Ada Rivera about the refund on Tuesday.” The JSON key is just `note`, and the sentence has no recognizable format such as an email address. A pattern scan can miss it, even when the field is worth redacting before the recording becomes a test fixture.

In this how-to, you’ll run the same four synthetic support requests through proxymock twice. The first run uses value patterns and JSON key names. The second adds a local model to check fields those rules leave undecided. You’ll then preview a rule that masks the note while preserving the priority and the response. [Feature Spotlight on YouTube](https://www.youtube.com/shorts/HGl5pBxmfpc)

## 1\. Open the mock-lab recording

You’ll need Git, jq, an installed proxymock CLI, and Ollama with enough memory to run Qwen3 14B. Ollama lists the model download at 9.3 GB. Make sure the CLI help includes both `--dlp-model-provider` and `--dlp-model-exposure`. [Install proxymock](https://docs.speedscale.com/proxymock/getting-started/installation/) · [Install Ollama](https://ollama.com/download) · [Qwen3 14B model](https://ollama.com/library/qwen3:14b)

From the directory where you want the clone, run:

```
git clone https://github.com/speedscale/mock-lab.git
cd mock-lab/labs/dlp-field-discovery
proxymock version --client
proxymock recommendations list --help
```

Run the remaining proxymock commands from this lab directory. The four bundled request/response pairs (RRPairs) are ready to analyze. Two notes name a fictional person. The other two are routine ticket updates. The responses include a prose `summary` that gives the model an example of ordinary text alongside the sensitive notes. [Lab and synthetic recording](https://github.com/speedscale/mock-lab/tree/main/labs/dlp-field-discovery)

LLM prompt for this step

```
Read this workspace's instructions. Clone https://github.com/speedscale/mock-lab.git into an isolated directory, then enter labs/dlp-field-discovery. Confirm Git, jq, proxymock, and Ollama are available. Check proxymock version --client and recommendations list --help for --dlp-model-provider and --dlp-model-exposure before adapting any command. Confirm the bundled recording has four synthetic RRPairs. Report the commands, the lab path, and anything you could not verify.
```

## 2\. Run the pattern and key-name baseline

Unset the model provider for this invocation so a previous shell setup cannot enable it. Filter the output down to the fields you’ll compare.

```
env -u SPEEDSCALE_DLP_MODEL_PROVIDER proxymock recommendations list \
  --in ./proxymock --type transform -o json \
  | jq '{analyzed, findings: [.items[] | {title, description}]}'
```

The baseline analyzes four RRPairs and returns an empty `findings` array. The notes contain names in prose, and the recording has no separate name or email field to recognize. This result tells you what this discovery pass found on this fixture. It says nothing about whether the input is safe to share. [Discover Sensitive Data](https://docs.speedscale.com/guides/dlp/discovering-pii/)

LLM prompt for this step

```
From mock-lab/labs/dlp-field-discovery, use env -u SPEEDSCALE_DLP_MODEL_PROVIDER to run proxymock recommendations list --in ./proxymock --type transform -o json. Pipe the output through jq to print analyzed and each item's title and description. Check CLI help before changing flags. Confirm four RRPairs were analyzed and the transform list is empty. Report the command, the result, and any discrepancy.
```

## 3\. Check the same recording with a local model

If Ollama isn’t running already, start it with `ollama serve` in a separate terminal. Leave that terminal open and return to the lab directory in the original terminal.

```
ollama pull qwen3:14b
ollama list

SPEEDSCALE_DLP_MODEL_REASONING_EFFORT=none proxymock recommendations list \
  --in ./proxymock --type transform -o json \
  --dlp-model-provider openai-compatible \
  --dlp-model-base-url http://127.0.0.1:11434/v1 \
  --dlp-model qwen3:14b \
  --dlp-model-exposure samples \
  | jq '{analyzed, findings: [.items[] | {title, description, direction, rrpairCount}]}'
```

Look for one `FREE_TEXT_PII` recommendation whose reason says two of the four sampled values mention a person’s name. The model may list another kind alongside it, such as a date of birth suggested by “on Tuesday.” The recommendation covers the whole field, including notes whose samples happened to be clean. Its `direction` is `in` and its `rrpairCount` is 4, so it applies to the four inbound requests. The response `summary` should stay out of the findings.

The list doesn’t print the field path. To confirm the finding is the request `note` on `POST /tickets`, copy the lab to a scratch directory and accept the recommendation there. Use `proxymock recommendations accept --in ./proxymock --id <id>` with the same model flags, taking the ID from `.items[].id`. The blueprint it writes under `proxymock/blueprints/` filters `POST /tickets` on `support.example` and applies `req_body`, then `json_path` with `note`, then `dlp_field`. Model responses can vary, so check the field and endpoint before continuing.

Samples mode is what lets proxymock check the sentences. It is already the default for `openai-compatible`, and other providers default to `metadata`, so the command sets it explicitly. In this lab the model endpoint is on loopback, and the samples are synthetic. If you point the same command at a hosted endpoint, that endpoint receives the samples. `metadata` mode omits recorded values and skips the free-text sample check. The model can still flag a field such as `note` from its name and location, but it can’t confirm that the values contain personal data.

LLM prompt for this step

```
From mock-lab/labs/dlp-field-discovery, check whether Ollama is running on 127.0.0.1:11434 and start ollama serve only if needed. Pull qwen3:14b and check ollama list. Run the post's sample-mode proxymock command against ./proxymock, with reasoning effort none and the loopback endpoint. Use jq to print analyzed and each finding's title, description, direction, and rrpairCount. Check CLI help before changing flags. Report whether a FREE_TEXT_PII finding covers four inbound RRPairs, accept it only in a scratch copy of the lab to confirm the blueprint targets the POST /tickets request note, and report whether the response summary stayed absent. Report any startup error or unexpected result.
```

## 4\. Preview redaction on the recording

The lab includes a `note-redaction.json` rule for this fixture. It reads the request body, selects `note`, and runs the `dlp_field` transform. Review that path before testing the rule.

```
cat ./note-redaction.json

proxymock dlp test --dlp-config ./note-redaction.json \
  --in ./proxymock/recording

proxymock dlp test --dlp-config ./note-redaction.json \
  --show-redacted ./proxymock/recording/support.example/2026-11-24_12-00-01.000001Z.md
```

The summary reports **four RRPairs and four fields that would be redacted**. Two note samples contain names, but the rule masks `note` wherever it occurs in the fixture. In the detailed preview, the first request’s note becomes `REDACTED-…`, the priority stays `normal`, and the response still contains `TICKET-001` and status `queued`. The preview leaves the recording intact. [Author and validate local DLP rules](https://docs.speedscale.com/proxymock/guides/local-rules/)

Keep that distinction when you use model-assisted DLP on your own test traffic. A finding gives you a field to investigate. A rule preview shows exactly which values your chosen path changes. Check a few clean cases alongside the sensitive ones so you can see whether the rule would also remove data your tests need. [Scope DLP rules by team or service](https://speedscale.com/blog/team-based-dlp-group-rules/)

LLM prompt for this step

```
From mock-lab/labs/dlp-field-discovery, inspect ./note-redaction.json. Use proxymock dlp test with --in ./proxymock/recording, then run the post's --show-redacted command for 2026-11-24_12-00-01.000001Z.md. Check tool help before changing flags. Confirm four would-be redactions, that the first note becomes REDACTED- followed by a hash, and that priority, ticket ID, and response status stay the same. Do not write back to the fixture. Report the commands, observed counts, and any discrepancy.
```

## Run this workflow with an LLM

Whole-workflow LLM prompt

```
Read https://speedscale.com/blog/find-sensitive-data-in-api-traffic/ and inspect the workspace's instructions first. Run all four steps in order in an isolated mock-lab checkout using the supplied synthetic recording. Compare the baseline and sample-mode findings, then run both rule previews. Check installed tool help before adapting a command. Report the exact commands, analyzed counts, finding and field location, before-and-after checks, and anything you could not verify. Keep the model endpoint on loopback and the recording intact.
```

## Frequently asked questions

### Does model-assisted DLP change my recording?

Discovery produces recommendations. The DLP test command previews a rule and leaves the input RRPairs intact. Accepting a recommendation adds a transform to the workspace tuning blueprint for replay and mocking.

### What does the local model see?

In samples mode, the configured endpoint receives field information plus bounded sample values. The free-text check sends up to 10 of a field's sampled values, each cut at 1,000 characters, in a separate request. In metadata mode, proxymock sends field information without recorded values and skips the free-text sample check.

### Why redact the entire support note?

Finding a name in a few samples tells you that the field can carry personal data. Redacting the entire field covers values the model never saw. Use a different policy if your tests need the original prose.

### Is a clean recommendation list proof the traffic is safe?

Discovery samples values and can miss sensitive fields or unusual messages. Review unflagged traffic and test explicit rules for fields your application treats as sensitive.

## Table of Contents

## Stop writing API mocks by hand

proxymock records real traffic from your running app and replays it as mocks for HTTP, gRPC, Postgres, Kafka, and more. Install locally, activate once, and start recording.

[Install proxymock](https://docs.speedscale.com/proxymock/getting-started/installation/) [View the docs](https://docs.speedscale.com/proxymock/)
