---
title: "Phileas"
description: "Phileas is the open source library that finds and redacts PII and PHI in text. Available in Java, Python, and .NET. The engine underneath Philter."
url: "https://philterd.ai/phileas/"
---

Open source redaction library

# Phileas

Phileas is the core redaction, pseudonymization, masking, and replacement library that powers [Philter](https://philterd.ai/philter/). Embed it directly into your Java, Python, or .NET application when you want fine-grained control over the redaction pipeline without standing up another service.

[Read the quickstart](https://philterd.github.io/phileas/) [View on GitHub](https://github.com/philterd/phileas)

[Star: 111](https://github.com/philterd/phileas)

Embed Phileas. Redact in-process. No service to run.

```
Policy policy = Policy.fromPhiSQL("""
    REDACT EMAIL_ADDRESS WITH REDACT;
    REDACT ZIP_CODE WITH REDACT;
    """);

TextFilterResult result = filterService.filter(
    policy, "context", "Email test@example.com, zip 90210.");

System.out.println(result.getFilteredText());
// -> Email {{{REDACTED-email-address}}}, zip {{{REDACTED-zip-code}}}.
```

SDKs for [Java](https://github.com/philterd/phileas), [Python](https://github.com/philterd/phileas-python), [.NET](https://github.com/philterd/phileas-dotnet).

[Documentation →](https://philterd.github.io/phileas/) [Release Notes →](https://github.com/philterd/phileas/releases) [GitHub →](https://github.com/philterd/phileas) [Client libraries →](https://philterd.ai/packages/)

## Text in, redacted text out

Phileas detects the sensitive values in a document and applies your policy's strategy to each. The same filter call works in [Java](https://github.com/philterd/phileas), [Python](https://github.com/philterd/phileas-python), and [.NET](https://github.com/philterd/phileas-dotnet).

Input

Patient Margaret CollinsPERSON, SSN 523-88-4021SSN, seen 04/12/2024DATE. Contact mcollins@example.comEMAIL or (555) 342-9187PHONE.

Redacted output

Patient {{REDACTED-PERSON}}, SSN \*\*\*\*\*\*\*\*\*\*\*, seen 05/11/2024. Contact user4821@example.com or (555) \*\*\*-\*\*\*\*.

Each entity type gets its own strategy: redact, mask, shift, or replace with a synthetic value. Nothing leaves your process.

## Code samples

Phileas exposes the same redaction surface across languages. The minimal “define a policy, redact one document” flow looks like this in each. Each port expresses the policy its own way (PhiSQL in Java, a dictionary in Python, typed objects in .NET), and the underlying policy model is the same. For ready-made policies, see the [policy library](https://philterd.ai/policies/).

**Java is the reference implementation.** New features and entity types land in the Java library first; the Python and .NET libraries track its API surface and feature set as it evolves.

Install: Maven Central: `ai.philterd:phileas:4.5.0`

Requires Java 21 or later.

```
<!-- pom.xml -->
<dependency>
    <groupId>ai.philterd</groupId>
    <artifactId>phileas</artifactId>
    <version>4.5.0</version>
</dependency>

// Example.java
import ai.philterd.phileas.PhileasConfiguration;
import ai.philterd.phileas.policy.Policy;
import ai.philterd.phileas.model.filtering.TextFilterResult;
import ai.philterd.phileas.services.context.DefaultContextService;
import ai.philterd.phileas.services.disambiguation.vector.InMemoryVectorService;
import ai.philterd.phileas.services.filters.filtering.PlainTextFilterService;

import java.util.Properties;

public class Example {
  public static void main(String[] args) throws Exception {
    final PhileasConfiguration configuration = new PhileasConfiguration(new Properties());

    final PlainTextFilterService filterService = new PlainTextFilterService(
        configuration,
        new DefaultContextService(),
        new InMemoryVectorService(),
        null); // optional HttpClient for PhEye; null uses the default

    final Policy policy = Policy.fromPhiSQL("""
        REDACT EMAIL_ADDRESS WITH REDACT;
        REDACT ZIP_CODE WITH REDACT;
        """);

    final TextFilterResult result = filterService.filter(
        policy, "context", "Email test@example.com, zip 90210.");

    System.out.println(result.getFilteredText());
    // -> Email {{{REDACTED-email-address}}}, zip {{{REDACTED-zip-code}}}.
  }
}
```

Install: `pip install phileas-redact`

```
from phileas.policy.policy import Policy
from phileas.services.filter_service import FilterService

policy = Policy.from_dict({
    "name": "my-policy",
    "identifiers": {
        "emailAddress": {"emailAddressFilterStrategies": [
            {"strategy": "REDACT", "redactionFormat": "{{{REDACTED-%t}}}"}]},
        "ssn": {"ssnFilterStrategies": [
            {"strategy": "REDACT", "redactionFormat": "{{{REDACTED-%t}}}"}]},
    },
})

result = FilterService().filter(
    policy=policy,
    context="my-context",
    document_id="doc-001",
    text="Contact john@example.com or call about SSN 123-45-6789.",
)

print(result.filtered_text)
# -> Contact {{{REDACTED-email-address}}} or call about SSN {{{REDACTED-ssn}}}.
```

Install: NuGet: `dotnet add package Philterd.Phileas`

```
using Phileas.Policy;
using Phileas.Policy.Filters;
using Phileas.Services;

// Identifiers default to redaction, so no strategy is specified.
var policy = new Policy
{
    Name = "basic-policy",
    Identifiers = new Identifiers
    {
        Ssn = new Ssn(),
        EmailAddress = new EmailAddress(),
        PhoneNumber = new PhoneNumber()
    }
};

var result = new FilterService().Filter(
    policy,
    context: "session-1",
    piece: 0,
    input: "SSN: 123-45-6789  Email: alice@example.com  Phone: 555-867-5309"
);

Console.WriteLine(result.FilteredText);
// -> SSN: {{{REDACTED-ssn}}}  Email: {{{REDACTED-email-address}}}  Phone: {{{REDACTED-phone-number}}}
```

## Why Phileas

### Three first-class languages

Reference implementation in [Java](https://github.com/philterd/phileas), with feature-parity ports for [Python](https://github.com/philterd/phileas-python) and [.NET](https://github.com/philterd/phileas-dotnet). Pick the SDK that fits the stack you already have.

### Policy-driven

JSON policies describe which entity types to detect, under what conditions, and how to handle each (redact, mask, encrypt, replace with a synthetic value, or pass through). Version-control your policies; deploy them through CI/CD.

### Validated identifiers

Back a custom identifier with a checksum or structural validator, so it keeps only genuine values and rejects format-valid look-alikes. Built-in coverage for national and financial IDs (Canadian SIN, Brazilian CPF and CNPJ, Spanish DNI, French NIR, IBAN, SWIFT/BIC, and more), with identical behavior across Java, Python, and .NET.

### Embeddable

Link Phileas directly into your application. No service to deploy, no network hop, no operational footprint. Redaction happens in-process on the data already in memory.

### Battle-tested in production

Phileas is the engine underneath [Philter](https://philterd.ai/philter/), running in production at healthcare, legal, and financial customers for years. The library has been pressure-tested on the workloads where a privacy miss isn’t an option.

### Permissive Apache license

Business-friendly licensing. No commercial review needed, no per-seat fees, no vendor lock-in. Use it however you need to.

## Phileas' Architecture

Phileas runs **inside your application's process**. The host code calls a single `filter(text)` entry point; the library reads a policy file and an optional NLP lens, then routes the text through three internal layers before returning redacted output.

Your application

passes text in

Phileas in-process library

1. Detection NLP lens (general · healthcare · COVID-19) · regex patterns · dictionaries · format and checksum validators (Luhn, mod-11, mod-97, BIC, SSN structure, date validity) for national and financial IDs
2. Policy engine Per-entity rules · contextual conditions · severity thresholds · ignored terms & patterns · custom identifier definitions
3. Filter strategies Mask · redact · encrypt · format-preserving encryption · abbreviate · replace with synthetic value · pass through

Redacted text

returned in-place

## Frequently asked questions

If something here isn’t covered, [get in touch](https://philterd.ai/phileas/#) and we’ll answer.

What is Phileas?

Phileas is the open source library that finds and redacts PII and PHI in text. It runs in-process inside your application: the host code calls a single `filter(text)` entry point, Phileas reads a policy and an optional NLP lens, and returns redacted output. There is no service to deploy and no data egress. It is the engine underneath [Philter](https://philterd.ai/philter/).

How is Phileas different from Philter?

Phileas is a library you embed directly in your application; [Philter](https://philterd.ai/philter/) wraps Phileas as a self-hosted REST API, shipping with NLP models and a friendlier operational surface. Same detection core either way. Choose Phileas when you want fine-grained, in-process control with no extra service; choose Philter when you want an HTTP endpoint other systems can call.

Which languages does Phileas support?

Three first-class languages: [Java](https://github.com/philterd/phileas) is the reference implementation, with feature-parity ports for [Python](https://github.com/philterd/phileas-python) and [.NET](https://github.com/philterd/phileas-dotnet). New features and entity types land in Java first; the Python and .NET libraries track its API surface as it evolves.

Does Phileas need a separate model server?

Not always. Regex patterns, dictionaries, and format validators (Luhn, SSN structure, date validity) run in-process with no extra service. For machine-learning detection, Phileas calls [PhEye](https://philterd.ai/ph-eye/) to run an NLP lens. You enable only the detection methods your policy actually needs.

How long has Phileas been around?

Phileas has run in production at healthcare, legal, and financial customers for several years, since well before the current wave of LLM-wrapper privacy tools. It has been pressure-tested on workloads where a privacy miss isn't an option.

Is Phileas open source?

Yes, under the permissive Apache License, version 2: no commercial review, no per-seat fees, and no vendor lock-in. The code is on [GitHub](https://github.com/philterd/phileas).

## Related products

- [Philter: Wrap Phileas as a self-hosted REST API when you want a service, not an embedded library.](https://philterd.ai/philter/)
- [PhEye: Add trained NLP models to Phileas for context-aware detection beyond patterns and dictionaries.](https://philterd.ai/ph-eye/)
- [PhiSQL: Author Phileas policies as readable code instead of hand-editing the JSON schema.](https://philterd.ai/phisql/)

## Ready to build with Phileas?

Add it to your build from Maven Central, PyPI, or NuGet, or work with our team directly. Pick the path that fits.

[See your options](https://philterd.ai/pricing/)
