Skip to main content
Loading navigation
Back to prompt library

Gemini 2.5 Pro-powered Remediation Planning Node

Linked challenge: Cyberthreat Orchestrator Agent

Prompt source

implementation13 lines6 sectionsNo variables1 code block
Implement the 'Remediation Planning' node within your LangGraph. This node should receive the classified threat type and severity from the 'Threat Analysis' node's state. Use Gemini 2.5 Pro to generate a detailed, actionable remediation plan. Your prompt to Gemini 2.5 Pro should instruct it to output the plan as a list of sequential steps. Include the Python code for this LangGraph node and its interaction with Gemini 2.5 Pro.

```python
from langchain_google_genai import ChatGoogleGenerativeAI

def remediation_planner(state: AgentState) -> AgentState:
    threat_type = state["threat_type"]
    severity = state["severity"]

    llm = ChatGoogleGenerativeAI(model="gemini-2.5-pro", temperature=0.7)

    prompt = f"Given a {severity} level {threat_type} threat, generate a sequential, actionable remediation plan. Output as a numbered list of steps.\nThreat: {threat_type}\nSeverity: {severity}\nRemediation Plan:"
    
    response = llm.invoke(prompt)
    # ... parse response into a list of strings ...
    state["remediation_plan"] = [response.content]
    return state
```