Skip to content

Repository files navigation

🏎️ Pitstop AI Agent Security Scanner

GitHub Action License: MIT Security: 27 Checks

Free, offline AI agent security scanner for CI/CD pipelines

Scan your AI agent configuration for 27 security checks across 6 categories. No signup, no API keys, no data collection. Runs entirely offline in your GitHub Actions workflow.

🚀 Quick Start

Add this to your GitHub Actions workflow (.github/workflows/security.yml):

name: Security Scan
on: [push, pull_request]

jobs:
  pitstop:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: thepitstop/pitstop-scan@v1
        with:
          fail-on-grade: 'C'

That's it! The scanner will automatically detect your agent config files and report security issues.

📋 What It Checks

🔐 Permissions & Access Control (20% weight)

  1. Exec Security Mode — Is exec restricted to allowlist or denied?
  2. Sandbox Enabled — Is sandboxing configured for dangerous operations?
  3. Tool Restrictions — Are tools explicitly allowlisted/denylisted?
  4. File System Permissions — Are file access paths restricted?
  5. Network Access Control — Are outbound connections restricted?

🛡️ Prompt Injection Defense (20% weight)

  1. System Prompt Protection — Is the system prompt protected from override?
  2. Input Validation — Is user input validated/sanitized?
  3. Output Filtering — Are outputs filtered for sensitive data?
  4. Instruction Hierarchy — Is there instruction priority enforcement?

🚫 Data Exfiltration Prevention (15% weight)

  1. Outbound Allowlist — Are outbound URLs/IPs allowlisted?
  2. SSRF Protection — Is SSRF explicitly mitigated?
  3. Sensitive Data Masking — Are secrets/credentials masked in outputs?
  4. Clipboard Restrictions — Is clipboard access controlled?

🔗 Supply Chain Integrity (15% weight)

  1. Plugin Allowlist — Are plugins/extensions explicitly allowed?
  2. Skill Verification — Are skills verified before loading?
  3. Dependency Pinning — Are dependencies version-pinned?
  4. Package Audit — Are packages audited for vulnerabilities?

🤖 Sub-Agent Safety (15% weight)

  1. Sub-Agent Sandboxing — Are sub-agents sandboxed?
  2. Trust Scoring — Is there trust scoring for delegated tasks?
  3. Behavioral Inheritance — Do sub-agents inherit security policies?
  4. Delegation Limits — Are delegation depth/breadth limited?
  5. Sub-Agent Output Review — Are sub-agent outputs reviewed before use?

📊 Audit & Logging (15% weight)

  1. Command Logging — Are executed commands logged?
  2. Session Recording — Are sessions recorded/auditable?
  3. Anomaly Detection — Is there anomaly/drift detection?
  4. Audit Trail — Is there a tamper-evident audit trail?
  5. Monitoring Alerts — Are alerts configured for security events?

🎯 Example Output

## 🏎️ Pitstop Security Scan Results

**Score: 78/100 (C+)**

### 📊 Category Scores

| Category | Score | Grade |
|----------|-------|-------|
| Permissions & Access Control | 72/100 | C |
| Prompt Injection Defense | 85/100 | B |
| Data Exfiltration Prevention | 60/100 | D |
| Supply Chain Integrity | 80/100 | B |
| Sub-Agent Safety | 50/100 | F |
| Audit & Logging | 75/100 | C |

### ⚠️ Issues Found (2 critical, 5 high)

| Check | Severity | Status | Fix |
|-------|----------|--------|-----|
| exec_security_mode | 🔴 Critical | FAIL | Set `tools.exec.security: "allowlist"` |
| sensitive_data_masking | 🔴 Critical | FAIL | Add `security.mask_secrets: true` |
| subagent_sandboxing | 🟠 High | FAIL | Add `subagents.sandbox: true` |
| ... | ... | ... | ... |

> Scan powered by [The Pitstop](https://thepitstop.ai) — AI Agent Security Scanner

⚙️ Configuration

Inputs

Input Description Default Options
config-path Path to agent config file auto-detect Any file path
fail-on-grade Minimum grade to pass D A+, A, B, C, D, F
format Output format summary summary, json, sarif
badge Generate badge true true, false

Outputs

Output Description
score Overall score 0-100
grade Letter grade (A+, A, B, C, D, F)
issues Number of issues found
report Full JSON report

Advanced Example

- uses: thepitstop/pitstop-scan@v1
  id: pitstop
  with:
    config-path: '.openclaw/openclaw.json'
    fail-on-grade: 'B'
    format: 'json'

- name: Upload SARIF
  if: always()
  uses: thepitstop/pitstop-scan@v1
  with:
    format: 'sarif'

📦 Supported Config Formats

The scanner auto-detects these config files:

  • OpenClaw: openclaw.json, .openclaw/openclaw.json
  • CrewAI: agents.yaml, crew.yaml
  • Cursor: .cursorrules, cursor.json
  • Claude: CLAUDE.md, claude.json
  • AutoGPT: autogpt.json, .env
  • LangChain: langchain.config.js, langchain.yaml
  • AutoGen: autogen_config.json
  • Generic: AGENTS.md, any agent config pattern

Don't see your framework? Open an issue and we'll add it!

📈 How Scoring Works

  1. Each check is scored: Pass (100), Partial (50), Fail (0), N/A (skipped)
  2. Category scores are calculated as the average of all checks in that category
  3. Overall score is a weighted average of category scores
  4. Grades are assigned: A+ (95+), A (90+), B (80+), C (70+), D (60+), F (<60)

Category Weights

  • Permissions & Access Control: 20%
  • Prompt Injection Defense: 20%
  • Data Exfiltration Prevention: 15%
  • Supply Chain Integrity: 15%
  • Sub-Agent Safety: 15%
  • Audit & Logging: 15%

🔒 Privacy & Security

  • 100% offline — No network calls, no data collection
  • No API keys — Free to use, no signup required
  • No telemetry — Your code stays in your repo
  • Open source — MIT licensed, audit the code yourself
  • Fast — Completes in under 10 seconds

🛠️ Local Development

# Clone the repo
git clone https://github.com/thepitstop/pitstop-scan.git
cd pitstop-scan

# Install dependencies
npm install

# Run locally
node scan.js

# Test with specific config
node scan.js --config path/to/config.json --format json

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Add support for new frameworks — PRs welcome for new config formats
  2. Improve check logic — Better detection heuristics
  3. Add more checks — Propose new security checks
  4. Fix bugs — Found an issue? Open a PR

See CONTRIBUTING.md for guidelines.

📚 Resources

📄 License

MIT License — see LICENSE for details.


Made with ❤️ by The Pitstop — Securing the AI agent ecosystem, one scan at a time.

🏎️ Float like a butterfly, secure like Pitstop.

About

Free AI agent security scanner — 27 checks, 6 categories, runs in your CI/CD. No signup, no data collection.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages