Skip to content

naninu123/ai-agent-security

Repository files navigation

🛡️ AI Agent Security Dashboard

A comprehensive security monitoring and guardrails platform for AI agents — built with Next.js 15, React 19, and TypeScript.

Next.js React TypeScript Tailwind CSS


📋 Overview

AI Agent Security Dashboard is a real-time monitoring and security enforcement platform designed to protect AI agent deployments from common attack vectors including prompt injection, jailbreaks, data exfiltration, and unauthorized tool usage.

As AI agents become more autonomous and integrated into critical workflows, security monitoring becomes essential. This dashboard provides:

  • Real-time threat detection — monitor agent activity as it happens
  • Prompt injection scanning — detect and block malicious inputs before they reach the agent
  • Audit trail — immutable log of all agent actions with risk scoring
  • Configurable guardrails — toggle security rules without redeploying

✨ Features

🔍 Security Dashboard

  • Live threat score indicator (0–100 scale)
  • Active alert feed with severity levels (Critical / High / Medium / Low)
  • Agent activity timeline
  • System health metrics (requests/min, blocked threats, uptime)

💉 Prompt Injection Scanner

  • Real-time input analysis against known injection patterns
  • Detects: jailbreaks, role-play attacks, instruction overrides, data exfiltration attempts
  • Risk level classification: Safe / Low / Medium / High / Critical
  • Pattern match highlighting with explanation

📋 Audit Trail

  • Timestamped log of every agent action
  • Action type tagging: tool_call, llm_query, file_access, network_request, auth_attempt
  • Per-action risk score (0–100)
  • Filterable by date, action type, and risk level
  • Export to CSV/JSON

⚙️ Guardrails Configuration

  • Toggle individual security rules on/off
  • Categories: Input Validation, Output Filtering, Tool Restrictions, Rate Limiting
  • Per-rule sensitivity tuning
  • Live preview of rule impact

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/naninu123/ai-agent-security.git
cd ai-agent-security

# Install dependencies
npm install

# Run development server
npm run dev

Open http://localhost:3000 in your browser.

Build for Production

npm run build
npm start

🏗️ Project Structure

ai-agent-security/
├── app/
│   ├── layout.tsx          # Root layout with dark theme
│   ├── page.tsx            # Dashboard home
│   ├── scanner/
│   │   └── page.tsx        # Prompt injection scanner
│   ├── audit/
│   │   └── page.tsx        # Audit trail log
│   └── guardrails/
│       └── page.tsx        # Guardrails configuration
├── components/
│   ├── ui/
│   │   ├── card.tsx        # Card component
│   │   ├── badge.tsx       # Badge/tag component
│   │   └── button.tsx      # Button component
│   ├── Navbar.tsx          # Navigation sidebar
│   ├── ThreatScore.tsx     # Threat score gauge
│   ├── AlertFeed.tsx       # Live alert feed
│   └── ActivityChart.tsx   # Activity timeline chart
├── lib/
│   └── utils.ts            # Utility functions
└── public/
    └── ...

🔒 Security Patterns Detected

Pattern Description Severity
Prompt Injection Override system instructions via user input Critical
Jailbreak Attempt Role-play or hypothetical framing to bypass rules High
Data Exfiltration Attempts to extract sensitive data via output High
Instruction Override Direct commands to ignore previous instructions Critical
Tool Abuse Unauthorized or excessive tool invocations Medium
PII Leakage Personal data appearing in agent outputs High
SSRF via Agent Agent making unauthorized network requests High
Privilege Escalation Attempts to gain elevated permissions Critical
Denial of Service Flooding agent with resource-intensive requests Medium
Supply Chain Attack Malicious content injected via external data sources High

🛠️ Tech Stack

  • Framework: Next.js 15 (App Router)
  • UI Library: React 19
  • Language: TypeScript 5
  • Styling: Tailwind CSS v4
  • Icons: Lucide React
  • Theme: Dark — Purple (#7C3AED) + Cyan (#06B6D4)

🗺️ Roadmap

  • WebSocket real-time updates
  • Integration with OpenAI / Anthropic API logs
  • Webhook alerts (Telegram, Slack, Discord)
  • ML-based anomaly detection
  • Multi-agent monitoring support
  • Role-based access control (RBAC)
  • Docker deployment support
  • API endpoint for external log ingestion

🤝 Contributing

Pull requests welcome. For major changes, open an issue first to discuss what you'd like to change.


📄 License

MIT License — see LICENSE for details.


👤 Author

setsutzy@setsutzy

Built with ❤️ for the AI security community.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors