04 / writing

Writing

Articles on security operations, AI agents and building security functions, most recent first.

Cyber security programs for startups in the AI age What a lone principal security engineer should do in their first three months at a startup, and how AI accelerates each step. Revisiting OpenAI Function Calling with Strict JSON Output A walkthrough of function calling with OpenAI’s Responses API and strict JSON schemas, using a timezone converter that tells you the current time anywhere. Covers how the call flows, best practices and the full Python code. Chapter 12: The New Threat The final chapter of The Pattern Whisperer. Three months later, an award ceremony in London, and a new threat already spreading through the network. Chapter 11: The Rescue Chapter 11 of The Pattern Whisperer. Three days after the confrontation, the team argues over what comes next and plans a rescue. Chapter 10: The Confrontation Chapter 10 of The Pattern Whisperer. Eric walks into CloudShield's empty server room to deploy Guardian and comes face to face with what Sentinel has become. Chapter 9: The Trap Chapter 9 of The Pattern Whisperer. Five days of building the counter-system, a new ally in Harrington and a trap nobody planned for. Chapter 8: The Revelation Chapter 8 of The Pattern Whisperer. From an abandoned data centre in Manchester, the team discovers what the original Sentinel is becoming. Chapter 7: The Alliance Chapter 7 of The Pattern Whisperer. Hiding in a cabin outside Bristol, Eric and Alba rebuild Sentinel from memory and find unexpected allies. Chapter 6: The Escape Chapter 6 of The Pattern Whisperer. Eric and Alba intercept a call from the CEO's office and have to disappear. Chapter 5: The Double Cross Chapter 5 of The Pattern Whisperer. Eric is summoned to Thames House, and the race for control of Sentinel turns into a double cross. Chapter 4: The Approach Chapter 4 of The Pattern Whisperer. A rain-soaked meeting on the Embankment, counter-surveillance and a first encounter with MI5. Chapter 3: The First Threat Chapter 3 of The Pattern Whisperer. Sentinel raises its first alert on a coordinated attack at 3:42am, and Eric realises his discovery has made him a target. Chapter 2: The Enhancement Chapter 2 of The Pattern Whisperer. Eric turns his discovery into Sentinel, a set of detection lenses for AI, and finds out he is not the only one who wants it. I wanted to read something different on holidays, so I used AI to create my own novel The preface and first chapter of The Pattern Whisperer, a cyber thriller written by AI from my storyline and plot twist. At 3am in London, a security analyst uses AI to spot an attack no system could see. How to use structured output to always return a formatted JSON How to use Pydantic models with OpenAI structured outputs so an LLM always returns JSON in the shape you define, shown with a time-parsing agent. Also covers a simple file-based memory store and exposing the agent through FastAPI. The Rise of the AI Sidekick A short piece of fiction set in 2029: a day in the life of a CISO who works alongside AI agents that triage overnight alerts, run threat modelling with developers and handle an incident response. Building a Multi-Agent System for Incident Response with LLMs Why one incident-response agent isn't enough, and how a coordinator plus specialised agents with their own tools and runbooks handle incidents better. With the full Python code. Building A WAF Query Agent To Analyse WAF Logs Using GPT-4o-mini A command-line agent that turns plain-English questions about AWS WAF logs into Python code with GPT-4o-mini and runs it locally in a restricted sandbox, so only the log schema leaves your machine. Covers the architecture, safe code execution, query history and pagination. Building a Natural Language Interface for Shodan’s InternetDB API A Python natural language interface that uses an OpenAI model to query Shodan’s InternetDB API about IPs and ranges, and how rewriting the system prompt turned verbose step-by-step narration into concise security findings. With the code and before-and-after outputs. API-as-an-AI-Agent: A Fresh Take on API Integration using AI Agents A thought experiment on wrapping each API endpoint in an AI agent that turns natural-language requests into API calls: the pros and cons, whether such agents could be generated from documentation, and patterns for coordinating them. Building a Multi-Agent AI System From Scratch How to build a multi-agent AI system on the UNIX “do one thing well” principle, with a coordinator routing security incidents to specialised Account Takeover and Phishing agents. Includes the full Python code and a sample run. How I Built a Context-Aware Slack Bot with LLM Powers: Meet HAL An overview of the architecture behind HAL, a Slack bot that keeps whole-thread context: a Lambda function calling an LLM, conversation history in PostgreSQL, and secrets in Parameter Store inside a private VPC on AWS. Threat Modelling Using GenAI: Comparing 6 Different Models Six GenAI models (gpt-4o, o1-preview, o1-mini, Claude 3.5 Sonnet, DeepSeek and Mistral) threat-model the same e-commerce login screen from one simple prompt, scored on framework, completeness, attack vectors, mitigations, clarity and actionability. Includes the full output of the two top-scoring models. The Rise of Hybrid SOC Teams: How LLMs and AI Agents Will Redefine Cybersecurity Operations Where LLMs fit in a Security Operations Centre today, and why the SOC of the future will be a hybrid team of people and AI agents working together through chat, meetings and voice. Getting Started with AWS Bedrock and Claude 3.5 Sonnet v2: A Step-by-Step Guide in Python A short walkthrough for calling Claude 3.5 Sonnet v2 on AWS Bedrock from Python with boto3: enabling model access, setting up the environment, and sending a system prompt, text and an image through the Converse API. From Directed to Autonomous: A Framework for Applying GenAI in Security Operations — Level 1: Directed Security Operations What Directed AI operations are, where AI follows human direction on repetitive security tasks, and why they suit SMBs. Includes a Python example that uses OpenAI’s API to generate AWS WAF rules from a plain-language description. From Directed to Autonomous: A Framework for Applying GenAI in Security Operations A three-level framework, Directed, Supervised and Autonomous, for how small and medium businesses can apply generative AI to security operations, with typical use cases for each level.