How to Build a SOC Alert Triage Agent (2026 Tutorial)
Build a tier-1 SOC agent that enriches and correlates alerts, scores severity with MITRE mapping, and recommends contain, dismiss, or escalate — never auto-containing blindly.
This is a hands-on tutorial for building an aI SOC Alert Triage Agent — an agent that can triage a security alert the way a good tier-1 SOC analyst would. It maps directly to our AI SOC Alert Triage Agent blueprint, so you can read the build here and then grab the full runnable kit (system prompt, tools, and a one-command starter) when you're ready. It's written for security teams whose tier-1 queue is mostly enrichment and obvious-case handling.
SOCs drown in alerts, and analysts spend most of their day on enrichment and obvious false positives instead of real threats. Triage a security alert the way a good tier-1 SOC analyst would is the kind of high-volume, judgment-light-but-context-heavy work an agent handles well — provided you build it with the right boundary. Throughout, the single most important design rule is this: the agent's worst-case action is containing a host or disabling an account automatically, which can disrupt the business and tip off an adversary, and that action stays behind a human gate. Everything else follows from that.
What you're building
The agent is a control loop, not a single prompt. It takes an input, reasons about what to do, calls tools to gather evidence and act, observes the results, and continues until it reaches a conclusion or hits a stopping condition. The stack we use in the blueprint is Claude, LangGraph, OpenAI — but the design transfers to any framework, because what matters is the shape of the loop and the boundary around it, not the library.
Concretely, the finished agent will accept its input, enrich it with real context from your systems, reason over that evidence, and produce a structured, reviewable output — with anything irreversible or high-risk routed to a human rather than executed silently.
The tools the agent needs
An agent is only as capable as the tools you give it, and only as safe as the contracts on those tools. This blueprint uses 8 tools: get_alert, enrich_ioc, asset_lookup, identity_lookup, correlate_alerts, contain_host, create_incident, escalate_to_tier2. Notice the split — most are read tools that gather evidence (the safe, high-volume work), and the few that act are exactly the ones that belong behind a gate. That division is deliberate: give the agent broad read access to do the tedious enrichment, and narrow, gated write access so it can't cause harm it can't undo.
Each tool needs a strict contract — a well-defined input and output — because loose tool definitions are where agents go off the rails, calling the wrong action or passing invalid arguments. Define them tightly before you wire up any reasoning.
Step by step
1. Start with the boundary. Before writing the system prompt, write down the worst-case action (containing a host or disabling an account automatically, which can disrupt the business and tip off an adversary) and decide which tools are gated. This one decision shapes the whole build.
2. Ground the agent in real context. Wire the read tools first and confirm the agent can pull the evidence it needs — the diff, the alert, the schema, the contract, whatever the input demands. An agent reasoning over stale or missing context will produce confident nonsense, so get retrieval solid before anything else.
3. Write the system prompt as an operating manual. Name the tools and the decision criteria, not just the goal. Tell the agent how to weigh evidence, when to act, when to ask, and — critically — when to stop and escalate. The blueprint's system prompt is 500–700 words for exactly this reason: an agent that acts needs explicit operating rules, not a one-line instruction.
4. Gate the irreversible step. Split every consequential capability into a reversible "propose" step the agent owns and an irreversible "commit" step a human approves. The agent does all the work right up to the edge of consequence; a person crosses it.
5. Add confidence and escalation. Have the agent score its own confidence and escalate when it's low, when the input is ambiguous, or when the stakes are high. An agent that knows when not to act is more valuable than one that always has an answer.
6. Instrument it. Log every decision — the inputs, the tool calls, the reasoning, the output — so you can evaluate whether the agent was right, not just whether it ran. Most production agents have observability but skip evaluation, and that gap is where failures live.
The guardrails that make it production-ready
The difference between this agent and a flashy demo is entirely in the boundaries. It never takes its worst-case action autonomously. It authenticates with its own identity and the least privilege it needs. It scores confidence and escalates ambiguity instead of guessing. And every decision is logged and reviewable. The blueprint encodes all of this in an AgentAz™ governance section — explicit Trust Levels, a worst-case action, and a human-in-the-loop gate — so the safety isn't an afterthought bolted on, it's the specification.
If you want the deeper reasoning behind these boundaries, see our guide to designing safe AI agents, and for how the pieces fit together architecturally, the agent engineering stack.
Get the kit
This tutorial walks the design; the AI SOC Alert Triage Agent blueprint gives you the rest — the full system prompt, all 8 tool contracts, worked examples (including the hard cases where the agent correctly refuses or escalates), Basic/Advanced/Enterprise tiers, and a runnable run.py starter that executes the real loop with one command and an API key, on Anthropic or OpenAI. Read it, adapt it to your systems, and ship it behind the gate. For the broader production checklist, see building production-ready AI agents.
Frequently asked questions
No. Containment can disrupt the business and tip off an adversary, so the agent recommends and a human approves. This is the flagship-defining guardrail.
IOC reputation, asset and identity lookups, and cross-alert correlation — the bulk of tier-1 toil — before scoring severity with a MITRE mapping.