With Red Hat OpenShift Lightspeed 2 on Red Hat OpenShift 5, you can configure autonomous agents to start troubleshooting when a cluster alert fires. An agent can inspect cluster resources, read logs and events, and propose a fix. With the required approvals, the workflow can then apply the fix and verify the result.
In this article, you'll learn how this workflow works, how to enable it, and how to control its level of automation. We'll then test it with a cluster failure, following the investigation from the initial alert to remediation and verification.
How OpenShift Lightspeed autonomous agents work
OpenShift Lightspeed autonomous agents follow a workflow with 4 tasks: analyzing the problem, applying a fix, checking the result, and escalating when you need further help. You can use the same agent across stages or configure different agents for each one.
The process starts when OpenShift Lightspeed detects a firing alert that matches its configuration. It creates an AgenticRun, a custom resource that tracks the investigation and its progress through the workflow:
- Analysis. The agent inspects cluster resources, reads logs and events, and gathers evidence to identify the likely cause. It then prepares a diagnosis and a proposed remediation for review.
- Execution. After approval, the agent applies the proposed fix in a temporary sandbox with permissions scoped to the task.
- Verification. The agent checks whether the remediation resolved the problem.
- Escalation. If execution or verification fails, the escalation agent summarizes the outcome and provides context for an administrator to continue the investigation.
An approval policy controls whether each stage requires manual approval or starts automatically. By default, every stage waits for approval. Later in this article, we'll configure a policy that lets analysis and verification run automatically while keeping execution under your control.
Figure 1 shows an example of an AgenticRun in the Red Hat OpenShift web console after the agent diagnoses an alert and executes a fix.

AgenticRun detail view displaying the analysis request, selected remediation plan, and execution results.Prerequisites
- Red Hat OpenShift 5.0+ cluster with
cluster-adminaccess - An API key for a tool-calling large language model (LLM) (this guide uses OpenAI with the
gpt-5.6-lunamodel, but OpenShift Lightspeed supports other providers and models; see the OpenShift Lightspeed documentation for all available configurations)
OpenShift Lightspeed autonomous agents are available as a Technology Preview. Red Hat doesn't support Technology Preview features with production service level agreements (SLAs), and they might not be functionally complete. Red Hat doesn't recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For details, see Technology Preview Features Support Scope.
Step 1: Install OpenShift Lightspeed
In the Red Hat OpenShift web console, go to Ecosystem → Software Catalog and search for OpenShift Lightspeed, as shown in Figure 2. Accept the default settings, and select Install.

