Making the roller-security skill stricter with LangGraph
The Apache Roller project has been dealing with a deluge of incoming vulnerability reports this year, and the Apache Software Foundation (ASF) policy requires us to go through a twenty-something-step process for each report. This is not really a fun activity. We have to reply to the reporter, decide if the report is legit, possibly by attempting to reproduce an attack, fill out a CVE request form, make the fix, prepare a release, test it, call for a vote and get three +1 votes. Once the release with the fix goes out, we can announce the vulnerability and its CVE publicly.
When the first batch of vulnerability reports arrived in my Gmail, I started using AI to deal with them. I created a skill based on the ASF security process, called it roller-security and refined it over time as I triaged dozens and dozens of reports. It can read my Gmail, build a directory of evidence for each report, draft response emails and control Chrome to fill out CVE forms.
A skill is just prose
The simplest skill is just a file with some instructions for AI, maybe a set of steps to be executed. But this file is just context for AI, not a set of rules that must be followed. Sometimes, AI will randomly skip steps and might not tell you about it.
A state machine with LangGraph
If you want to ensure that a strict and structured process is followed, one way to go is LangGraph, a Python library born in 2024. With LangGraph you can write a program that controls your AI, ensures no steps are skipped, and can be stopped and resumed later, even with a different AI agent.
LangGraph in the skill
Last week, I decided to use LangGraph to enhance the roller-security skill and it seems to be working nicely; I can tell it is stricter than the old skill. On the downside, it is more than 6,000 lines of Python code, including tests. The upside is that we have reviewable Python code that enforces the process, and you can visualize the graph's nodes and edges. For example:
Here's a how-it-works guide created by Claude Code that illustrates the process. You can find the complete source code for roller-security here in Apache Roller's GitHub repo.
You can tell a human wrote this, not just because jagged wording but also I have no point or call to action other than: checkout LangGraph and leave a comment if you have one.