Skip to content

Your First Protected Chat ​

Learn how GhostAI protects sensitive data through a hands-on tutorial.

What You'll Learn ​

  • How PII detection works in real-time
  • Understanding tokenization and detokenization
  • Reading the audit log
  • Adjusting detection sensitivity

Prerequisites ​

Step 1: Open the Application ​

  1. Navigate to https://localhost:5173
  2. Accept the self-signed certificate warning
  3. You should see the GhostAI chat interface

Step 2: Send a Message with PII ​

Type the following message (or similar):

Hi, my name is Sarah Johnson and I need help understanding my 
medical benefits. My SSN is 987-65-4321 and my email is 
sarah.johnson@email.com. My phone number is (555) 123-4567.

What Happens ​

  1. Detection: GhostAI scans your message and detects:

  2. Highlighting: Detected entities are highlighted in the input:

    • Yellow background for detected PII
    • Hover to see entity type and confidence
  3. Tokenization: Before sending to the AI, GhostAI replaces:

    Sarah Johnson → [PERSON_a1b2c3]
    987-65-4321 → [US_SSN_d4e5f6]
    sarah.johnson@email.com → [EMAIL_g7h8i9]
    (555) 123-4567 → [PHONE_j0k1l2]
  4. AI Response: The AI sees only tokens, not real data

  5. Detokenization: GhostAI restores original values in the response

Step 3: View the Audit Log ​

Click the shield icon in the sidebar to see:

Protection Summary ​

MetricValue
PII Items Protected4
Entity TypesPERSON, US_SSN, EMAIL_ADDRESS, PHONE_NUMBER
Session IDabc123...

Detailed Log ​

TimestampEntity TypeTokenConfidence
10:30:15PERSON[PERSON_a1b2c3]0.95
10:30:15US_SSN[US_SSN_d4e5f6]0.99
10:30:15EMAIL_ADDRESS[EMAIL_g7h8i9]0.98
10:30:15PHONE_NUMBER[PHONE_j0k1l2]0.92

Step 4: Try Prompt Enhancement ​

Before sending your next message, try the magic wand:

  1. Type a short, rough prompt like: explain common security vulnerabilities
  2. Click the sparkle icon (✨) next to the send button, or press Cmd/Ctrl + Shift + E
  3. Watch your prompt transform into a detailed, well-structured query
  4. If you prefer your original, click Undo within 8 seconds

Tip: The enhancement adapts to your industry. If your organization is configured for healthcare, legal, or finance, the enhanced prompt will include relevant terminology and compliance context automatically.

Step 5: Test Code Protection ​

Try sending a message with code:

Here's my API configuration:

const config = {
  apiKey: 'sk-1234567890abcdef',
  dbPassword: 'SuperSecret123!',
  awsAccessKey: 'AKIAIOSFODNN7EXAMPLE'
};

Code Protection Dialog ​

GhostAI will show a dialog asking you to choose:

  • Warn: Show warning but allow sending
  • Block: Prevent sending entirely
  • Redact: Automatically tokenize code and secrets

Detected Secrets ​

TypeValueAction
API_KEYsk-1234...Redacted
PASSWORDSuperSecret...Redacted
AWS_KEYAKIAIOSF...Redacted

Step 5: Test File Upload ​

Upload a document with sensitive data:

  1. Click the paperclip icon in the chat input
  2. Select a PDF, Word document, or image
  3. GhostAI scans the file before processing

Supported File Types ​

  • Documents: PDF, DOCX, XLSX, PPTX
  • Images: JPG, PNG (with OCR)
  • Archives: ZIP, 7z (recursive scanning)
  • Medical: DICOM, HL7

Step 6: Adjust Sensitivity ​

If you're seeing too many false positives:

  1. Click Settings (gear icon)
  2. Go to Detection Settings
  3. Adjust the Confidence Threshold:
    • Lower (0.3-0.5): More sensitive, more false positives
    • Higher (0.7-0.9): Less sensitive, may miss some PII

Per-Entity Thresholds ​

Fine-tune specific entity types:

EntityDefaultRecommended for Healthcare
US_SSN0.50.3 (more sensitive)
PERSON0.50.7 (reduce false positives)
DATE_TIME0.50.4 (important for PHI)

Step 7: Export Audit Report ​

Generate a compliance report:

  1. Click Analytics in the sidebar
  2. Click Export Report
  3. Choose format: PDF, CSV, or JSON
  4. Select date range and filters

Report Contents ​

  • Total PII items protected
  • Breakdown by entity type
  • Detection confidence distribution
  • Compliance certification statement

Common Scenarios ​

Healthcare Use Case ​

Patient John Doe (DOB: 01/15/1980) presented with chest pain. 
His insurance ID is BC12345678. Contact his wife Jane at 
(555) 987-6543 to discuss discharge planning.