Installing the operator prepares the controllers. We'll configure alert filtering next, then create the OLSConfig custom resource that deploys the Lightspeed services.
Step 2: Choose which alerts to investigate
By default, no alerts trigger an automatic investigation. To enable this behavior, configure the alerts-adapter-config ConfigMap and specify which Alertmanager receivers the agents should monitor.
Alertmanager uses routing rules to assign alerts to named receivers based on labels such as severity or namespace. By listing receiver names under allowedReceivers, you reuse those rules to select which alerts can trigger an investigation. This example allows alerts routed to the Critical receiver:
oc apply -f - <<'EOF'
apiVersion: v1
kind: ConfigMap
metadata:
name: alerts-adapter-config
namespace: openshift-lightspeed
data:
config.yaml: |
filtering:
allowedReceivers:
- Critical
tools:
skills:
- image: quay.io/openshiftanalytics/agentic-skills:ocp-5.0
paths:
- /skills/cluster-troubleshoot/investigate-alert
EOFCritical is a receiver name, rather than a severity label. The default OpenShift Alertmanager configuration routes alerts with severity: critical to this receiver. If your cluster uses different routing rules, adjust the receiver name accordingly.
The tools.skills section shows how to add optional skills to guide the agent during analysis. This example uses the cluster-troubleshoot skill from the openshift/agentic-skills repository, packaged as an Open Container Initiative (OCI) image and published at quay.io/openshiftanalytics/agentic-skills.
In the next step, we'll reference this ConfigMap in the OLSConfig to enable alert processing. For more configuration options, see Autonomous agentic troubleshooting.
Step 3: Configure Lightspeed and enable alert processing
The alert configuration is now in place. Next, we'll create the OLSConfig that deploys the Lightspeed services and connects them to this configuration.
OpenShift Lightspeed intelligent assistant and OpenShift Lightspeed autonomous agents currently use separate LLM credential configurations. We'll configure the credentials for intelligent assistant here, then configure those for autonomous agents in the next step.
First, create the credentials secret:
oc apply -f - <<'EOF'
apiVersion: v1
kind: Secret
metadata:
name: credentials
namespace: openshift-lightspeed
type: Opaque
stringData:
apitoken: <YOUR_OPENAI_API_KEY>
EOFNow create the OLSConfig with the alerts adapter enabled:
oc apply -f - <<'EOF'
apiVersion: ols.openshift.io/v1alpha1
kind: OLSConfig
metadata:
name: cluster
spec:
llm:
providers:
- name: openai
type: openai
credentialsSecretRef:
name: credentials
url: https://api.openai.com/v1
models:
- name: gpt-5.6-luna
ols:
defaultModel: gpt-5.6-luna
defaultProvider: openai
deployment:
alertsAdapter:
configMapRef:
name: alerts-adapter-config
EOFWait for the app server to become available. The initial image downloads can take several minutes:
oc wait --for=condition=Available deployment/lightspeed-app-server \
-n openshift-lightspeed --timeout=900sVerify the alerts adapter is running:
oc rollout status deployment/lightspeed-agentic-alerts-adapter \
-n openshift-lightspeed --timeout=300sStep 4: Configure the troubleshooting agent
OpenShift Lightspeed autonomous agents require an LLM provider and a model. The following configuration creates the provider credentials, connects them through an LLMProvider, and defines the default agent used by the workflow:
oc apply -f - <<'EOF'
apiVersion: v1
kind: Secret
metadata:
name: llm-creds-openai
namespace: openshift-lightspeed
type: Opaque
stringData:
OPENAI_API_KEY: <YOUR_OPENAI_API_KEY>
---
apiVersion: agentic.openshift.io/v1alpha1
kind: LLMProvider
metadata:
name: openai
namespace: openshift-lightspeed
spec:
type: OpenAI
openAI:
credentialsSecret:
name: llm-creds-openai
---
apiVersion: agentic.openshift.io/v1alpha1
kind: Agent
metadata:
name: default
namespace: openshift-lightspeed
spec:
llmProvider:
name: openai
model: gpt-5.6-luna
EOFThe workflow uses the default agent unless you select another agent. You can define additional Agent resources to use different models or settings for specific stages.
Step 5: Grant investigation and execution permissions
The agent now has a model, but it also needs access to cluster data. We'll grant read access for investigation and give the controller permissions to create remediation sandboxes.
Investigation permissions
The agent service account needs cluster-wide read access. The operator doesn't create these bindings automatically. Keep lightspeed-agent in the subjects of both bindings: the controller uses this account to find the reader bindings and grant read permissions to sandbox service accounts. Without the reader binding, analysis fails before the agent starts, with an error such as "no ClusterRoleBinding found with subject openshift-lightspeed/lightspeed-agent." Apply both bindings before starting an AgenticRun:
oc apply -f - <<'EOF'
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lightspeed-agent-cluster-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-reader
subjects:
- kind: ServiceAccount
name: lightspeed-agent
namespace: openshift-lightspeed
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lightspeed-agent-monitoring-view
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-monitoring-view
subjects:
- kind: ServiceAccount
name: lightspeed-agent
namespace: openshift-lightspeed
EOFExecution permissions
For this walkthrough, we grant the controller cluster-admin access so it can create the roles that remediation sandboxes need. Each sandbox receives the permissions defined for its task:
oc apply -f - <<'EOF'
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lightspeed-agentic-controller-cluster-admin-extra
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: lightspeed-agentic-operator-controller-manager
namespace: openshift-lightspeed
EOFFor a more restricted setup, limit the controller permissions to the operations you intend to allow. The controller permissions and the permissions assigned to each temporary sandbox are separate parts of the access model.
Step 6: Choose which stages require approval
With credentials and permissions in place, we can decide where the workflow should pause for review. Without an ApprovalPolicy, every stage waits for manual approval.
For this example, we'll let analysis, verification, and escalation run automatically. Execution will still require your approval, so you can review the diagnosis and proposed changes before the agent applies them:
oc apply -f - <<'EOF'
apiVersion: agentic.openshift.io/v1alpha1
kind: ApprovalPolicy
metadata:
name: cluster
spec:
stages:
- name: Analysis
approval: Automatic
- name: Execution
approval: Manual
- name: Verification
approval: Automatic
- name: Escalation
approval: Automatic
EOFApproval is at the stage level: you approve or reject an entire stage, not individual commands within it. With this policy, only execution pauses for your sign-off.
Test the workflow with an image-pull failure
The configuration is complete. We'll now deploy an application with an incorrect image name and follow the workflow through investigation, approval, and verification.
Trigger an investigation
The following manifest creates the deployment and an alert that detects its image-pull failure:
oc apply -f - <<'EOF'
apiVersion: v1
kind: Namespace
metadata:
name: web-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-server
namespace: web-app
spec:
replicas: 1
selector:
matchLabels:
app: web-server
template:
metadata:
labels:
app: web-server
spec:
containers:
- name: hello
image: quay.io/openshift/origin-ehllo-openshift:latest
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: web-server-image-pull-alert
namespace: openshift-monitoring
spec:
groups:
- name: web-server.alerts
rules:
- alert: WebServerImagePullFailure
expr: |
max by (namespace, pod, container) (
kube_pod_container_status_waiting_reason{
namespace="web-app",
reason="ImagePullBackOff"
} > 0
)
for: 1m
labels:
severity: critical
annotations:
summary: "Pod {{ $labels.pod }} cannot pull its container image"
description: >-
Container {{ $labels.container }} in pod {{ $labels.pod }}
(namespace {{ $labels.namespace }}) is stuck in ImagePullBackOff.
EOFThe image name origin-ehllo-openshift is a typo—the correct name is origin-hello-openshift. The pods enter ImagePullBackOff, and the WebServerImagePullFailure alert fires after the condition has remained true for 1 minute, plus evaluation and routing delays.
This manifest places the PrometheusRule in openshift-monitoring so platform Prometheus evaluates it without enabling user-workload monitoring. We don't recommend this for production environments because Red Hat OpenShift reserves that namespace for platform alerts—use user-workload monitoring and deploy PrometheusRule resources in your application namespace instead. The severity: critical label causes Alertmanager to route the alert to the Critical receiver, which matches the adapter configuration from step 2.
Once the alert fires, the alerts adapter creates an AgenticRun:
oc get agenticrun -n openshift-lightspeed -wYou can also monitor the investigation in the Red Hat OpenShift web console under Observe → Agentic Runs → Agentic runs, as shown in Figure 3.

