Skip to main content
Glama

πŸ’₯ The Critical Unsolved Problems in AI Coding

Autonomous AI Coding Agents (Claude Code, Cursor, Antigravity, Devin, Copilot Workspace) introduce dangerous failure modes that completely bypass traditional linters (ESLint, Prettier, SonarQube):

  1. AI Dependency Hallucination / Package Squatting: Agents invent non-existent libraries across npm, PyPI, Crates.io, and Go, opening repositories to supply chain poisoning.

  2. Destructive Shell Execution: Agents executing autonomous shell commands can run catastrophic actions (rm -rf /, curl | bash, chmod 777, reverse shells).

  3. Cognitive Infinite Loops: Agents get caught in endless circular iterations (e.g. failing a test -> editing the test incorrectly -> retrying endlessly).

  4. Shadow Diff Tampering: During long refactoring sessions, agents may introduce stealthy unprompted network calls, telemetry, or prototype pollution.

  5. Indirect Prompt Injections & Jailbreaks: Malicious instructions hidden in comments or third-party READMEs hijack the agent's behavior.

  6. Hardcoded Secrets & API Keys: Accidental exposure of real tokens (sk-..., GitHub PATs, AWS credentials).


Related MCP server: airlock

⚑ What AgentGuard v2.0.0 Delivers

  • πŸ›‘οΈ Execution Shield (agentguard shield-exec & shield_command MCP):

    • Intercepts shell tool-calls in runtime and blocks destructive commands with safe alternatives.

  • πŸ”„ Cognitive Loop Breaker (check_cognitive_loop MCP):

    • Detects repetitive circular failure loops and prompts the agent or developer to halt execution.

  • πŸ“Š Industry-Standard SARIF 2.1.0 Export (--format sarif):

    • Native integration with GitHub Advanced Security / Code Scanning tab and GitLab SAST.

  • πŸŽ–οΈ AI Compliance & Hygiene Scoring (Tier A+ to F):

    • Evaluates codebases with an objective 0–100 score across Supply Chain, Secrets, Injections, and Code Smells.

  • πŸ•΅οΈ Shadow Diff Inspector (inspect_shadow_diff):

    • Audits Git diff patches to catch unrequested telemetry, network connections, or prototype pollution.

  • 🎯 Indirect Prompt Injection Defense (scan-injections):

    • Scans files for hidden jailbreaks and instruction overrides.

  • πŸ”§ Automated Code Smell Fixer (agentguard fix):

    • Safely refactors lazy agent artifacts (replaces swallowed errors with logging, converts @ts-ignore to @ts-expect-error).

  • βš“ Native Git Pre-Commit Hook (agentguard install-hook):

    • Zero-overhead safeguard blocking commits containing secret leaks or hallucinated packages.


πŸš€ Quick Start

Global / Local CLI

# Run directly with npx
npx @francaroscillidev/agentguard --help

# Or install globally
npm install -g @francaroscillidev/agentguard

1. Run Comprehensive Audit with SARIF or Markdown Export

# Terminal summary
agentguard audit

# Markdown report with Hygiene Score (ideal for PR comments)
agentguard audit --format markdown

# Standard SARIF 2.1.0 output for GitHub Code Scanning
agentguard audit --format sarif > agentguard.sarif

2. Shield Shell Commands from Destructive Agent Actions

agentguard shield-exec "rm -rf /"
# 🚨 COMMAND BLOCKED [CRITICAL RISK]!
# Reason: Destructive root or home recursive deletion detected.

3. Auto-Fix Lazy AI Code Smells

agentguard fix

4. Install Native Git Pre-Commit Hook

agentguard install-hook

πŸ€– MCP Server Integration

Add AgentGuard to your agent configuration (claude_desktop_config.json, Antigravity, or Cursor):

{
  "mcpServers": {
    "agentguard": {
      "command": "npx",
      "args": ["-y", "@francaroscillidev/agentguard", "mcp"]
    }
  }
}

Exposed MCP Tools for Agents:

  • verify_package: Pre-flight check before installing dependencies.

  • shield_command: Intercept and block destructive shell actions.

  • check_cognitive_loop: Detect and break runaway infinite agent execution loops.

  • inspect_shadow_diff: Catch stealthy unprompted additions in code patches.

  • detect_prompt_injections: Protect against indirect prompt injection vectors.

  • audit_manifests: Validate all project dependencies in bulk.

  • detect_secret_leaks: Check for hardcoded credentials.

  • audit_code_smells: Scan for swallowed exceptions and antipatterns.

  • autofix_smells: Automatically refactor lazy agent code.

  • check_scope_drift: Verify file changes match user prompt intent.


πŸ“¬ Contact, Support & Commercial Inquiries

If you have questions, feedback, enterprise integration requests, or custom agent governance needs, feel free to reach out directly:


πŸ“„ License

Apache License 2.0. Copyright (c) 2026 Franca Roscilli (https://github.com/francaroscillidev-gif). Open-source and free for all developers and AI agent platforms.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that vets package installations and shell commands to block dangerous actions by AI coding agents.
      19 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that helps catch context drift in AI coding agents by comparing actual code changes against the original request, allowing users to keep or roll back unintended additions.
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enforces hard quality gates on AI coding agents, including forced web search, planning, and empirical test execution, to prevent common failure modes and ensure production-grade code.
      13
      30
      MIT