Practical Guides · knowledge base from X
🤖 Automation with AI agentsFramework (no numbers)

A bug bounty AI agent that can't declare «found» without evidence: the seven-layer architecture of OSA (Abdelrhman Allam, 4 years of bug bounty)

A bug bounty hunter with four years of experience, who started in late August with no background in AI or software engineering, describes OSA, the «control plane» he built around the OMP runtime (DeepSeek via pay-as-you-go API, JavaScript for extensions, eight MCP servers): layered instructions, three distinct loops (model turn, hunt supervisor, Recon → Map → Hypothesize → Test → Validate → Report state machine), tool execution that records evidence, selected context, persistent state in JSON files, seven controls (scope gate, validation, reportability gate, kill switch…) and tracing. Goal: the agent does 80% of the workflow, the researcher 20%. No earnings claimed.

✍️ Abdelrhman Allam · @sl4x0
🔗 Read the original on X · X Article · published 29 Oct 2026
📊 445 likes · 727 bookmarks · 17.6k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual Automation with AI agents — the complete manual

Claimed result

No earnings or bugs found are claimed: the article describes an architecture. The only quantitative goal is explicitly not measured: the agent should handle roughly 80% of the workflow, leaving 20% to the researcher's own analysis and decisions («numbers to describe the idea, not a measured result»). The author has four years of bug bounty and started studying AI in late August, with «practically zero prior experience» in AI, LLMs or software engineering, building most of the system with AI itself.

Proof: framework. Heavily bookmarked (727 bookmarks on 445 likes, three times the theme's average), written honestly about its limits («I wouldn't describe the system as completely autonomous or inherently safe»). Bug bounty is a concrete way to earn (programs pay for valid vulnerabilities), but there are no payouts, accepted reports or duplicate rates here.

The key idea

AI in bug bounty is there to make the workflow faster: a few seconds can separate a duplicate from a valid bug found before anyone else. But AI's main problem is that it tries to help you even when it's wrong. So the architecture is built so that the model proposes and the system decides what actually happened: a model that «says» it confirmed a vulnerability isn't evidence; the request must execute, the response must be recorded and the evidence evaluated.

Second idea: without the skills to understand the agent's work you end up chasing every lead hoping for a valid bug. The agent speeds up people who already know; it doesn't replace experience.

Step-by-step playbook

The stack

Component Choice
Runtime OMP (he used OpenCode before; he explains the switch in a post)
Model DeepSeek's direct API, pay-as-you-go
Extensions and plugins JavaScript
Tools Eight configured MCP servers, used depending on the task
Control plane OSA, his bug bounty automation framework, based on an existing AI framework rebuilt and extended for OMP

The distinction: OMP is the runtime (model turn loop, tool dispatch, sessions, context compaction); OSA is the control plane (bug bounty workflow, persistent state, evidence, scope checks, validation, reporting). To design it he studied how engineering teams build AI systems, using ChatGPT to understand the concepts.

Layer 1 — Instructions

AGENTS.md, rules, agent definitions, skills, prompts and configuration files. Lesson: don't put everything in one massive prompt. Core instructions for overall behavior; specialized roles and skills loaded only when needed, so as not to waste context.