If you kept the default approval policy instead of applying the step 6 policy, the run pauses at the analysis stage until you select Approve Analysis (Figure 4).

Review and approve the remediation
With the policy from step 6, analysis starts automatically. The agent inspects the pods, reads events, and prepares a diagnosis and remediation plan. If you kept the default approval policy, approve analysis first.
Open the run in Agentic Runs and review the diagnosis and proposed changes. For this example, check whether the agent has identified the incorrect image reference and proposed a suitable replacement.
Approve the execution stage to let the agent apply the remediation. With the policy from step 6, the workflow then proceeds automatically to verification, where the agent checks the result.
Review the image reference identified in the diagnosis and the proposed remediation before approving execution. Open the run in Agentic runs to review the proposed remediation options generated by the analysis stage, as shown in Figure 5.

Select the AI-recommended plan to inspect its root cause diagnosis, scoped namespace permissions, and proposed commands before approving execution (Figure 6).

After you select Execute remediation, the agent updates the Deployment in a scoped sandbox and tracks each step in the Execution card (Figure 7).

With the step 6 approval policy, the workflow then proceeds automatically to verification and confirms that the replacement pod is ready (Figure 8).

Returning to the Agentic runs list confirms that the run status has updated to Completed alongside its token consumption totals (Figure 9).

Check the result
Review the verification outcome in the run, then check the deployment independently:
oc rollout status deployment/web-server -n web-app --timeout=300sConfirm the deployment becomes available and the alert resolves. Alert resolution can take longer than the rollout because Prometheus and Alertmanager update on their own schedules.
Other alerts routed to the Critical receiver can also trigger investigations. With the policy from Step 6, these runs start analysis automatically and pause before execution. Review each proposal before approving changes.
Clean up
oc delete namespace web-app
oc delete prometheusrule web-server-image-pull-alert -n openshift-monitoring
oc delete agenticrun <run-name> -n openshift-lightspeedReplace with the name from the oc get agenticrun output.
What to try next
In this example, we followed a troubleshooting run from a firing alert through analysis, remediation, and verification. Receiver filtering determined which alerts could start a run, while the approval policy determined where the workflow paused for review.
To evaluate the workflow further, try another failure you understand well. Compare the agent's diagnosis with the cluster evidence, review the proposed changes, and check the result after execution. Keeping the execution approval manual gives you a clear point to assess each proposal as you explore different cases.
Share your findings about OpenShift Lightspeed autonomous agents through the Red Hat OpenShift web console feedback mechanism, including cases where the diagnosis was incomplete or the proposed remediation needed changes.