Skip to content

Murali-SpringAI/ops-guardian-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ OpsGuardian: AI-Powered DevOps Copilot

OpsGuardian is an AI-powered DevOps Copilot that understands natural language commands, makes intelligent decisions, executes safe actions, and explains its reasoningβ€”all while strictly enforcing security policies and permissions.

Think of it as ChatGPT for DevOps, but with enterprise-grade guardrails.


🧠 Project Goal

OpsGuardian bridges the gap between AI autonomy and infrastructure security by enabling:

  • Natural Language Execution: Run complex DevOps tasks via simple chat.
  • Intent Understanding: LLM-driven reasoning to determine the best course of action.
  • Permission Enforcement: Native integration with Auth0 (JWT + RBAC).
  • Safe Guardrails: Policy checks and mandatory confirmation steps for "destructive" actions.
  • Observability: Real-time technical flow visualization in the UI.

πŸ“Ί Demo

OpsGuardian Demo

Example Flow:

  1. Input: User types "Restart payment service".
  2. Reasoning: AI displays its thought process (e.g., "Checking service status...").
  3. Safety Check: A confirmation button appears because the action is flagged as "Risky."
  4. Validation: System validates the user's Auth0 JWT for the required permissions.
  5. Execution: Once confirmed, the service restarts and the UI flow updates in real-time.

πŸ—οΈ Architecture

High-Level Component Map

           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚  Frontend   β”‚
           β”‚ (JS Chat UI)β”‚
           β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ Spring Boot β”‚
          β”‚   API       β”‚
          β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚  Auth0 JWT Validationβ”‚
      β”‚  (issuer + audience) β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚    LLM      β”‚
          β”‚ Decision Engineβ”‚
          β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚   Agent Service        β”‚
     β”‚  - Policy Check        β”‚
     β”‚  - RBAC Enforcement    β”‚
     β”‚  - Confirmation Layer  β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ External APIs        β”‚
      β”‚ - GitHub             β”‚
      β”‚ - AWS                β”‚
      β”‚ - Logs / Metrics     β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”
              β”‚  UI   β”‚
              β”‚ Response β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”˜

Logic Flow (Mermaid)

flowchart LR
    A["πŸ§‘ User Chat UI"] -->|Natural Language Command| B["πŸ€– AI Layer (LLM)"]
    B --> C["🧠 Agent Layer"]
    C --> C1["Planner"]
    C --> C2["Executor"]
    C1 -->|"Task Plan"| C2
    C2 -->|"Tool Selection"| D["🧰 Tool Registry"]
    D --> E1["GitHub Tool"]
    D --> E2["Logs Tool"]
    D --> E3["DevOps Tool"]
    C2 --> F["πŸ›‘οΈ Policy Engine"]
    F -->|"Allow / Warn / Confirm"| G["πŸ” Auth0 RBAC"]
    G --> H["βš™οΈ Execution Layer"]
    H --> E1
    H --> E2
    H --> E3
    H --> I["πŸ“Š Response + Status"]
    I --> J["πŸ’¬ Chat UI + Flow Visualization"]
Loading

βœ… Features Implemented

πŸ€– LLM Decision Engine

  • Converts natural language into structured actions

Example:

{
  "action": "RESTART_SERVICE",
  "target": "payment-service",
  "reason": "Service instability detected"
}

πŸ” Secure Execution

  • Auth0 JWT validation
  • Role-Based Access Control (RBAC)
  • Permission-based execution

πŸ›‘οΈ Safety Guardrails

  • Risk detection before execution
  • Mandatory confirmation for critical actions

Flow:
LLM β†’ Risk Check β†’ Confirm β†’ Execute


πŸ’¬ Chat UI

  • Natural language input
  • AI reasoning displayed step-by-step
  • Confirmation buttons
  • Flow visualization

πŸ”— Integrations

  • GitHub (issues, repositories)
  • DevOps simulation APIs
  • Logs & metrics

🧠 Transparent AI Reasoning

🧠 Understanding request...
πŸ“Š Analyzing intent...
βš™οΈ Deciding action...
πŸ” Validating JWT...
πŸ›‘οΈ Checking permissions...
⚠️ Confirmation required
πŸš€ Executing...
βœ… Done

⚑ Demo Script

Try these commands:

  • Restart payment service
  • Show logs for orders
  • Scale checkout service to 3
  • Create GitHub issue

πŸ› οΈ Setup

Backend

git clone <repo-url>
cd copilot_backend
./mvnw spring-boot:run

OpsGuardian requires minimal configuration for Auth0 authentication and LLM integration.


πŸ” Auth0 Configuration

spring:
  security:
    oauth2:
      resourceserver:
        jwt:
          issuer-uri: https://dev-frvjdwj3fq0gwfb7.us.auth0.com/
  • issuer-uri: Your Auth0 domain URL
  • Used for validating incoming JWT tokens
  • Ensures only authenticated users can access the API

πŸ”‘ Auth0 Machine-to-Machine (M2M)

auth0:
  domain: <DOMAIN>
  m2m:
    client-id: <CLIENT_ID>
    client-secret: <CLIENT_SECRET>
  • domain: Your Auth0 tenant domain
  • client-id / client-secret: Credentials for backend-to-backend communication
  • Used by the agent to securely call external APIs on behalf of the user

⚠️ Do NOT commit real credentials to GitHub. Use environment variables instead.


πŸ€– LLM Configuration

llm:
  api:
    key: <API_KEY>
  model: gpt-4o-mini
  • api.key: Your LLM provider API key
  • model: LLM used for intent parsing and decision-making

🌐 Server Configuration

server:
  port: 8080
  • Defines the port where the backend runs
  • Default: http://localhost:8080

πŸ“ Logging (Debug Mode)

logging:
  level:
    org.springframework.security: DEBUG
  • Enables detailed logs for authentication and authorization
  • Useful for debugging JWT validation and RBAC issues

Frontend

  • Open: src/main/resources/static/index.html
  • Ensure JWT is set in app.js

βš™οΈ Commands

Input Action
Restart payment service RESTART_SERVICE
Scale checkout service SCALE_SERVICE
Show logs FETCH_LOGS
Create GitHub issue CREATE_GITHUB_ISSUE

πŸ›‘οΈ Policies

  • ❌ No production restarts
  • ⚠️ Scaling requires confirmation
  • πŸ” RBAC enforced

πŸ“ Roadmap

  • Streaming AI responses
  • Session memory
  • AWS integrations
  • Better UI (timestamps, history)

πŸ‘€ Hackathon Highlights

  • πŸ”₯ AI agent with real guardrails
  • πŸ” Security-first design (Auth0 + RBAC)
  • 🧠 Transparent AI reasoning
  • βš™οΈ Extensible architecture

🎯 Vision

A production-ready AI DevOps agent that:

  • Understands natural language
  • Makes safe decisions
  • Executes securely
  • Explains everything

πŸ“‚ Project Structure

copilot_backend/
β”œβ”€ service/AgentService.java
β”œβ”€ llm/LlmService.java
β”œβ”€ model/AgentDecision.java
β”œβ”€ model/AgentResponse.java
β”‚
└─ static/
   β”œβ”€ index.html
   β”œβ”€ app.js

πŸ“¦ License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors