---
title: "Build and test a redaction policy without writing JSON"
description: "Build a redaction policy in the Redaction Policy Editor, test it on sample text, and download JSON for Philter or Phileas without writing it by hand."
url: "https://philterd.ai/guides/build-and-test-a-redaction-policy-without-json/"
---

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

# Build and test a redaction policy without writing JSON

Build a redaction policy in the Redaction Policy Editor, test it on sample text, and download JSON for Philter or Phileas without writing it by hand.

For [Redaction Policy Editor](https://philterd.ai/support/redaction-policy-editor/)

The [Redaction Policy Editor](https://philterd.ai/redaction-policy-editor/) builds a redaction policy from a form, runs it against text you paste in, and hands you the JSON. This guide takes one policy from the starting form to a downloaded file. It is useful when you know which identifiers you want handled and how, and would rather not learn the policy format first. To learn the format instead, [Writing your first redaction policy](https://philterd.ai/guides/writing-your-first-redaction-policy/) builds the same kind of policy by hand.

## Steps

1. **Open the editor.** Use the hosted copy at [policies.philterd.ai](https://policies.philterd.ai/). It builds and tests the policy on Philterd’s server, so everything you type, including test text, leaves your machine. That is why the page carries a warning not to enter PII. The editor can also be self-hosted on your own network. See the [installation docs](https://philterd.github.io/philterd-redaction-policy-editor/installation/).
   
2. **Name the policy.** Policy Name, at the top of the form, sets the file name of the download. It starts as `default`.
   
3. **Add filters.** The form starts with one filter. Each filter has a PII Type dropdown, so change the first one to Email Address, then click Add Filter for each further type. For this walkthrough add Phone Number, IP Address, and SSN. A type can be used once per policy, except Dictionary and PhEye. Each filter also has a Window Size, an Enabled checkbox, and a Remove Filter button. Some types show extra options when selected, such as Only Strict Matches and Only Valid TLDs for Email Address.
   
   To start from a broader base, Load Preset offers Legal, Financial, and Healthcare. You have to acknowledge that a preset is a starting point and not a complete policy for any industry before it loads, and it replaces the filters already in the form.
   
4. **Choose a strategy for each filter.** Every filter starts with one strategy. The Strategy dropdown offers `REDACT`, `MASK`, and `RANDOM_REPLACE`, and Zip Code adds `TRUNCATE`, `POPULATION`, and `ZERO_LEADING`. The fields shown depend on the choice:
   
   - `REDACT` shows Redaction Format, which starts as `{{{REDACTED-%t}}}`.
   - `MASK` shows Mask, the masking character (`*` by default), and Length.
   - `RANDOM_REPLACE` pseudonymizes the value with a generated stand-in and shows Replacement Scope, set to `CONTEXT` or `DOCUMENT`. The [schema guide](https://philterd.ai/guides/redaction-policy-schema/) explains the difference.
   
   Set Phone Number to `MASK` and leave the others on `REDACT`.
   
5. **Add a condition where one strategy is not enough.** Each strategy has an optional Condition, such as `confidence > 0.8`, and applies only when its condition is met. Click Add Strategy to give a filter a second strategy, for example a conditional `MASK` followed by a `REDACT` with no condition. Remove deletes a strategy, but a filter always keeps at least one.
   
6. **Exclude values you never want redacted.** Open Advanced Options. Ignored Terms and Ignored Patterns each take one entry per line and apply across the policy. A support address that appears in every document is a typical ignored term. The same panel holds Post Filters, PDF Settings, and Splitting Settings.
   
7. **Generate the policy.** Click Generate Policy. The JSON appears under Generated Policy, with Test Policy, Copy to Clipboard, and Download Policy buttons above it.
   
8. **Test it.** Click Test Policy, paste text into Input Text, and click Redact. If you are using the hosted copy, test with made-up text such as:
   
   ```text
   Ticket from dana.lee@example.com: please call me back at (555) 555-0187.
   My SSN on file is 123-45-6789 and I last signed in from 192.0.2.44.
   ```
   
   The result appears in Redacted Text. Click Show Explanation to see the JSON explanation of what the engine found and what it did with each value. Redact tests the form as it stands, so you can change a strategy and click Redact again without regenerating.
   
9. **Download.** Click Generate Policy again after your last change. Copy to Clipboard and Download Policy take the JSON shown under Generated Policy, not the live form, so skipping this exports the earlier version. Download Policy saves the file as the policy name plus `.json`.
   

## Using the downloaded policy

The file is a Phileas policy, so [Phileas](https://philterd.ai/phileas/) loads it from disk and [Philter](https://philterd.ai/philter/) takes it through its policy API. Philter names a policy when you save it to Philter, as shown in [step 3 of Writing your first redaction policy](https://philterd.ai/guides/writing-your-first-redaction-policy/#step-3-apply-the-policy).

Two things need a text editor after the download. The form has no field for dictionary terms, so a Dictionary filter is written with the placeholder term `ADD YOUR TERMS HERE`. Replace it with your own terms before you use the policy. The same placeholder is what the Test Policy run matches against. Also, the form exposes only part of what a policy can do. Custom identifiers, for example, are added by editing the JSON.

The editor tests with its own copy of Phileas, which can be a different version from the Philter or Phileas you run in production. Detection is probabilistic, and a few lines of made-up text will not look like your documents. Before you rely on the policy, run it against representative data of your own in your production version, and measure it with [Philter Scope](https://philterd.ai/philter-scope/) if you need numbers rather than spot checks.

To change the policy later, click Upload Policy and choose the JSON file. Upload does not restore every filter type and setting into the form, so check the form against the file, then generate and compare the new JSON before you replace the original.

## Related reading

- [Redaction Policy Editor: The visual builder for Phileas and Philter redaction policies.](https://philterd.ai/redaction-policy-editor/)
- [Redaction Policy Editor support: Guides, documentation, and the issue tracker.](https://philterd.ai/support/redaction-policy-editor/)
- [The redaction policy schema: What the editor writes, field by field.](https://philterd.ai/guides/redaction-policy-schema/)
