Skip to content

Test Console

The PII Firewall Test Console lets you run live API calls directly in your browser — no code required. Use it to explore endpoints, test with your own text, and generate code samples.

Open Test Console

Overview

The console is divided into three areas:

AreaDescription
Left sidebarSelect an API endpoint or load a preset test scenario
Center paneEdit the request body and view the response side-by-side
Session statsLive counters for requests sent, PII detected, and injections blocked

API Endpoints

POST /mask

Detects and masks PII in a text string. Returns a masked version and a tokenMap for restoring original values later.

When to use: Before sending user input to an AI model.

POST /detect

Scans text and returns the location and type of each PII found, without modifying the text.

When to use: Auditing or logging — when you need to know what PII is present without masking.

POST /detect-injection

Scans text for prompt injection and jailbreak patterns.

When to use: Validating untrusted input (user messages, incoming emails) before passing to an AI.

Full Pipeline

Runs mask → AI call → restore in a single flow to demonstrate the complete protection lifecycle.

When to use: Understanding the end-to-end integration pattern.

Test Scenarios

Use the preset scenarios in the sidebar to quickly load example payloads:

ScenarioWhat it tests
Email + PhoneBasic contact information masking
Credit CardFinancial PII detection
Medical RecordHealthcare data masking
Injection AttackPrompt injection detection

Code Samples

Switch to the Code Sample tab in the console to get auto-generated code in:

  • curl
  • Node.js (fetch)
  • Python (requests)

The code sample updates in real time as you edit the request body.

Authentication

To use the console with your own API key:

  1. Click the key icon in the top-right toolbar
  2. Enter your API key (pf_live_...)
  3. All subsequent requests will be authenticated

Without an API key, the console runs in sandbox mode against a demo endpoint with limited functionality.

Session Stats

The sidebar tracks your activity for the current browser session:

StatDescription
RequestsTotal API calls made
PII DetectedCumulative count of PII items found
InjectionsNumber of injection attempts detected
Avg LatencyAverage API response time in ms

Custom Dictionary

The Dictionary tab lets you register business-specific keywords, project codes, or internal terminology as custom PII. Registered keywords are automatically applied when sending /mask requests.

Setting Up a Dictionary

Open the Dictionary tab and enter keywords or regex patterns in JSON format:

json
[
  { "label": "PROJECT_CODE", "pattern": "Project Alpha" },
  { "label": "CONFIDENTIAL", "pattern": "confidential" },
  { "label": "PJ_CODE", "pattern": "PJ-[A-Z]{2,4}-\\d{4}" }
]
FieldDescription
labelToken name shown after masking (e.g., [PROJECT_CODE_1])
patternExact string or regular expression pattern

Enabling / Disabling

  • Toggle the switch at the top of the Dictionary tab to ON — the dictionary applies from the next request onward
  • Toggling ON auto-saves the editor content (no need to click "Save" manually)
  • If the JSON is invalid, an error is shown and the toggle stays OFF
  • When active, a "🔑 N entries applied" indicator appears in the Request Body area

Verification Demo

  1. Use the default text (which includes example project keywords)
  2. Open the Dictionary tab → enter your custom patterns → toggle ON
  3. Return to the Request tab and click Send Request — confirm your keywords are now masked

Tip: With Dictionary OFF, standard PII (name, email, phone) is masked but custom keywords remain. Toggle ON to see all custom terms masked — a clear before/after comparison.

Storage

Dictionary data is stored in the browser's localStorage — it is never sent to any server. Your dictionary persists across browser sessions.

Next Steps

Privacy by Design.