Philter on Google Cloud Marketplace
Philter from Google Cloud Marketplace runs on its own Compute Engine virtual machine in your Google Cloud project, so the text you redact stays inside it. This page takes you from launch to your first redacted text, then to a key your application can use.
1. Launch Philter
- Open Philter on Google Cloud Marketplace and choose Launch on Compute Engine.
- Choose a machine type.
c3-highcpu-4is recommended, and smaller types are for testing. - Choose your zone and network, and deploy.
The listing opens ports 22 (SSH) and 8080 (Philter’s API). Restrict both to your own
address ranges.
2. Connect over SSH
gcloud compute ssh <INSTANCE_NAME> --zone <ZONE>
Or use the SSH button next to the instance in the Compute Engine console. Note the instance’s external IP address there too.
3. Get your API key
On its first boot the virtual machine generates its own keys into /opt/philter/.env,
readable only by root:
sudo cat /opt/philter/.env
PHILTER_ENCRYPTION_KEY=...
PHILTER_BOOTSTRAP_API_KEY=sk_...
PHILTER_BOOTSTRAP_API_KEYis the first API key. It belongs to theadminuser and holds every scope.PHILTER_ENCRYPTION_KEYencrypts Philter’s data at rest. Back it up and do not change it: Philter’s data cannot be read without it.
Check that Philter is running:
curl -sk https://localhost:8080/api/health
{"status":"UP","applicationVersion":"4.0.0","redactionPolicySchemaVersion":"1.3.0","gitCommit":"e9a6bc0"}
4. Redact some text
From your own machine, replacing <PUBLIC_IP> with the instance’s external IP address:
export PHILTER_API_KEY="sk_..."
curl -sk "https://<PUBLIC_IP>:8080/api/filter" \
-H "Authorization: Bearer $PHILTER_API_KEY" \
-H "Content-Type: text/plain" \
--data-binary "George Washington was a patient and his SSN is 123-45-6789."
{{{REDACTED-name}}} was a patient and his SSN is {{{REDACTED-ssn}}}.
The built-in default policy redacts person names, SSNs, and email addresses. The first
request after Philter starts loads the person-name model, so it takes several seconds,
and longer on a newly launched virtual machine. Later requests are fast.
Philter serves HTTPS with a self-signed certificate, hence -k.
5. Create a key for your application
Give each application its own key holding only the redact scope, rather than the admin
key:
curl -sk "https://<PUBLIC_IP>:8080/api/api-keys" \
-H "Authorization: Bearer $PHILTER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"scopes": ["redact"]}'
{"id":"...","username":"admin","apiKey":"sk_...","scopes":["redact"]}
The key is shown once: Philter stores only its hash. A redact key can call
/api/filter and /api/explain and nothing else. See scopes.
Before production
- Replace the self-signed certificate with your own. See TLS.
- Philter keeps its policies, ledger, and audit log in SQLite on the virtual machine’s disk.
Back up the disk, and keep
PHILTER_ENCRYPTION_KEYwith the backups. See SQLite storage. - One virtual machine runs one Philter. To run several behind a load balancer, see High Availability.
- Philter needs no outbound internet access to redact. The default policy’s model ships with it, and it connects out only to services you configure, such as a remote PhEye service, webhooks, or Phield. Once the virtual machine is running, you can move it to a subnet with no internet egress; updates then come through your own mirror.
- Write policies for your own data. See redaction policies.
- A virtual machine launched from a marketplace may not be ready for a HIPAA environment as launched. Check your organization’s requirements with your compliance officer.
Detection is probabilistic. Validate Philter’s output against your own data before relying on it.
Help
The Philter documentation is the full reference. Ask questions in the Philterd Slack, see support options, or work with us on your deployment through consulting.
How Philter works
The API key you send as a bearer token stands for a user and the scopes it holds. The bootstrap key belongs to admin and holds every scope. The key from step 5 holds only redact.
The request named no policy, so Philter used the built-in default, which redacts person names, SSNs, and email addresses. Policies are stored in Philter by name. Create one with POST /api/policies and select it with ?p=.
The result from /api/filter is the redacted text. /api/explain returns it with every span that changed, at its character offsets. Each response carries an X-Document-Id header that identifies the request in the audit log.
A context, passed as ?c=, groups related documents. With a pseudonymizing strategy scoped to the context, the same value gets the same replacement in every document in it. See contexts.
REDACT is one strategy of several. Others mask, hash, substitute values, or encrypt, and CRYPTO_REPLACE values can be reversed through Philter's re-identification endpoints. See filter strategies.
Where to go next
- Write policies for your own data: redaction policies.
- Read the Philter API reference.
- Compare Philter with the other tools: choose a tool.