Skip to content

Privacy Rules

dhwang0803-glitch edited this page Jul 24, 2026 · 3 revisions

Privacy Rules

Fine-grained control over what data gets sent to AI. Privacy rules run before any data leaves your device — AI never sees excluded or redacted content.


How It Works

Every time Vaultend sends note content to AI (Organize Note, Organize Folder, Vault Maintenance with AI features), the privacy filter runs first:

Your note → Privacy filter → Only allowed content → AI provider
  1. Exclusion rules (folder, tag, properties) block entire notes from being sent
  2. Redaction rules mask specific text patterns within notes that are allowed
  3. Your original notes are never modified — filtering only affects the copy sent to AI

How to Configure

Go to Settings → Community Plugins → Vaultend → Privacy

Click Add Rule to create a new privacy rule. Each rule has:

  • Name — a descriptive label (e.g., "Personal journal")
  • Type — the kind of rule (see below)
  • Pattern — the folder path, tag, property key/value, or regex pattern
  • Enabled toggle — turn individual rules on/off without deleting them

Rule Types

Folder Exclude

Notes in the specified folder (and all subfolders) are never sent to AI.

Pattern: The folder path from vault root. Case-sensitive, prefix-matched.

Pattern What gets excluded
Journal/Personal All notes under Journal/Personal/ and its subfolders
Finance All notes under Finance/
Work/Clients All notes under Work/Clients/

Tag Exclude

Notes with the specified tag are completely excluded from AI context.