Detected PHI:

  • Patient name (PERSON)
  • Date of birth (DATE_TIME)
  • Insurance ID (MEDICAL_LICENSE)
  • Family member name (PERSON)
  • Phone number (PHONE_NUMBER)

Financial Use Case ​

Please process refund for customer Mike Wilson. 
Card ending in 4242, CVV 123. 
Account routing: 021000021, Account: 123456789

Detected PCI Data:

  • Customer name (PERSON)
  • Credit card (partial) (CREDIT_CARD)
  • CVV (CREDIT_CARD_CVV)
  • Routing number (US_BANK_NUMBER)
  • Account number (US_BANK_NUMBER)

Step 6: Document Preview ​

Upload a document (PDF, Word, Excel, or PowerPoint) to see the visual preview system in action.

Upload a Document ​

  1. Click the paperclip icon in the chat input
  2. Select a PDF or Word document
  3. The file is automatically scanned for PII

Preview the Document ​

  1. Click the uploaded file in the chat to open the preview modal
  2. You'll see the redacted view by default — PII is replaced or blurred
  3. Tabs let you switch between the visual Document view and extracted Text

Toggle Original View (Admin) ​

If you have admin or owner permissions:

  1. Click the "Show Original" toggle at the top of the preview
  2. The original, unredacted document is displayed with a red "ORIGINAL — Contains PII" warning
  3. Switch back to the protected view at any time

Download Redacted Copy ​

  1. Click the download button in the preview modal
  2. Select "Download Redacted" for a safe-to-share copy
  3. Select "Download Certificate" for a redaction compliance record

Try Different File Types ​

Upload ThisWhat You'll See
A PDF with names/SSNsPDF viewer with PII blacked out
A photo of an ID cardBlurred image with PII covered
An Excel spreadsheetFormatted table with PII redacted
A PowerPoint deckSlides rendered as PDF with redaction

Troubleshooting ​

"No PII Detected" When Expected ​

  1. Check the confidence threshold isn't too high
  2. Verify the entity type is enabled
  3. Try the exact format (e.g., XXX-XX-XXXX for SSN)

Too Many False Positives ​

  1. Increase confidence threshold
  2. Adjust per-entity thresholds
  3. Use feedback to train the system:
    • Click on a detection
    • Mark as "Not PII"
    • System learns over time

Slow Detection ​

  1. First request loads ML models (expected)
  2. Check memory availability (4GB recommended)
  3. Reduce number of enabled detectors

Step 8: Explore AI Chat Features ​

GhostAI includes a full-featured AI chat experience on par with ChatGPT and Claude:

Ask GhostAI to search the web — queries are automatically PII-sanitized before searching.

Image Generation ​

Generate images with multiple models (DALL-E 3, Gemini Flash Image, Flux, Stable Diffusion, and more) — prompts are privacy-protected before being sent. Choose your preferred model from the image model selector in the toolbar; your choice is saved across sessions. See Image Generation for all supported models.

Rich Content ​

  • LaTeX math — equations render with KaTeX
  • Mermaid diagrams — flowcharts and sequence diagrams render inline
  • Code blocks — syntax-highlighted with copy and download buttons

Personalization ​

  • Custom Instructions — Click the ⋮ More menu in the header, then select Custom Instructions to set your preferences. Instructions persist across all sessions. Combine quick presets (Concise, Detailed, Technical, Simple) by clicking multiple options
  • Prompt Library — Click the ⋮ More menu in the header, then select Prompt Library to browse and save prompt templates
  • Light/Dark Mode — Click the ⋮ More menu in the header, then select Light/Dark Mode
  • Incognito Mode — In comparison view, use the incognito toggle in the header overflow menu

Productivity ​

  • Regenerate — Click the refresh icon on any AI response to regenerate it
  • Keyboard shortcuts — Ctrl+N / Cmd+N for new chat
  • Conversation search — Filter conversations in the sidebar
  • Smart titles — Conversations are automatically named by AI

Model Comparison ​

Compare 2-4 AI models side-by-side:

  1. Click Compare in the sidebar (or hover a starter prompt and click the comparison icon)
  2. Select your models and type a prompt — all models stream in real-time
  3. Use attachments, web search, and image generation — just like normal chat
  4. Choose tool mode: Per Model (each model calls tools independently) or Shared (tools run once, results shared)
  5. Toggle incognito to prevent saving the comparison
  6. Vote as Winner and Continue as Chat to promote the best response
  7. Export the comparison as Markdown with Ctrl+Shift+E

Combined Mode (Labs) ​

Get one clean answer from multiple models using a 3-stage deliberation pipeline — without switching to comparison view:

  1. Toggle Combined Mode in the input area (near the send button)
  2. Select 2-4 models and type your prompt
  3. GhostAI runs Initial → Deliberation → Blend behind the scenes
  4. You receive a single, seamless answer that incorporates the best of all models

Next Steps ​

SOC 2 Type II Certified | BAA Available | HIPAA-Ready