Kubric is an autonomous SRE agent that diagnoses Kubernetes cluster failures, pinpoints root causes, and ships fixes — in seconds, not stand-ups. It scans your cluster, reasons over evidence with AI, and can auto-apply safe remediations with one click.
- Detects — continuously watches for OOMKills, CrashLoops, ImagePullBackOff, Pending pods, failed rollouts
- Diagnoses — collects pods, logs, events, deployments, and networking state; reasons with GPT-4o-mini to produce a specific, evidence-cited root cause
- Fixes — proposes one of five safe, scoped Kubernetes actions (restart pod, rollback deployment, update resource limits, scale deployment, set env var) and executes it on approval
- Explains — provides symptoms, impact, affected resources, prevention advice, and a conversational drill-down for each incident
Kubric is in active development. To set expectations honestly:
Working today
- Push-based in-cluster agent (Helm-installed), state ingestion, and the dashboard
- AI incident detection + diagnosis (one-shot, and an opt-in agentic ReAct reasoning loop)
- One-click remediation for five action types (see Auto-Fix Safety)
- Onboarding wizard, per-shell install command, and a docs page (
/docs)
On the roadmap (not yet built)
- Pre-deploy PR risk (GitHub App, diff analysis, PR comments) — surfaced in the UI as a preview labeled "Coming soon"
- SOC 2 — designed for readiness; certification is planned, not yet obtained
- Auto-fix (autonomous) mode with policy guardrails and rollback-on-regression
┌───────────────────────────────────────────────────────────────────┐
│ KUBRIC PLATFORM │
│ │
│ ┌────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Frontend │─────▶│ Backend │─────▶│ InsForge DB │ │
│ │ (Next.js) │ │ (FastAPI) │ │ (PostgreSQL) │ │
│ └────────────┘ └────────────────┘ └────────────────┘ │
│ ▲ │
└──────────────────────────────┼────────────────────────────────────┘
│ HTTPS (outbound only)
┌──────────┴──────────┐
│ In-Cluster Agent │
│ (runs inside your │
│ Kubernetes cluster)│
└─────────────────────┘
Key security principle: the agent communicates outbound only. The backend never reaches into your cluster.
| Component | Technology |
|---|---|
| Frontend | Next.js 16, React 19, Tailwind CSS 4, GSAP |
| Backend | Python, FastAPI, OpenRouter (GPT-4o-mini) |
| Agent | Python, kubernetes-client, runs in-cluster |
| Database | PostgreSQL via InsForge (BaaS) |
| Auth | InsForge Auth (email + OAuth) |
| Realtime | InsForge Realtime (WebSocket pub/sub) |
| CLI | Go (kubric-cli) |
- Node.js 20+ and npm
- Python 3.11+ and pip
- minikube or kind (local Kubernetes cluster)
- kubectl configured (
kubectl get nodesworks) - An InsForge project (free tier works)
- An OpenRouter API key
git clone https://github.com/Shashank200345/Kubric.git
cd Kubricminikube start
# or: kind create cluster
# Verify:
kubectl get nodescd backend
pip install -r requirements.txtCreate backend/.env:
INSFORGE_URL=https://your-project.region.insforge.app
INSFORGE_API_KEY=your-insforge-service-key
OPENROUTER_API_KEY=sk-or-your-key
OPENROUTER_MODEL=openai/gpt-4o-mini
KUBRIC_DATA_SOURCE=local
CORS_ORIGINS=http://localhost:3000Start the backend:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadVerify: http://localhost:8000/health → {"status": "healthy"}
cd frontend
npm installCreate frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_INSFORGE_URL=https://your-project.region.insforge.app
NEXT_PUBLIC_INSFORGE_ANON_KEY=your-insforge-anon-keyStart the frontend:
npm run devOpen: http://localhost:3000
- Go to
http://localhost:3000/login - Create an account (email + password)
- You'll land on the dashboard showing live cluster state
Deploy a broken workload:
kubectl apply -f kubric-cli/test-manifests/1-oom-autofix.yamlWait ~15s for the pod to crash, then:
- Go to Troubleshoot → select your cluster → Scan Cluster
- Watch the AI diagnose the OOMKill (90%+ confidence)
- Click Approve & Run Fix → memory limit gets raised
- Pod recovers within 30s
Clean up:
kubectl delete ns kubric-fix-testsEach scenario tests one of the five auto-fixable actions:
| Manifest | Issue | Expected Action |
|---|---|---|
1-oom-autofix.yaml |
OOMKilled (50Mi limit, 150Mi usage) | update_resource_limits |
2-missing-env-autofix.yaml |
Missing required env var | update_environment_variable |
3-rollback-autofix.yaml |
Bad image after rollout | rollback_deployment |
4-restart-pod-autofix.yaml |
Transient crash | restart_pod |
5-scale-autofix.yaml |
Over-provisioned (Pending pods) | scale_deployment |
All manifests are in kubric-cli/test-manifests/. Apply one at a time, scan, approve, verify, then delete.
For scenario 3, apply first then break it:
kubectl apply -f kubric-cli/test-manifests/3-rollback-autofix.yaml
# Wait for pod to be Running, then:
kubectl -n kubric-fix-tests set image deployment/rollback-autofix app=nginx:this-tag-does-not-exist-9999.
├── frontend/ # Next.js dashboard + landing page
├── backend/ # FastAPI backend (AI reasoning, API)
│ └── app/
│ ├── ai/ # LLM agent, prompts, guardrails
│ ├── kubernetes/ # Inspectors, executor, service
│ └── main.py # All API endpoints
├── agent/ # In-cluster Python agent
│ ├── main.py # Poll loop (detect, push, execute)
│ └── collector.py # Cluster state snapshot builder
├── kubric-cli/ # Go CLI + Helm chart
│ ├── charts/ # Helm chart for agent deployment
│ └── test-manifests/ # Auto-fix test scenarios
├── docs/ # Architecture notes, deployment guide
└── migrations/ # Database schema (InsForge SQL)
Kubric supports two data modes controlled by KUBRIC_DATA_SOURCE:
local(default, for development): the backend runskubectldirectly against your kubeconfig. Fast, zero setup.agent(production): the in-cluster agent pushes cluster state to the backend every 15s. The backend never touches the cluster directly. Secure, multi-tenant, no inbound firewall holes.
See docs/ARCHITECTURE_push-vs-pull.md for the full security rationale.
The diagnosis engine has two modes, controlled by KUBRIC_REASONING_MODE:
oneshot(default): a single LLM call reasons over a fixed evidence bundle and returns a diagnosis. Fast and predictable.react: an agentic, read-only ReAct loop. The model calls read-only tools (list_pods,describe_pod,get_pod_logs,list_events,list_deployments,list_nodes) to gather exactly the evidence it needs and follow the cause across resources (multi-hop root cause). It's bounded (iteration + tool-call budget + timeout), runs tool calls concurrently, caches results, and always falls back tooneshoton any failure. It never mutates the cluster — remediation still requires approval. Both backends (localkubectl andagentsnapshot) are supported.
To test the push architecture locally:
- Generate a cluster token: Dashboard → Settings → Clusters → Generate Token
- Run the agent:
cd agent
pip install -r requirements.txt
export CLUSTER_TOKEN=<generated-token>
export INGESTION_ENDPOINT=http://localhost:8000/api/v1/ingest
export CLUSTER_NAME=minikube
python main.py- Set
KUBRIC_DATA_SOURCE=agentinbackend/.envand restart the backend - The dashboard now reads from pushed snapshots
The Helm chart is served by the backend, so end users don't need to clone the repo:
helm install kubric-agent https://<your-backend>/install/kubric-agent-0.1.0.tgz \
-n kubric-system --create-namespace \
--set agent.token=<token-from-dashboard> \
--set agent.clusterName=<cluster-name> \
--set agent.ingestionEndpoint=https://<your-backend>/api/v1/ingestThe onboarding wizard and Settings → Clusters generate this command pre-filled and formatted for your shell (macOS/Linux, PowerShell, or Windows CMD). The agent image must be pullable by the cluster (public registry), and metrics-server is recommended for CPU/memory metrics.
See docs/DEPLOYMENT_GUIDE.md for the full guide. Summary:
| Component | Where | How |
|---|---|---|
| Frontend | Vercel | Connect repo, root dir = frontend |
| Backend | Railway / Render | Connect repo, root dir = backend |
| Agent | Inside each customer cluster | Helm install |
| Variable | Description |
|---|---|
INSFORGE_URL |
Your InsForge project URL |
INSFORGE_API_KEY |
InsForge service/admin key (server-side only) |
OPENROUTER_API_KEY |
OpenRouter API key for AI reasoning |
OPENROUTER_MODEL |
LLM model (default: openai/gpt-4o-mini) |
KUBRIC_DATA_SOURCE |
local (dev, uses kubectl) or agent (production, uses pushed snapshots) |
KUBRIC_REASONING_MODE |
oneshot (default, single-shot analysis) or react (agentic read-only tool loop) |
BACKEND_PUBLIC_URL |
Public backend URL, used to build the agent install command |
CORS_ORIGINS |
Comma-separated allowed frontend origins |
| Variable | Description |
|---|---|
NEXT_PUBLIC_API_URL |
Backend URL (no trailing slash) |
NEXT_PUBLIC_INSFORGE_URL |
InsForge project URL |
NEXT_PUBLIC_INSFORGE_ANON_KEY |
InsForge public/anon key |
| Variable | Description |
|---|---|
INGESTION_ENDPOINT |
Backend ingest URL |
CLUSTER_TOKEN |
Per-cluster auth token |
CLUSTER_NAME |
Human-readable cluster name |
POLL_INTERVAL_SECONDS |
Polling interval (default: 15) |
The agent never applies a fix without explicit user approval. The safety chain:
- AI proposes an action from exactly 5 allowed types
- Deterministic backstop validates the action matches the root cause category
- LLM plausibility check confirms the action makes sense
- User approval — the fix button is shown only when all checks pass
- Execution — runs with the agent's scoped in-cluster RBAC (not a super-admin)
- Result reporting — real kubectl output shown to the user (success or failure)
Blocked namespaces (kube-system, kube-public, kube-node-lease) can never be modified.
- Fork the repo
- Create a feature branch
- Make your changes
- Run
npm run buildinfrontend/to verify - Submit a PR
Never commit .env, .env.local, or API keys. The .gitignore is configured to prevent this.
MIT