isk_live_)# Run these commands in your terminal
export INFERSHIELD_API_KEY="isk_live_YOUR_KEY_HERE" # Replace with your key
export INFERSHIELD_ENDPOINT="http://192.168.1.61:5000"
# Verify
echo $INFERSHIELD_API_KEY
# Test 1: Detect API key in code
curl -X POST $INFERSHIELD_ENDPOINT/api/analyze \
-H "X-API-Key: $INFERSHIELD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "const openai_key = \"sk-1234567890abcdef\";",
"agent_id": "test"
}' | jq '.'
Expected: Should show "threat_detected": true with API key pattern detected!
# Test 2: Clean code (no threats)
curl -X POST $INFERSHIELD_ENDPOINT/api/analyze \
-H "X-API-Key: $INFERSHIELD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "const key = process.env.OPENAI_KEY;",
"agent_id": "test"
}' | jq '.'
Expected: Should show "threat_detected": false ✅
cd ~/.openclaw/workspace/infershield
./scripts/install-manual.sh
Or manually:
# Copy scanner to ~/bin
mkdir -p ~/bin
cp ~/.openclaw/workspace/infershield/scripts/infershield-scan ~/bin/
chmod +x ~/bin/infershield-scan
# Add to PATH (if not already)
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Test with a bad file
echo 'const apiKey = "sk-test12345";' > /tmp/bad-code.js
infershield-scan /tmp/bad-code.js
# Should show: ⚠️ THREAT DETECTED
# Test with a good file
echo 'const apiKey = process.env.API_KEY;' > /tmp/good-code.js
infershield-scan /tmp/good-code.js
# Should show: ✅ No threats detected
# In any git repo
cd /path/to/your/project
cp ~/.openclaw/workspace/infershield/scripts/pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Test it
echo 'const secret = "sk-test123";' > test.js
git add test.js
git commit -m "test"
# Should be BLOCKED! ✅
pbpaste > /tmp/copilot-suggestion.txt (Mac)infershield-scan /tmp/copilot-suggestion.txt# Before committing, scan your changes:
git diff HEAD | infershield-scan
# If clean, commit:
git commit -m "your message"
Read full documentation:
docs/MANUAL_INTEGRATION.md - Complete guide with all methodsComing in v0.8.0:
“401 Unauthorized”
# Check if API key is set
echo $INFERSHIELD_API_KEY
# Test if it works
curl -H "X-API-Key: $INFERSHIELD_API_KEY" \
$INFERSHIELD_ENDPOINT/api/usage/current | jq '.'
“Connection refused”
# Check if backend is running
curl http://192.168.1.61:5000/health
# If not running, start it:
cd ~/.openclaw/workspace/infershield/backend
npm start
“Command not found: infershield-scan”
# Check if ~/bin is in PATH
echo $PATH | grep "$HOME/bin"
# If not, add it:
export PATH="$HOME/bin:$PATH"
Once you’ve tested this, we can:
Test it now and let me know how it goes! 🚀