VS Code Extension
Real-time PII detection, policy syntax highlighting, and AI governance tools directly in Visual Studio Code.
Features
Real-time PII Detection
Automatically detect SSN, credit cards, emails, phone numbers, IP addresses, and more as you type.
Syntax Highlighting
Full syntax highlighting for .tork.yaml policy files with keyword recognition.
Policy Templates
8 built-in policy templates for common governance scenarios. Just type 'tork-' and Tab.
Evaluate Selection
Select text and evaluate it against your policies with Cmd+Shift+T.
Code Snippets
Quick snippets for policy rules, agent configs, and threshold definitions.
Status Bar Integration
See connection status and quick access to Tork commands in the status bar.
Installation
Install from VS Code Marketplace or from a .vsix file.
Option 1: VS Code Marketplace (Recommended)
Search for "Tork AI Governance" in VS Code Extensions, or run:
Option 2: Manual Installation
Download the .vsix file from GitHub Releases and install:
Configuration
Configure the extension in your VS Code settings.
Configuration Options
| tork.apiKey | string | Your Tork API key |
| tork.apiUrl | string | API endpoint (default: api.tork.network) |
| tork.enablePiiDetection | boolean | Enable/disable PII detection |
| tork.piiSeverity | enum | hint | information | warning | error |
| tork.piiPatterns | array | PII patterns to detect |
| tork.autoScanOnSave | boolean | Scan files on save |
| tork.excludePatterns | array | Glob patterns to exclude |
PII Detection
Automatic detection of personally identifiable information.
The extension scans all open files for PII patterns and shows warnings in the Problems panel. Detected PII is highlighted with a yellow background.
Supported PII Patterns
john@example.com123-45-6789(555) 123-45674111-1111-1111-1111192.168.1.101/15/1990AB1234567D1234567890PII detection runs locally in your editor. No data is sent to external servers unless you explicitly use the Evaluate command.
Policy Syntax Highlighting
Full syntax highlighting for .tork.yaml and .tork.yml files.
Highlighted Keywords
Commands & Keyboard Shortcuts
Available commands in the Command Palette (Cmd+Shift+P).
| Tork: Evaluate Selected Text | Cmd+Shift+T | Evaluate selection against policies |
| Tork: Insert Policy Template | Cmd+Shift+P T | Insert a policy template |
| Tork: Scan File for PII | - | Manually scan current file |
| Tork: Redact PII in Selection | - | Replace PII with placeholders |
| Tork: Configure API Key | - | Set your Tork API key |
| Tork: Validate Policy File | - | Validate .tork.yaml syntax |
Policy Templates & Snippets
Quickly insert policy templates with code snippets.
Available Templates
tork-policyBasic policy structuretork-piiPII protection rulestork-contentContent moderationtork-rateRate limiting rulestork-toolTool governancetork-hitlHuman-in-the-looptork-complianceCompliance loggingtork-jailbreakJailbreak preventionTroubleshooting
PII detection not working
Check that tork.enablePiiDetection is true in settings. Open Developer Tools (Help > Toggle Developer Tools) to see [Tork] logs.
Extension not activating
The extension activates on startup. Reload VS Code window (Cmd+Shift+P > Reload Window) if needed.
API key not recognized
Ensure your API key is set in settings.json or via the 'Tork: Configure API Key' command.
Syntax highlighting not showing
Make sure your file has a .tork.yaml or .tork.yml extension.
Next Steps
Learn more about Tork policies and integrate governance into your CI/CD pipeline.