AI Workflows & Agents
A single model answering questions is useful. A model that can run tools, observe results, and adapt its next action is a different category of useful. This page covers both: the loop that makes something an “agent,” and practical workflows for using AI — agentic or not — in security work.
What Makes Something an Agent
A chat model takes input, produces output, stops. An agent:
- Receives a goal
- Decides what action to take
- Executes the action (runs a tool, writes a file, makes a request)
- Observes the result
- Decides the next action based on the result
- Repeats until the goal is achieved or it gives up
The key addition is tool use and a loop. Everything else is engineering around those two things.
Agent Patterns
ReAct (Reason + Act)
The simplest pattern that works. The model alternates between reasoning about the problem and acting on it.
No exotic architecture — just prompting and tool use in a loop. Enough for most enumeration and scripting tasks.
Planner + Executor
A Planner reasons about overall strategy; an Executor runs commands. The Planner sees summarized results, not raw output, so it does not get lost in noise on longer engagements. Add a Summarizer role once tool output gets too large to hand the Planner directly.
Scale this up to hierarchical agents — a manager spawning specialized sub-agents (web, network, …) that report back — once a single agent’s context gets crowded with unrelated subtasks. Otherwise it’s overhead for no benefit.
A Minimal Agent Loop
The skeleton, independent of any specific provider. chat() stands in for
whatever API call your provider uses.
From here you add more tools (read_file, http_request), better output
truncation, a separate planner pass, and logging so you can review what it
actually did.
Safety
Scope it to a specific target and set of allowed actions. Run it in a VM, not your host. Review its logs — agents get creative. Rate limit it so it does not hammer a target. Keep credentials out of its context entirely.
Authorization
An agent that runs commands inherits your legal responsibilities. Only point it at systems you own or have explicit written permission to test.
Practical Workflows
Repeatable patterns, not one-off prompts.
CTF / Recon Loop
AI is most useful at steps 2, 3, and 5. You own steps 1, 4, and the final call on whether the result makes sense.
Hardening Review (Blue Team)
Collect state, then hand it over in one batch instead of describing it from memory:
Beyond One-Off Workflows
The workflows above are things you run by hand, chat window open, when you
need them. Wire the same pattern into a script — tool output piped
straight into chat(), running on a schedule or every time a scan
finishes — and it stops being a habit and becomes automation.
See Automating Security Work for the pipeline pattern, structured output, and what never goes in the prompt.
What Kills These Workflows
- Trusting output you have not verified — a plausible-looking exploit that does not work, or an analysis that misses the one line that mattered.
- Letting the model write domain-specific logic it does not understand. It produces confident garbage and you lose hours debugging it.
- Skipping step 1. If you do not understand what you are enumerating, you cannot tell whether the model’s read on it is right.
The skill worth building is directing and verifying model output, not copy-pasting it.