Layer 2 — The agent loop (three distinct mechanisms)

  1. Model turn loop (OMP): the model, tool calls, observations, subsequent turns.
  2. Hunt continuation loop (OSA's supervisor): decides whether the workflow should continue or finish.
  3. Hunt state machine (Python): phases, hypotheses, budget, validation, reporting state.

Phases: Recon → Map → Hypothesize → Test → Validate → Report. The model can propose hypotheses and run tests, but doesn't get to decide on its own that the hunt is finished: the supervisor checks outstanding obligations before letting it stop. Reason: a model can conclude too early, overlook an unresolved hypothesis or summarize incomplete work as a final result; the system should make those mistakes «harder to get away with».

Layer 3 — Tool execution

Tools via OMP, MCP servers, browser, shell, JavaScript extensions and plugins. Access isn't enough: you need to control how they're invoked, inspect the arguments, handle the outputs and record the results. In OSA the JavaScript extension acts as an enforcement adapter around OMP's tool execution events, connecting them to the guard chain; Python handles authoritative state, evidence recording, validation and reporting. MCP calls too must be inspected and checked against scope rules, not trusted because they come through an integrated tool.

Layer 4 — Context management

You can't feed the model every observation, request, response, failed hypothesis and past conversation: context explodes, important things get buried or compaction removes details still needed. OSA treats context as a selection: before continuing a hunt it assembles a context pack with relevant assets, observations, leads, hypotheses, previous failures, methodology and required evidence. It separates the context the model uses from durable handoff information needed to resume work when a session compacts or a task moves to another agent.

Layer 5 — State management

Context = what the model sees; state = what the system keeps about what happened and what's next. To track: phase and remaining budget, discovered assets and attack surfaces, hypotheses open, tested and rejected, evidence collected, pending tasks and agent dispatches, validation status and reporting decisions. Files: hunt.json, ledger.json, scope.json, plus finding records, validation assessments and handoff data. Principle: each type of information has one source of truth (hunt state tracks the workflow, the evidence ledger records operations and their provenance). The agent must be able to recover its position from persistent state, not from the memory of past turns.

Layer 6 — Guardrails and approval gates

Control Function
Tool guard chain Checks actions against rules on scope, state integrity, evidence, dispatch conditions
Scope gate Evaluates targets and destinations against scope rules
Validation pipeline Evaluates whether a finding has enough evidence and reproduction support
Reportability gate Separates technical validity from impact, reachability, deployment relevance and readiness to report
Reporter controls Restrict report generation and approval to a dedicated workflow
Kill switch Blocks tool execution
Evaluation controls Restrict access to tools that could bypass the guard chain

Key lesson: a technically valid finding isn't automatically reportable (it can be reproducible but lack evidence of reachability or impact); the system must tell the difference instead of treating an LLM confidence score as proof. Honest caveat: in his configuration some parts are permissive (advisory-only scope checks, automatic tool execution without per-tool approval prompts), and OMP extensions aren't a security sandbox.

Layer 7 — Observability, tracing, evaluation, benchmarks

OSA records agent-loop logs, session events, dispatch telemetry, the evidence ledger, scope checks and reportability assessments; tracing tools let him reconstruct a hunt and follow the decisions on a single hypothesis (wrong hypothesis? tool failure? lost context? validation rejection? workflow stopped too early?). Evaluation is separate: tests, regression checks, lab evaluations and benchmarks, to know whether a change to a prompt, guard, context pack or validation actually improves the result instead of trusting how convincing the output looks.

The full workflow (10 steps)

  1. start a hunt with a program and target;
  2. OSA initializes state and execution context;
  3. OMP runs the model and dispatches tools;
  4. OSA's controls inspect actions before they reach the tools;
  5. executed operations and evidence are recorded;
  6. the agent moves through recon, mapping, hypotheses, testing and validation;
  7. the validation pipeline evaluates potential findings;
  8. the reportability gate decides whether the evidence supports a report;
  9. the reporting workflow prepares the result for human review;
  10. the supervisor checks outstanding obligations and decides whether the hunt can finish.

Memory, success techniques and skills (three different things)

  • Memory: previous wins, dead ends, program notes, lessons; retrieved selectively before a hunt or a hypothesis. An agent-written note remains an unverified observation until validated.
  • Success techniques: extract why an attack worked, strip target-specific details; it becomes a durable lesson only with evidence from multiple targets.
  • Skills: structured, human-readable playbooks for a class of work, loaded when needed. A technique can become a skill candidate, but promotion requires review.

Chain: confirmed result → success record → repeated success across different targets → reusable technique → reviewed promotion → skill. The model isn't retrained after each hunt; the corpus of validated experience is still small.

The author's closing lessons

  • Experience matters more than the tool: an experienced researcher with a normal tool works better than a beginner with the best one.
  • Public wins don't show failed attempts, invalid reports or the knowledge behind each valid bug; even if AI helps a beginner find a bug, it doesn't make them able to repeat it.
  • Personal example: in April, while preparing for his wedding, he built depconf (Dependency Confusion Scanner), a Python CLI, without much Python experience, thanks to understanding the security problem.
  • Risk: AI makes us lazy about learning concepts; sometimes you need to read a paper, take notes, understand the implementation and test it on your own targets.

Tools and costs

Item Cost / detail
OMP (agent runtime) Not given
DeepSeek API Pay-as-you-go, figures not given
MCP servers Eight, not listed
OSA His own framework, not published in the article
depconf The author's open CLI tool for dependency confusion

Limitations

  • No financial result: no payouts, valid bugs or duplicate rate.
  • Barrier to entry: the author insists security experience is needed; the architecture doesn't make bug bounty profitable for a beginner.
  • Safety and legality: test only authorized programs and within scope; in his configuration scope is advisory only and tools run without approval: a mistake can hit out-of-scope targets.
  • Code not shared: OSA and the configuration aren't published; file and control names give the structure, not the implementation.
  • Model costs not quantified (DeepSeek pay-as-you-go).
← More guides in “Automation with AI agents”