Pattern: The exact tag to match (including #).

Pattern Effect
#private Notes tagged #private are excluded
#confidential Notes tagged #confidential are excluded

Properties Exclude

Notes with matching frontmatter properties are excluded from AI context. Supports two modes:

Key-only pattern

If the key exists in frontmatter, the note is excluded regardless of value.

Pattern Frontmatter that triggers exclusion
confidential confidential: true (or any value)
no-ai no-ai: true

Key: value pattern

Only excludes the note when both the key exists and the value matches. Value comparison is case-insensitive.

Pattern Matches Does NOT match
category: draft category: draft, category: Draft category: published
status: wip status: wip, status: WIP status: done
private: true private: true private: false

One pattern per rule. To exclude multiple conditions, add separate rules.

Content Redact

Regex patterns in note content are replaced with [REDACTED] before sending to AI. The note itself remains in the AI context — only matching text is masked.

Pattern: A regular expression (case-insensitive, global). For simple word masking, just type the word — no regex knowledge needed.

Pattern Before After (sent to AI)
password:\S+ password:abc123 [REDACTED]
\d{6}-?\d{7} 920315-1234567 [REDACTED]
vaultend My vaultend plugin My [REDACTED] plugin

If a regex pattern is invalid, Vaultend logs a warning and skips that rule (other rules still apply).

Presets: The settings panel includes common presets (Email, Phone, Card, ID numbers, etc.) — click a chip to auto-fill the pattern. See the Custom Patterns Guide below for the full reference.


Where Privacy Rules Apply

Feature Exclusion rules Content redaction
Organize Note Excluded notes can't be organized Redacted content sent to AI
Organize Folder Excluded notes are skipped in batch Redacted content sent to AI
Vault Maintenance (AI features) Excluded notes skipped for AI analysis Redacted content sent to AI
Vault Maintenance (local analysis) Not affected — orphan/broken link/empty detection is local, no AI N/A
Link suggestions Excluded notes are not suggested as link targets N/A

Important: Local analysis features (orphan detection, broken links, empty notes, duplicates) do NOT use AI and are NOT affected by privacy rules. These features only read your local vault structure.


Rule Processing Order

Rules are processed in order from top to bottom. The first matching exclusion rule blocks the note entirely — subsequent rules don't run for that note.

For content redaction, all enabled redaction rules apply sequentially to the remaining text.


Common Setups

Personal vault with sensitive areas

Rule 1: Folder exclude → "Journal/Personal"
Rule 2: Folder exclude → "Finance"
Rule 3: Tag exclude → "#private"

Work vault with client confidentiality

Rule 1: Folder exclude → "Clients/Contracts"
Rule 2: Properties exclude → "confidential"
Rule 3: Content redact → "client-[A-Z]+-\d+"  (client IDs)

Selective AI access with key:value

Use frontmatter to control AI access at a per-note level:

---
ai-access: denied
---

Then add a single rule:

Rule: Properties exclude → "ai-access: denied"

Notes with ai-access: allowed or without the property will still be sent to AI.

Draft notes only

---
status: draft
---
Rule: Properties exclude → "status: draft"

Published notes (status: published) are unaffected.


Custom Patterns Guide

Content redaction uses JavaScript regular expressions. Below is a categorized reference of patterns for common PII (Personally Identifiable Information). Each pattern is ready to paste into the pattern field.

How to use: Copy any pattern below and paste it into the Content Redact pattern field. Or use the built-in presets in Settings for the most common ones.

Contact Information

Email

[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}

Matches: user@example.com, first.last+tag@sub.domain.org

Phone — Korea (한국 전화번호)

(?:\+82[-.\s]?0?|0)(?:1[016-9]|2|[3-6]\d)[-.\s]?\d{3,4}[-.\s]?\d{4}

Matches: 010-1234-5678, 02-1234-5678, +82-10-1234-5678, 01012345678

Covers mobile (010, 011, 016-019), Seoul landline (02), regional (031-064), and international (+82) formats.

Phone — US

(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}

Matches: (555) 123-4567, 555-123-4567, +1-555-123-4567

Phone — International (broad)

\+\d{1,3}[-.\s]?\d{1,4}[-.\s]?\d{3,4}[-.\s]?\d{3,4}

Matches international numbers with country code: +44 20 7946 0958, +81-3-1234-5678

⚠️ Broader patterns may produce false positives with other number sequences.


Identity Documents

Korean RRN (주민등록번호)

\b\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[-\s]?[1-8]\d{6}\b

Matches: 920315-1234567, 000101 3456789

Validates birth date (MM 01-12, DD 01-31) and gender digit (1-8: citizens 1-4, foreign nationals 5-8).

US SSN (사회보장번호)

\b(?!000|666|9\d{2})\d{3}[-\s]?\d{2}[-\s]?\d{4}\b

Matches: 123-45-6789, 123 45 6789

Excludes known invalid prefixes (000, 666, 9xx).

Korean Passport (여권번호)

(?:여권|passport)\s*(?:번호|no\.?|#)?\s*[:=]?\s*\b[A-Z]{1,2}\d{7,8}\b

Matches: 여권번호: M12345678, passport no. AB1234567

Requires a context keyword to avoid false positives.

Korean Driver's License (운전면허번호)

\b(?:1[1-9]|2[0-68])[-\s]?\d{2}[-\s]?\d{6}[-\s]?\d{2}\b

Matches: 18-95-123456-01 (region 11-28, 4-segment format)

Korean Business Registration (사업자등록번호)

\b\d{3}[-\s]?\d{2}[-\s]?\d{5}\b

Matches: 123-45-67890, 1234567890 (10-digit, 3-2-5 format)


Financial Information

Credit Card Number

\b(?:4\d{3}|5[1-5]\d{2}|6(?:011|5\d{2})|3[47]\d{2})[-\s]?\d{4,6}[-\s]?\d{4,5}[-\s]?\d{4,5}\b

Matches Visa, MasterCard, Discover, Amex with optional separators: 4111-1111-1111-1111, 3782 822463 10005

Korean Bank Account (은행 계좌번호)

\b\d{3,4}-\d{2,6}-\d{2,6}(?:-\d{1,6})?\b

Matches major bank formats: 110-234-567890 (KB), 123-456-78901 (Shinhan), 1002-123-456789 (Woori)

Requires at least one hyphen. Hyphen-less account numbers are too ambiguous.

IBAN (국제 계좌번호)

\b[A-Z]{2}\d{2}[\s]?[\dA-Z]{4}[\s]?[\dA-Z]{4}[\s]?[\dA-Z]{4}(?:[\s]?[\dA-Z]{1,4}){0,5}\b

Matches: DE89 3704 0044 0532 0130 00, GB29NWBK60161331926819

Bitcoin Address

\b(?:[13][1-9A-HJ-NP-Za-km-z]{25,34}|bc1[a-zA-HJ-NP-Z0-9]{25,90})\b

Matches Legacy (1...), P2SH (3...), and Bech32 (bc1...) formats.

Ethereum Address

\b0x[0-9a-fA-F]{40}\b

Matches: 0x742d35Cc6634C0532925a3b844Bc9e7595f2bD38


Security & Authentication

Password in Context (비밀번호)

(?:password|passwd|pwd|pw|비밀번호|패스워드|비번)\s*[:=]\s*['"]?[^\s'"]{1,64}['"]?

Matches: password: mySecret123, pw=abc!@#, 비밀번호: test1234

Only matches when preceded by a keyword — won't false-positive on regular words.

Generic API Key / Secret

(?:api[_-]?key|api[_-]?secret|api[_-]?token|secret[_-]?key)\s*[:=]\s*['"]?[A-Za-z0-9_\-]{16,}['"]?

Matches: api_key = "sk_live_abcdefghijklmnop", API_TOKEN=abc123def456ghi789

AWS Access Key ID

\bAKIA[0-9A-Z]{16}\b

Matches: AKIA1234567890ABCDEF (all AWS access keys start with AKIA)

Google API Key

\bAIza[0-9A-Za-z_-]{35}\b

Matches: AIzaSyA1234567890abcdefghijklmnopqrstuv (all Google API keys start with AIza)

GitHub Token

\bgh[pousr]_[0-9a-zA-Z]{36,}\b

Matches: ghp_ABCDEFGHIJ... (prefixes: ghp_, gho_, ghu_, ghs_, ghr_)

Slack Token

\bxox[bpoar]-[0-9a-zA-Z-]{10,}

Matches: xoxb-123456789-987654321-abc123def456

Bearer Token

\bBearer\s+[A-Za-z0-9_\-.]{20,}

Matches: Bearer eyJhbGciOiJIUzI1NiJ9.xxxxx.xxxxx

JWT Token

eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}

Matches: eyJhbGci...eyJzdWI...dozjgN... (three base64url-encoded segments starting with eyJ)

Private Key (PEM Header)

-----BEGIN\s(?:RSA\s|EC\s|DSA\s|OPENSSH\s|ENCRYPTED\s)?PRIVATE\sKEY-----

Matches the header line of PEM-encoded private keys.

URL with Auth Parameters

https?://[^\s]*[?&](?:token|session[_-]?id|key|secret|auth|api[_-]?key|access[_-]?token|password|pwd)=[^\s&]+

Matches: https://api.example.com/v1?token=abc123, https://app.com/login?session_id=xyz


Network

IPv4 Address

\b(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b

Matches with octet validation (0-255): 192.168.1.1, 10.0.0.1

May match version numbers like 1.2.3.4. Add a keyword rule if this is an issue.

MAC Address

\b[0-9a-f]{2}(?:[-:][0-9a-f]{2}){5}\b

Matches: 00:1A:2B:3C:4D:5E, 00-1a-2b-3c-4d-5e


Other PII

GPS Coordinates

[-+]?\d{1,3}\.\d{4,}\s*,\s*[-+]?\d{1,3}\.\d{4,}

Matches: 37.5665, 126.9780, -33.8688, 151.2093

Requires 4+ decimal places to distinguish from casual numbers.

Date of Birth (생년월일)

(?:생년월일|생일|birth\s*(?:day|date)?|DOB|date\s*of\s*birth)\s*[:=]?\s*(?:\d{4}[-/.]\d{1,2}[-/.]\d{1,2}|\d{1,2}[-/.]\d{1,2}[-/.]\d{4}|\d{6,8})

Matches: 생년월일: 1992-03-15, DOB = 03/15/1992, 생일: 920315

Requires a context keyword to avoid matching regular dates.

Korean Vehicle Plate (차량번호)

(?:[가-힣]{2}\s?)?\d{2,3}\s?[가-힣]\s?\d{4}

Matches: 123가4567, 서울 12가 3456

Korean Road Address (도로명주소)

(?:[가-힣]+(?:특별시|광역시|도|시|군|구)\s+){1,3}[가-힣]+(?:로|길)\s*\d+(?:-\d+)?

Matches: 서울특별시 강남구 테헤란로 123, 경기도 성남시 분당구 판교로 456-7

Korean Health Insurance Number (건강보험번호)

(?:건강보험|의료보험|건보|health\s*insurance)\s*(?:번호|증|자격|#|no\.?)?\s*[:=]?\s*\d[\d\s-]{6,15}

Matches: 건강보험 번호: 12345-67890, 건보증 1234567890


Writing Your Own Patterns

Content redaction uses JavaScript regular expressions with the gi flags (global, case-insensitive).

Quick reference

Syntax Meaning Example
. Any character pass.ord matches password, passWord
\d Any digit \d{4} matches 1234
\s Whitespace key\s*= matches key=, key =, key =
\S Non-whitespace pw:\S+ matches pw:abc123
\b Word boundary \bcat\b matches cat but not category
[...] Character set [A-Z] matches any uppercase letter
+ One or more \d+ matches 1, 123, 99999
* Zero or more \d* matches `` (empty), 1, `123`
? Optional (0 or 1) -? matches - or nothing
{n} Exactly n times \d{4} matches exactly 4 digits
{n,m} Between n and m \d{2,4} matches 2-4 digits
(?:...) Non-capturing group `(?:foo
\ Escape special char \. matches a literal .

Tips

  • Start simple: password already matches all instances of "password" in your notes. No regex needed for simple words.
  • Test carefully: an overly broad pattern like \d+ will redact ALL numbers everywhere. Be specific.
  • Use word boundaries: \bSSN\b matches the word "SSN" but not "ASSNignment".
  • Context keywords reduce false positives: (?:password|pwd)\s*[:=]\s*\S+ only matches passwords when preceded by a keyword.
  • One pattern per rule: Don't try to combine unrelated patterns. Create separate rules for separate concerns.
  • Invalid patterns are safe: If your regex has a syntax error, Vaultend skips it and logs a warning. Other rules still apply normally.

Key Guarantees

  1. Pre-send filtering — privacy rules execute before ANY data leaves your device
  2. Original notes untouched — content redaction only affects the copy sent to AI
  3. Plugin-scoped — these rules control Vaultend only. Your AI provider's own data policies apply separately (review them at your provider's website)
  4. No telemetry — Vaultend does not collect or send any usage data, analytics, or note content to Vaultend servers. All AI communication is direct between your device and your configured AI provider.

Tips

  • Use folder exclude for entire sections of your vault (journals, finance, medical records)
  • Use tag exclude for individual sensitive notes (#private, #confidential, #medical)
  • Use properties exclude for a per-note opt-out pattern (no-ai: true in frontmatter) or conditional exclusion (status: draft)
  • Use content redact for specific patterns (API keys, passwords, personal identifiers, client codes)
  • Multiple rules can be combined — exclusion rules block notes, redaction rules mask content within allowed notes
  • Disabled rules are preserved but inactive — toggle them back on when needed

Clone this wiki locally