Skip to content

Security: gowthamp10/cyber-scribe

Security

SECURITY.md

Security & Privacy Guide

Data Flow Overview

Your Screen --> OCR Text --> Logs (local) --> LLM Provider --> Report
                              ^                   |
                              |                   +-- Local (Ollama): Stays on your machine
                              |                   +-- Cloud (OpenAI/Anthropic/Gemini): Sent externally
                              |
                              +-- ALWAYS local (never leaves your machine)

Provider Types

Local (Default - Recommended)

  • Ollama: Runs entirely on your machine. No data leaves your system.
  • Privacy level: Maximum. Your OCR text, window titles, and commands stay local.

Cloud Providers

  • OpenAI, Anthropic, Gemini: Data is sent to external servers for processing.
  • Privacy level: Your prompts are subject to each provider's privacy policy.
  • Mitigation: Automatic data redaction is applied before transmission.

Automatic Data Redaction

When using cloud providers, the following patterns are automatically redacted from prompts:

  • Passwords and credentials (password=xxx, api_key: xxx)
  • API keys (sk-*, ghp_*, xoxb-*, etc.)
  • Secret tokens
  • Credit card numbers
  • Email addresses

Redaction is controlled by config.py:

REDACT_SENSITIVE_DATA = True  # Set to False to disable (not recommended)

Sensitive Data in Logs

Warning: Session logs (logs/session_*.jsonl) contain raw OCR text from your screen. This may include:

  • Passwords visible in terminal output
  • Private messages
  • API keys in code editors
  • Personal information

Best practices:

  1. Never commit logs/ directory to git (already in .gitignore)
  2. Clear old logs periodically
  3. Use the local Ollama provider when processing sensitive sessions

Configuration Security

API Keys

  • Never commit API keys to version control
  • Use config_local.py (gitignored) or environment variables
  • Example: export OPENAI_API_KEY="sk-..."

config_local.py Template

# Copy this to config_local.py and fill in your keys
TESSERACT_PATH = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
OPENAI_API_KEY = "sk-..."
ANTHROPIC_API_KEY = "sk-ant-..."
GEMINI_API_KEY = "..."
LITELLM_API_KEY = "..."

Prompt Injection Risk

OCR text from websites could contain text designed to manipulate the LLM. The chunking and prompt structure limits this risk, but be aware that:

  • Malicious web pages could inject instructions into OCR output
  • The LLM processes this as user-provided context
  • Review generated reports for unexpected content

Consent Warning

When switching to a cloud provider, CyberScribe displays a warning:

WARNING: Using cloud LLM provider (openai:gpt-4o)
Your session data (including OCR text and window titles) will be sent to external servers.
Sensitive data is automatically redacted before transmission.
Set LLM_PROVIDER='ollama' in config.py to keep all data local.

Git Safety

The .gitignore file excludes:

  • logs/ - Contains raw OCR data
  • quicklog.txt - Your manual notes
  • config_local.py - API keys and secrets
  • .env and .env.local - Environment variables
  • *.key, *.pem - Certificate files
  • credentials/, secrets/ - Secret directories

Recommendations

  1. Default to Ollama for maximum privacy
  2. Use cloud providers only when you need better model quality
  3. Review logs before sharing or uploading them anywhere
  4. Rotate API keys if you suspect they were exposed
  5. Clear config_local.py if sharing your project setup with others

There aren't any published security advisories