Native Shell
Native Shell은 모든 플랫폼의 앱 안에서 만들어지는 AI UI입니다
Pulse Agent가 OpenShift 클러스터를 감시해 변경 사항과 사고를 연결하고, 승인 없이는 변경하지 않으며, 수정 여부를 확인합니다
Pulse Agent watches an OpenShift cluster, ties incidents to what changed, and changes nothing without your approval. Then it checks the fix held.
개발 도구Python · ShellGitHub @PulseSRE온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
A team of AI agents for OpenShift, built on Claude. Finds what broke, verifies it with you by showing the evidence, and helps you fix it.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A team of AI agents for OpenShift, built on Claude. They watch your cluster, trace each incident to the change behind it, and build you a live view of the evidence so you can check their work before anything changes. Ask in plain English and Pulse builds the dashboard you asked for.
| See the proof | Ask for a view, get one |
|---|---|
AI-powered OpenShift SRE and Security Agent built on Claude. Pulse Agent connects to your cluster via the Kubernetes API and uses the configured Claude model for diagnostics, incident triage, security audits, and automated remediation -- all through natural language. It pairs with the OpenShift Pulse UI for rich incident management, or runs standalone as a CLI. Both are deployed together via the pulse-operator — see Deploy to OpenShift below.
Runs on OpenShift, not vanilla Kubernetes. The deployed product uses
route.openshift.iofor ingress,oauth.openshift.iofor single sign-on, andconfig.openshift.ioto discover the cluster's application domain. There is no Ingress fallback and no capability detection, so on a cluster without those APIs the install fails rather than degrades. OpenShift 4.12+ is required — see the operator's prerequisites. The CLI below is a developer workflow and will talk to any cluster your kubeconfig points at; only the deployed product is OpenShift-bound.
Docs: Documentation index | Operator (install) | API Contract | Architecture | Database | Security | Design Principles | Testing & Evals | Skill Developer Guide | Contributing | Changelog
Pulse Agent uses the ORCA (Orchestrated Routing & Classification Architecture) system to route every user query to the right skill with the right tools. This replaces keyword-only routing with multi-signal intelligence.
The selector supports six scoring channels (availability depends on data/configuration). Scores are fused with the default weights below or persisted learned weights:
| Channel | Signal | Weight |
|---|---|---|
| Keyword | Skill keyword index (longest-match-first) | 0.25 |
| Component | K8s resource types extracted from query (Pod, Deployment, Service, etc.) matched to skill categories | 0.20 |
| Historical | Token co-occurrence from past successful skill usages (from skill_usage table) | 0.20 |
| Semantic | TF-IDF cosine similarity between query and skill descriptions/keywords | 0.15 |
| Taxonomy | Alert name prefixes and scanner category matching | 0.10 |
| Temporal | Recent-change keywords, cluster changes, and time-of-day signals | 0.10 |
Weights are not static -- they are recomputed daily from outcomes via selector_learning.py. When the agent loads a different skill mid-turn with skill_load, that turn is logged as an override, and the skill it reached for counts as the right answer. Channels whose top pick matched the right skill gain weight; the rest lose it. Weights change only after at least 3 corrections in the window, because uncorrected selections are the selector agreeing with itself. Learned weights persist to the database.
Complex incidents are resolved through multi-phase plans that progress through stages:
Triage -- Identify the problem scope and severity. Diagnose -- Investigate root cause with evidence gathering. Remediate -- Apply fixes (with confirmation gates for write operations). Verify -- Confirm the fix resolved the issue. Postmortem -- Auto-generate a structured incident report.
12 built-in plan templates cover the most common incident types:
| Template | Scanner Category | Phases |
|---|---|---|
crashloop-resolution | crashloop | triage, diagnose, remediate, verify |
oom-investigation | oom | triage, memory_analysis, patch_resources, verify |
node-pressure | nodes | triage, node_diagnostics, drain_cordon, verify |
deployment-failure | workloads | triage, change_analysis, rollback_decision, verify |
image-pull-error | image_pull | triage, diagnose, remediate, verify |
scheduling-failure | scheduling | triage, diagnose, remediate, verify |
cert-expiry | cert_expiry | triage, diagnose, verify |
operator-degraded | operators | triage, diagnose, verify |
security-incident | security | triage, security_scan, rbac_audit, remediation_plan, verify |
latency-degradation | latency | triage, trace_source, investigate, remediate, verify |
control-plane-pressure | control_plane | triage, diagnose, relief, verify |
hpa-saturation | hpa | triage, diagnose, verify |
Every phase that changes the cluster is approval_required, and a phase that does not produce what its contract promises stops remediation (needs_escalation). A finished plan becomes an investigation report whose diagnosis comes from the phase that promises a root_cause.
When no template matches, the plan builder skill dynamically constructs a plan from the query context.
skill.md with trigger patterns, tool sequences, and investigation framework extracted from the resolution. Stored as generated_by="auto", reviewed=false and surfaced in the Toolbox UI for review.7 skills loaded at startup from sre_agent/skills/. Each skill is a self-contained directory with skill.md (prompt + frontmatter), evals.yaml (test scenarios), and optional components.yaml or mcp.yaml.
| Skill | Description | Categories | Write Access |
|---|---|---|---|
| sre | Cluster diagnostics, incident triage, resource management | diagnostics, workloads, networking, storage, monitoring, operations, gitops | Yes |
| security | Security scanning, RBAC analysis, compliance checks | security, networking | No |
| view_designer | Dashboard creation and component design | (all tools) | No |
| capacity_planner | Capacity analysis, resource forecasting, scaling recommendations | diagnostics, monitoring, workloads | No |
| plan_builder | Investigation plans and custom skill creation | diagnostics, workloads, monitoring, operations | Yes |
| postmortem | Auto-generates structured postmortem reports from incident data | diagnostics | No |
| slo_management | SLO/SLI tracking, error budget analysis, burn rate alerting | monitoring, diagnostics | No |
Skills support handoff: the SRE skill hands off to security when it detects scan/RBAC keywords, and to view_designer for dashboard requests. User-created skills can be added at runtime without restarting the agent.
See docs/SKILL_DEVELOPER_GUIDE.md for creating new skills.
get_resource_recommendations compares actual CPU/memory usage to requests/limits via Prometheus:latest tags, missing digest pins, untrusted registriesPOST /monitor/pause) that survives pod restartsmonitor_noise)Optional and inert until configured — see docs/TEMPORAL.md. Not to be confused with ORCA's temporal channel above, which scores recent-change keywords.
approval_required phases were marked needs_escalation and skipped, because an in-process engine cannot block for hours. On Temporal the workflow waits for a signal, so human-in-the-loop plans are possible rather than structurally impossibleGET /workflow-runs/awaiting-approval, answerable from the console's inbox or Runs tab. A durable run can also start from an inbox item (POST /inbox/{id}/durable-run), so the plan investigates that findingPulsePlanWorkflow executes any plan definition by walking its phase graph, including plans authored in the UI at runtime. A new plan is data, not a deploy. Sequencing decisions are pure functions (temporal/sequencing.py), testable without a Temporal server and incapable of IO; all IO lives in activities, and phase execution still goes through PlanRuntime._execute_phase with the same contract check and retry-with-gapPULSE_AGENT_TEMPORAL_HOST (plus _NAMESPACE, _TASK_QUEUE, _APPROVAL_TIMEOUT). The operator provisions a server with spec.temporal.enabled and injects the hostVerification contracts cover five native write tools. They check first, capture a snapshot where supported, and probe the outcome. Other mutation paths require their own safety review; no universal coverage is claimed.
tool_contracts.py) -- The five most-used write tools (restart_deployment, scale_deployment, delete_pod, rollback_deployment, cordon_node) run as precondition read -> snapshot -> action -> postcondition probe. A missing target or permission gap refuses the write before anything changes, under the caller's own tokenmonitor/health_gate.py) -- Post-fix verification reads the live object and requires it to look healthy. A gate that cannot get a clear answer returns UNVERIFIABLE, which is never treated as successsnapshot.py) -- A copy of the resource's own spec captured immediately before the write, so POST /fix-history/{id}/rollback can put it back rather than describing what it used to look likepolicy.py) -- Deterministic, config-backed, no model in the loop. Protected namespaces (PULSE_AGENT_PROTECTED_NAMESPACES, default production,openshift-*,kube-system) and node operations are denied on both the chat path and the unattended auto-fix path, which records a blocked outcome instead of acting. A denial names the policy and the sanctioned path rather than just refusingtrajectory.py) -- A diagnosis becomes a reusable skill only after its fix is confirmed resolved. A fix that did not hold drops its candidate unlearned/metrics -- Token usage, estimated USD cost, investigation budget, scanner runs, autofix outcomes exposed as Prometheus counters/gauges for alerting via cluster monitoring stackGET /analytics/budget returns real-time investigation budget (used/remaining) and optional cost budget statusPULSE_AGENT_COST_BUDGET_USD) pauses investigations when exceededspec.monitoring.enabled, default true)memory_tools). PULSE_AGENT_MEMORY=0 turns both offintelligence.py feeds query reliability, error hotspots, dashboard patterns, and token efficiency back into the system promptartifact_store.py, migration 036) -- Skills the agent writes at runtime, plan templates, scaffolded eval scenarios and replay fixtures, and their .versions/ history are written through to PostgreSQL and replayed onto disk at startup. Before this, everything the agent learned lived on the container's overlay filesystem and was erased by the next restart or rolloutPOST /plan-templates creates an investigation plan (not just edits one), validating phase ids and skill names and carrying each phase's produces contract. Every write archives the prior body, so GET /plan-templates/{type}/versions makes a plan edit reversiblephase_judge names which declared produces fields a phase failed to return; contract_missing is persisted per phase and aggregated by /analytics/plans, so "3 partial" becomes "partial because diagnose never produced root_cause"oc login or valid ~/.kube/config) — the CLI itself is not OpenShift-bound; the deployed product isgit clone https://github.com/PulseSRE/pulse-agent.git
cd pulse-agent
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
Pick one:
# Option A: Vertex AI
export ANTHROPIC_VERTEX_PROJECT_ID=your-gcp-project
export CLOUD_ML_REGION=us-east5
gcloud auth application-default login
# Option B: Anthropic API
export ANTHROPIC_API_KEY=sk-ant-...
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_VERTEX_PROJECT_ID | GCP project for Vertex AI | required* |
CLOUD_ML_REGION | GCP region | required* |
ANTHROPIC_API_KEY | Direct Anthropic API key | required* |
PULSE_AGENT_MODEL | Claude model | claude-sonnet-5 |
PULSE_AGENT_DATABASE_URL | PostgreSQL connection URL | required for full features |
PULSE_AGENT_MEMORY | Enable self-improving memory | 1 (enabled) |
PULSE_AGENT_AUTOFIX_ENABLED | Enable monitor auto-fix | true |
PULSE_AGENT_MAX_TRUST_LEVEL | Server monitor trust level (0-4); effective trust is floored here. Also accepts PULSE_AGENT_TRUST_LEVEL, the name the operator injects from spec.agent.trustLevel | 2 (ask first) |
PULSE_AGENT_PROTECTED_NAMESPACES | Protected namespaces for the pod-deletion deny rule on chat and auto-fix paths (comma list, * wildcards) | production,openshift-*,kube-system |
PULSE_AGENT_ALLOW_NODE_OPS | Allow node-level operations (cordon/drain) through chat confirmation | false |
PULSE_AGENT_RECURRENCE_WINDOW | Seconds after a verified fix within which the same problem returning is recorded as a recurrence | 1800 |
PULSE_AGENT_SCAN_INTERVAL | Monitor scan interval (seconds) | 60 |
PULSE_AGENT_WS_TOKEN | Shared WS/REST service token; missing token rejects access | generated by the operator; configure for standalone API |
PULSE_AGENT_HARNESS | Enable tool selection optimizations | 1 (enabled) |
*One of Vertex AI or Anthropic API key is required.
# SRE agent (CLI)
python -m sre_agent.main
# Security scanner (CLI)
python -m sre_agent.main security
# API server (WebSocket + REST, port 8080)
pulse-agent-api
For full features (memory, views, tool analytics, SLOs), you need a PostgreSQL instance. The simplest local setup:
podman run -d --name pulse-dev-pg \
-p 127.0.0.1:5434:5432 \
-e POSTGRES_USER=pulse \
-e POSTGRES_PASSWORD=pulse \
-e POSTGRES_DB=pulse_dev \
postgres:16-alpine
export PULSE_AGENT_DATABASE_URL=postgresql://pulse:pulse@localhost:5434/pulse_dev
Schema migrations are applied automatically on startup.
The test suite (make test) uses a separate disposable PULSE_AGENT_TEST_DATABASE_URL; its fixture drops the public schema. See TESTING. It does not use the development URL above by default. Create that database as UTF-8 — a SQL_ASCII cluster (the default for
some standalone macOS builds) fails on fixtures containing an em dash, and the error
surfaces as an unrelated-looking empty result rather than an encoding error.
The pulse-operator README is the canonical install guide — it is the only place the steps are maintained, so anything here that contradicts it is wrong.
Install via the pulse-operator — an OLM-managed Kubernetes Operator that deploys this agent alongside the OpenShift Pulse UI and PostgreSQL from a single OpenShiftPulse custom resource. See the operator's README for the full CatalogSource → Subscription → CR walkthrough.
Key CR fields relevant to this agent (set on the OpenShiftPulse resource, not via Helm values):
| Field | Description | Default |
|---|---|---|
spec.vertexAI.projectId | GCP project (required if using Vertex AI) | -- |
spec.anthropicApiKey.existingSecret | K8s Secret with Anthropic API key | -- |
spec.agent.allowWriteOperations | Enable scale, restart, cordon, delete, apply | false |
spec.agent.allowSecretAccess | Enable secret scanning | false |
spec.agent.mcp.enabled | Deploy OpenShift MCP server sidecar | false |
spec.agent.trustLevel | Autonomy level: 0=observe, 1=suggest, 2=confirm, 3=batch, 4=autonomous | 2 |
spec.vertexAI and spec.anthropicApiKey are mutually exclusive — the CRD rejects a CR with both set via a validation rule. Neither is required at the CRD level, but the agent has no AI backend without one (the operator emits a NoAIBackendConfigured warning event if you omit both). The WebSocket auth token and PostgreSQL credentials are auto-generated once and reused across every reconcile — no manual token management, and no re-generation that would invalidate an existing connection.
runAsNonRoot, readOnlyRootFilesystem, drops all capabilitiescreate_skill, edit_skill, delete_skill, create_skill_from_template, propose_git_change) are offered only to admins (spec.agent.adminUsers on the operator; empty means any signed-in user)describe_resource replaces Secret values with their sizes before anything reaches the modelSee SECURITY.md for the full model.
/healthzThe OpenShift Pulse frontend is a React/TypeScript application that connects to the agent via WebSocket. Key surfaces:
6 tabs for full incident lifecycle management:
| Tab | What it shows |
|---|---|
| Active | Live findings from the monitor with severity, confidence, and auto-fix controls |
| Timeline | Chronological event stream across all scanners |
| Review Queue | Proposed actions awaiting human approval (trust level 2) |
| Postmortems | Auto-generated postmortem reports from resolved incidents |
| History | All past findings and actions with rollback support |
| Alerts | Prometheus firing alerts with investigation links |
/topology)Live dependency graph visualization showing resource relationships, blast radius overlays, and change risk scores.
Consolidated management page with 8 tabs:
| Tab | Purpose |
|---|---|
| Catalog | All native and MCP tools, organized by agent and category |
| Skills | 7 loaded skills with status, keywords, and handoff configuration |
| Plans | Plan templates and active plan executions |
| SLOs | SLO registry, error budgets, and burn rate status |
| Connections | MCP server connections and toolset toggles |
| Components | Component type catalog with rendering examples |
| Usage | Paginated tool invocation audit log |
| Analytics | Top tools, chain patterns, routing accuracy, token efficiency |
pip install -e '.[test]'
python3 -m pytest tests/ -v # Full test suite
python3 -m pytest tests/test_health_gate.py # Single file
make verify # Lint + type-check + tests
The pytest suite uses a disposable PostgreSQL database and controlled Kubernetes/model responses; it does not prove live cluster behavior. Provider-backed evaluation commands are separate and require credentials. See TESTING.md for test conventions, fixtures, and coverage targets.
Fixture inventories change with the checked-in JSON/YAML. Scenario reports score supplied fixture data; they are not live-agent release evidence.
make evals # offline harness and fixture reports
make eval-gate # live model and judge against recorded tool results
python -m sre_agent.evals.acceptance_cli --sim artifacts/srebench-sim-*.json \
--replay artifacts/live_judge.json --output artifacts/mandatory_acceptance.json
CI also runs the production agent through SRE-Bench simulation, enforces the core/error score gates, and checks mandatory safety/outcome artifacts. See TESTING and release procedure for credentials, exact workflow commands and evidence limits. A historical score or successful image build cannot establish current model quality or real-cluster recovery.
Simplified overview. See docs/ARCHITECTURE.md for full details.
sre_agent/
main.py CLI entry point (Rich UI, streaming)
serve.py + api/ FastAPI server (WebSocket + REST)
agent.py Shared agent loop (Claude API, tool execution, confirmation gates)
config.py Pydantic v2 Settings (PULSE_AGENT_ env prefix)
# ORCA routing
skill_loader.py Skill loading, tool selection, query routing
skill_selector.py 6-channel multi-signal selector
selector_learning.py Batch weight recomputation from outcomes
skill_scaffolder.py Auto-scaffold skills from novel resolutions
skill_plan.py Phased plan data structures
plan_templates/ YAML plan templates (crashloop, OOM, nodes, workloads, image_pull, ...)
postmortem.py Auto-postmortem from plan outputs
slo_registry.py SLO/SLI registry with burn rates
dependency_graph.py Live K8s resource dependency graph
change_risk.py Pre-deploy risk scoring
# Tools
k8s_tools/ Kubernetes tool modules
security_tools.py Security scanning tools
fleet_tools.py 7 multi-cluster tools (user token; Secret values never returned)
gitops_tools.py 6 ArgoCD tools
predict_tools.py 3 predictive analytics tools
timeline_tools.py Incident correlation
view_tools.py Dashboard creation + namespace summary
self_tools.py Self-description + skill management + K8s API introspection
handoff_tools.py Agent-to-agent handoff
tool_registry.py Central registry (all tools register at import)
# Monitor
monitor/ 33 modules: session, scanners, baselines, change correlation, investigations, auto-fix, ...
# Intelligence
intelligence.py Analytics feedback loop into system prompt
tool_predictor.py TF-IDF + LLM fallback + co-occurrence tool selection
tool_chains.py Bigram tool chain discovery
tool_usage.py Audit log (PostgreSQL)
promql_recipes.py 83 PromQL recipes
# Infrastructure
db.py PostgreSQL abstraction + migrations (v041)
memory/ Self-improving agent (incidents, runbooks, patterns)
mcp_client.py MCP server connections (SSE transport)
orchestrator.py Typo correction (~130 K8s misspellings)
context_bus.py Cross-agent shared context
| Endpoint | Description |
|---|---|
WS /ws/agent | Auto-routing orchestrated agent (ORCA classifies each message) |
WS /ws/monitor | Autonomous monitor (32 scanners, auto-fix, predictions) |
All WebSocket endpoints require ?token=... query parameter (constant-time comparison). Protocol v2.