- Open in browser: http://192.168.1.61:8080/dashboard.html
- Navigate to: API Keys section (sidebar)
- Click: CREATE NEW KEY
- Copy the full key (starts with
isk_live_)
Open PowerShell (Start Menu → search "PowerShell")
# Set for current session (temporary)
$env:INFERSHIELD_API_KEY = "isk_live_YOUR_KEY_HERE" # Replace with your key
$env:INFERSHIELD_ENDPOINT = "http://192.168.1.61:5000"
# Verify
echo $env:INFERSHIELD_API_KEYTo make it permanent:
# Set permanently (persists across sessions)
[System.Environment]::SetEnvironmentVariable('INFERSHIELD_API_KEY', 'isk_live_YOUR_KEY_HERE', 'User')
[System.Environment]::SetEnvironmentVariable('INFERSHIELD_ENDPOINT', 'http://192.168.1.61:5000', 'User')
# Restart PowerShell after thisWindows 10/11 has curl built-in:
curl.exe -X POST http://192.168.1.61:5000/api/analyze `
-H "X-API-Key: $env:INFERSHIELD_API_KEY" `
-H "Content-Type: application/json" `
-d '{"prompt":"const key = \"sk-1234567890abcdef\";","agent_id":"test"}'Expected: Should see "threat_detected":true in the response! ✅
Alternative (Pure PowerShell):
# More readable PowerShell version
$headers = @{
"X-API-Key" = $env:INFERSHIELD_API_KEY
"Content-Type" = "application/json"
}
$body = @{
prompt = 'const apiKey = "sk-1234567890abcdef";'
agent_id = "test"
} | ConvertTo-Json
$result = Invoke-RestMethod `
-Uri "$env:INFERSHIELD_ENDPOINT/api/analyze" `
-Method Post `
-Headers $headers `
-Body $body
# Display results
$result | ConvertTo-Json -Depth 10Download the repo (if you haven't already):
# Option A: Clone with Git
git clone https://github.com/InferShield/infershield.git
cd infershield
# Option B: Download ZIP from GitHub
# Extract to a folder, then cd to itRun the installer:
cd path\to\infershield
.\scripts\install-windows.ps1This installs infershield-scan.ps1 to %USERPROFILE%\bin\
Create a test file with PII:
# Create a bad file
echo 'const openaiKey = "sk-test12345";' > bad.js
# Scan it
.\scripts\infershield-scan.ps1 bad.jsExpected output:
⚠️ THREAT DETECTED (Risk: 85/100)
Threats found:
• HIGH: api_key - sk-test12345
Redacted version:
const openaiKey = "[REDACTED_API_KEY]";
Test with a clean file:
# Create a good file
echo 'const apiKey = process.env.OPENAI_KEY;' > good.js
# Scan it
.\scripts\infershield-scan.ps1 good.jsExpected output:
✅ No threats detected (Risk: 15/100)
Requirements:
- Git for Windows installed
- Git Bash available
Setup:
# In Git Bash (not PowerShell)
cd /c/path/to/your/project
cp /c/path/to/infershield/scripts/pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commitTest it:
# Create a file with a secret
echo 'const secret = "sk-test123";' > test.js
git add test.js
git commit -m "test"
# Should be BLOCKED! ✅# In your project directory
# Scan a specific file
.\path\to\infershield-scan.ps1 myfile.js
# Scan all staged changes (requires Git for Windows)
git diff --cached | .\path\to\infershield-scan.ps1
# If clean, commit
git commit -m "your message"Create a PowerShell task in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P - Type: "Tasks: Configure Task"
- Select: "Create tasks.json from template"
- Add this task:
{
"version": "0.9.0",
"tasks": [
{
"label": "InferShield: Scan Current File",
"type": "shell",
"command": "powershell",
"args": [
"-File",
"C:\\path\\to\\infershield\\scripts\\infershield-scan.ps1",
"${file}"
],
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
}
]
}Usage:
- Open a file in VS Code
- Press
Ctrl+Shift+P - Type: "Tasks: Run Task"
- Select: "InferShield: Scan Current File"
Before accepting Copilot suggestions:
- Copilot suggests code in VS Code
- Copy it (Ctrl+C)
- Save to temp file:
# In PowerShell Get-Clipboard > $env:TEMP\copilot-temp.js
- Scan it:
.\infershield-scan.ps1 $env:TEMP\copilot-temp.js
- Review results
- Accept or reject the suggestion
Quick alias (add to PowerShell profile):
# Add to: $PROFILE (open with: notepad $PROFILE)
function Scan-Clipboard {
Get-Clipboard | & "$env:USERPROFILE\bin\infershield-scan.ps1"
}
Set-Alias scan-clip Scan-Clipboard
# Usage:
# 1. Copy Copilot suggestion (Ctrl+C)
# 2. Run: scan-clip
# 3. Review threats# Check if API key is set
echo $env:INFERSHIELD_API_KEY
# Test if it works
$headers = @{ "X-API-Key" = $env:INFERSHIELD_API_KEY }
Invoke-RestMethod -Uri "$env:INFERSHIELD_ENDPOINT/api/usage/current" -Headers $headersPowerShell execution policy issue:
# Check current policy
Get-ExecutionPolicy
# Set to allow local scripts (recommended)
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
# Or run specific script with bypass
powershell -ExecutionPolicy Bypass -File .\infershield-scan.ps1 test.js# Check if backend is running
curl.exe http://192.168.1.61:5000/health
# Or in PowerShell
Invoke-WebRequest -Uri "http://192.168.1.61:5000/health"Git hooks require Git Bash (from Git for Windows):
- Make sure Git for Windows is installed
- Hook should be in:
.git/hooks/pre-commit(no .ps1 extension) - Hook must have Unix line endings (LF, not CRLF)
- Test hook manually:
# In Git Bash bash .git/hooks/pre-commit
- Quick Start:
QUICKSTART_WINDOWS.md(this file) - Complete Guide:
docs\MANUAL_INTEGRATION.md - GitHub: https://github.com/InferShield/infershield
✅ Command-line scanner (PowerShell + curl)
✅ Manual file scanning (infershield-scan.ps1)
✅ Git pre-commit hooks (requires Git Bash)
✅ VS Code task integration
🚀 Transparent proxy mode (automatic interception)
🚀 VS Code extension (real-time protection)
🚀 No manual scanning needed
- Test it with the steps above
- Install pre-commit hook in your repos
- Add to your Copilot workflow
- Give us feedback!
Made with 🛡️ by HoZyne Inc
Need help? Open an issue: https://github.com/InferShield/infershield/issues