SafeRelay DevSec for VS Code
A SafeRelay.ai product
100% Local Content Scanning. Zero-Knowledge Vault. Scanned source content never leaves your machine.
SafeRelay DevSec is a VS Code extension that redacts secrets, PII, and sensitive data from your files and AI prompts — entirely on your machine. All scanning and redaction is local; no telemetry, no analytics, no cloud processing of content. The only outbound requests are the explicitly described license checks and opt-in DataDNA / Team Vault features (see Security & Privacy Posture).
The Trust Question — Answered Up Front
Every DLP tool that touches your secrets has to answer one question:
Where does the data go when you restore a tokenized file back to its real values?
SafeRelay DevSec's answer: nowhere.
The mapping between [OPENAI_KEY_1] and sk-proj-abc123... lives in RAM only — inside your VS Code process — for the duration of your session. It is never written to disk, never sent to a server, never stored in VS Code's globalState or workspaceState, and never logged. When VS Code closes, the vault is gone.
This is what zero-knowledge actually means in practice. SafeRelay's servers, if they ever exist in your workflow, will only ever see encrypted ciphertext — never your plaintext secrets.
What It Does
- Sanitize a file (YAML, JSON, env, logs, config, code) → SafeRelay scans it locally, replaces secrets with typed placeholders (
[OPENAI_KEY_a1b2c3d4e5_1], [IP_f8k2m9x4p1_1], [AWS_SECRET_q2w8z5n7b3_1]), and writes a .redacted copy alongside the original. Each sanitization run gets a unique namespace so placeholders from different files can never collide in the vault.
- Share the redacted file freely — to an AI, a colleague, a Slack thread, a GitHub issue. It contains no real secrets.
- Restore the AI's response (or the file) → SafeRelay swaps every placeholder back with the original value from the in-memory vault. Restore is fail-closed: if any placeholder cannot be resolved from the vault, the restore aborts rather than guessing. The full round-trip happens without your secrets ever appearing in chat, logs, or a third-party system.
Commands
| Command |
Shortcut |
What it does |
SafeRelay: Quick Menu |
Click status bar |
Action menu for all commands |
SafeRelay: Sanitize File |
Ctrl+Shift+Alt+S |
Redact file → .redacted.ext + diff view |
SafeRelay: Copy Selection for AI |
Ctrl+Shift+Alt+C |
Redact selected text → clipboard |
SafeRelay: Restore Clipboard |
Ctrl+Shift+Alt+R |
De-tokenize clipboard with vault values |
SafeRelay: Restore File |
Right-click |
De-tokenize file → .restored.ext |
SafeRelay: Configure Shields |
Ctrl+Shift+Alt+G |
Toggle pattern groups via quick-pick |
SafeRelay: Clear Vault |
Quick Menu |
Wipe in-memory vault immediately |
All commands are also accessible via Ctrl+Shift+P → type "SafeRelay".
The Sanitize → AI → Restore Workflow
config.yaml → [Sanitize File] → config.redacted.yaml
↓
Send to AI / colleague / Slack
↓
AI edits it, returns modified version
↓
[Restore File] → config.restored.yaml ← real values back
Example — before sanitize:
api_key: sk-proj-abc123def456ghi7890jklmnopqrstuvwxyz
db_host: 192.168.1.100
DB_URL=postgres://admin:s3cr3t@10.0.0.5:5432/prod
token: ghp_<36-char-github-pat>
After sanitize (config.redacted.yaml):
api_key: [OPENAI_KEY_a1b2c3d4e5_1]
db_host: [IP_f8k2m9x4p1_1]
DB_URL=[ENV_VALUE_q2w8z5n7b3_1]
token: [GITHUB_PAT_m4x7k1c9v2_1]
After restore — original values are back exactly as they were.
What Gets Redacted
Free — DevSec Shield
| Pattern |
Example match |
| OpenAI API keys |
sk-proj-abc... |
| OpenAI legacy keys |
sk-abc... (non-proj/ant) |
| Anthropic keys |
sk-ant-abc... |
| AWS Access Key ID |
AKIAIOSFODNN7EXAMPLE |
| AWS STS temporary key |
ASIAIOSFODNN7EXAMPLE |
| AWS Secret Access Key |
SecretAccessKey=abc... |
| GitHub classic PAT |
ghp_abc... |
| GitHub fine-grained PAT |
github_pat_abc... |
| GitHub OAuth token |
gho_abc... |
| Slack token |
xoxb-abc... |
| Stripe secret key |
sk_live_abc... / sk_test_abc... |
| Stripe public key |
pk_live_abc... / pk_test_abc... |
| Bearer tokens |
Bearer eyJhb... |
| Docker PAT |
dckr_pat_abc... |
| NPM token |
npm_abc... |
| Twilio key |
SKabc... |
| SendGrid key |
SG.abc.def |
| Gemini / GCP key |
AIzaSy... |
| PEM private key header |
-----BEGIN PRIVATE KEY----- |
| IPv4 addresses |
192.168.1.100, 10.0.0.5 |
| BTC addresses |
Legacy, P2SH, Bech32 |
| ETH addresses |
0x... (40 hex) |
| Crypto WIF keys |
5abc..., Kabc..., Labc... |
| Seed phrases |
12-word and 24-word BIP39 |
| ENV variable values |
DATABASE_URL=postgres://... |
Pro — Additional Shields
| Shield |
Covers |
| FinTech |
Credit cards (Luhn), US SSN, EU IBAN, Email, UK NINO, NG BVN/NIN/Bank/Phone, CA SIN, IN Aadhaar/PAN, ZA ID, AU TFN, BR CPF, SG NRIC, DE Tax ID, US Green Card |
| Corporate |
DUNS, EIN, EU VAT (27 countries) |
| Civic / Mission |
GPS coordinates, UNHCR registration IDs, donor/beneficiary IDs |
| Pro Tier Patterns |
MAC addresses, ETH private keys (0x 64-hex), Solana addresses, 64-hex crypto keys (context-aware — excludes SHA-256 checksums) |
Status Bar
The $(shield) SafeRelay item shows on the right of the status bar.
- No vault entries:
$(shield) SafeRelay
- Vault active:
$(shield) SafeRelay (4) — 4 secrets stored in RAM
- Click → Quick Menu with all actions
Settings
| Setting |
Type |
Default |
Description |
saferelayDevsec.enabled |
boolean |
false |
Master switch — must be ON |
saferelayDevsec.licenseKey |
string |
"" |
Pro license key from SafeRelay.ai. 🔒 Global (User) scope only — workspace values are ignored |
saferelayDevsec.dataDnaEndpoint |
string |
"" |
PRO — DataDNA portal URL. 🔒 Global (User) scope only — workspace values are ignored |
saferelayDevsec.devsecShield |
boolean |
true |
FREE: DevSec pattern group |
saferelayDevsec.fintechShield |
boolean |
false |
PRO: FinTech PII group |
saferelayDevsec.corporateShield |
boolean |
false |
PRO: Corporate ID group |
saferelayDevsec.civicShield |
boolean |
false |
PRO: Civic/Mission group |
saferelayDevsec.governmentShield |
boolean |
false |
PRO: detects and redacts CUI document markings (FOUO, NOFORN, CUI//SP-), contract numbers, government IDs (EDIPI), SAM UEI, CAGE codes, and .gov/.mil emails |
saferelayDevsec.customTermsShield |
boolean |
false |
PRO: redacts user-defined literal strings — project names, codenames, client IDs. Manage terms via SafeRelay: Manage Custom Protected Terms |
saferelayDevsec.proTier |
boolean |
false |
PRO: unlocks Pro-only patterns within each enabled group |
saferelayDevsec.auditMetadataOnly |
boolean |
true |
Audit log: metadata only, never content |
Configure shields interactively via Ctrl+Shift+Alt+G → Configure Shields — no need to edit JSON.
7-day free trial — all Pro features (shields, Custom Protected Terms) are unlocked for 7 days after install, no credit card required. After the trial, a SafeRelay Pro license is required for Pro-only features; the free DevSec shield remains active indefinitely.
Security & Privacy Posture
| Claim |
Reality |
| Scanned content stays local |
All scanning, redaction, and restore run locally. File/editor/clipboard content being sanitized is never transmitted. |
| License validation |
When a Pro license key is set, the extension contacts SafeRelay's license server. It sends only the license key and a device identifier — never source content, file contents, or vault values. |
| DataDNA / Team Vault (opt-in) |
Only if you configure a DataDNA portal endpoint (Global settings only): custom DLP patterns are fetched; encrypted vault blobs are uploaded/downloaded for Team Vault sharing. Scanned source content is never transmitted. |
| No telemetry |
No usage data, no error reporting, no pings. |
| No secrets persisted |
Original values are RAM-only in the SafeVault for the VS Code session lifetime. |
| Clipboard reads |
The clipboard is read only when you explicitly invoke Restore Clipboard or Sanitize Clipboard. |
| Audit log = metadata only |
Timestamps, file names, match counts, threat categories. Never secret content, never match previews, never Custom Protected Term values. |
| No automatic scanning |
Every action requires explicit user initiation. |
| Vault cleared on exit |
deactivate() calls safeVault.clear() — no vault residue. |
| machineId disclosure |
vscode.env.machineId is sent only to the SafeRelay license server with your license key (device/seat management). It is never sent anywhere else. |
| Workspace-safe settings |
licenseKey and dataDnaEndpoint resolve from Global (User) settings only. A repository's workspace-scoped settings can never redirect license/pattern/team-vault requests to an attacker-controlled server. |
Why RAM-only is acceptable
The threat model for an in-memory vault is identical to having the file open in your editor — an attacker who can dump your VS Code process memory already has access to the file on disk. RAM-only means no persistence risk: no stolen laptop scenario, no log exfiltration, no cloud breach.
Roadmap
| Phase |
Status |
Description |
| Phase 2 |
✅ Done |
Scaffold: commands + status bar |
| Phase 3 |
✅ Done |
DLP engine: Copy Selection for AI |
| Phase 4 |
✅ Done |
Sanitize File + diff view |
| Phase 5 |
✅ Done |
Vault + Restore Clipboard / Restore File |
| Phase 6 |
✅ Done |
Configure Shields quick-pick, action menu, audit log, keybindings, Pro paywall |
| Phase 7 |
✅ Done |
Team Vault — E2E encrypted (AES-256-GCM), zero-knowledge vault sync for teams. Secrets encrypted client-side before leaving the machine; server stores ciphertext only. |
| Phase 8 |
Planned |
SafeRelay CLI / GitHub Action — wrap the DLP engine as a command-line tool and CI/CD action. Automatically sanitize logs before they ship to Datadog, Splunk, or Sentry. |
| Phase 9 |
Planned |
SafeRelay Desktop bridge — opt-in local service for license validation and Team Vault sync (not present in this release) |
| Phase 10 |
✅ Done |
VS Code Marketplace release |
Team Vault v1 — How it works (zero-knowledge, TEAM · BETA)
Team Vault v1 is shipped behind the TEAM · BETA labels. Three commands:
| Command |
What it does |
| SafeRelay: Enroll Client (TEAM · BETA) |
Exchange your one-time seat enrollment credential for an srct_ client token. The seat credential is used exactly once and discarded; the srct_ token is stored only in the OS keychain via VS Code SecretStorage — never in settings, files, or logs. |
| SafeRelay: Share Encrypted Vault (TEAM · BETA) |
Reserve a session on the control plane, generate a fresh 256-bit key locally, encrypt the vault mapping with AES-256-GCM bound to the canonical AAD (session/org/seat/expiry metadata), and upload ciphertext only. You receive two separate pieces: the session locator (srtv1:…) for the recipient, and the decryption key — which must travel through a separate trusted channel (never the same message). |
| SafeRelay: Join Encrypted Vault Session (TEAM · BETA) |
Fetch the encrypted session, verify AAD-verbatim decryption locally, validate the mapping, merge into the RAM-only vault (conflicts fail closed), and restore through the existing trusted SafeVault path. The server acknowledgement (consume) happens only after decrypt and restore both succeeded; if the ack fails, only the ack is retried — secrets are never re-restored or re-exposed. |
Senior Dev machine:
Enroll → srct_ token in OS keychain
Share → reserve session → AES-256-GCM (canonical AAD) locally
→ upload { iv, ciphertext, ciphertextHash } ← server sees ciphertext only
→ locator via normal channel, key via SEPARATE trusted channel
Junior Dev machine:
Join → fetch encrypted session (srct_ bearer)
→ decrypt locally, AAD must match verbatim (tamper → fail closed)
→ merge into RAM vault (conflict → fail closed)
→ restore via trusted path → consume (idempotent ack)
SafeRelay's servers handle routing and storage of encrypted blobs only. They cannot
decrypt vault entries. This is the 1Password / Bitwarden architecture.
Honest limitations (no guaranteed zeroization): keys and decrypted values live
in JavaScript string/Uint8Array objects while in use. JavaScript provides no
reliable memory wipe for strings — the garbage collector may keep copies
indefinitely. Keys are generated fresh per share and the decryption key is held
only for the duration of the join flow, but we do not claim cryptographic
zeroization of memory. Treat the decryption key like a password: send it through a
separate trusted channel and delete it from that channel after use.
Manual Test
npm install
npm run compile
npm test # release-critical tests: redact/restore, collision, fail-closed,
# privacy, Team Vault v1 (enrollment, AAD, no-consume-on-failure)
- Open this folder in VS Code → press F5 → Extension Development Host opens
Ctrl+, → search "saferelay" → set enabled to true
- Create a test file with:
api_key: sk-proj-abc123def456ghi7890jklmnopqrstuvwxyz
db_host: 192.168.1.100
DB_URL=postgres://user:password@10.0.0.5:5432/prod
token: ghp_<36-char-github-pat>
- Right-click the file → SafeRelay: Sanitize File → click View Diff
- Confirm secrets are replaced. Status bar shows
$(shield) SafeRelay (4)
- Copy the contents of the
.redacted file
- Run SafeRelay: Restore Clipboard → paste → original values are back
- Right-click the
.redacted file → SafeRelay: Restore File → .restored file matches original
About SafeRelay.ai
SafeRelay DevSec is built by SafeRelay.ai — privacy-first security tooling for developers, DevOps, and enterprise teams.
License: UNLICENSED — Private. Not for redistribution.