{"slug": "flawrence-llm-based-vulnerability-analysis-for-everyone", "title": "Flawrence – LLM-based vulnerability analysis for everyone", "summary": "A developer released Flawrence, an open-source Rust tool that uses LLM agents to find security vulnerabilities in source code, building a threat model, mapping attack surface and assigning a research agent to each entry point, with a second agent validating and reproducing candidate findings before submission. Flawrence works with Anthropic, OpenAI, Cloudflare Workers AI and any OpenAI-compatible endpoint, and its README warns that agents run shell commands and execute proofs of concept, so it should be run only in a container or VM, with MAX_COST_USD set because a full review fans out to many agents and can cost a lot of tokens. The tool ships additional agents for patching confirmed vulnerabilities, filing GitHub Security Advisories and mining git history for past security fixes.", "body_md": "Flawrence finds security vulnerabilities in source code with LLM agents. It reads a codebase, builds a threat model, maps the attack surface and gives every entry point its own research agent. A second agent validates each candidate finding and tries to reproduce it. Only findings with a verified reproducer are submitted. A proof of concept is then written for each one.\n\nFlawrence is written in Rust. It works with Anthropic, OpenAI, Cloudflare Workers AI and any OpenAI-compatible endpoint.\n\nThe bugs Flawrence has found so far are listed in [FINDINGS.md](https://github.com/mschwarzl/flawrence/blob/main/FINDINGS.md).\n\nWarning\n\nAgents run shell commands, build the target and execute proofs of concept.\nRun Flawrence in a container or a VM. Never point it at a machine you care about.\nA full review fans out to many agents and can cost a lot of tokens. Set `MAX_COST_USD`.\nWe recommend, running flawrence with locally hosted open-weight models to get the maximum out of it.\n\n```\ncargo build --release\nexport ANTHROPIC_API_KEY=sk-ant-...\n\ntarget/release/flawrence-runner --agent security-review \\\n  --directory /path/to/target --artifacts out \\\n  \"Review this codebase for security issues\"\n```\n\nThe runner loads a `.env` file from the working directory.\nCopy `.env.example` to `.env` to get started.\n\nEvery agent names a default model in its definition.\nUse `--model <provider>/<model>` to override it for one run, or set `FLAWRENCE_MODEL`.\n\nThe `security-review` agent runs this pipeline.\n\n1. `threat-model` describes the application, its attackers and its trust boundaries.\n2. `attack-surface` lists every function an attacker can reach.\n3. `test-idiom` finds a reliable way to run small reproducers against the target.\n4. One `vulnerability-research` agent runs per attack surface entry. It writes a`finding_*` artifact for every candidate.\n5. `vulnerability-validation` checks each finding and rejects false positives.\n6. `vulnerability-poc` writes and runs a proof of concept for each confirmed vulnerability.\n7. `dedup_check` drops duplicates.`submit_finding` stores the rest under`<artifacts>/submitted/` .\n8. `write_advisory` writes a GitHub Security Advisory draft for each submitted finding.\n\nThe final report lists submitted findings, blocked findings, duplicates, false positives and open questions for you.\n\nOther agents cover the steps after a review.\n\n| Agent | Purpose | \n|---|---|\n| `vulnerability-patch` | Writes a fix for a confirmed vulnerability. Verifies it, reviews it and tries to bypass it. | \n| `ghsa-pipeline` | Files a private vulnerability report on GitHub for one finding. | \n| `ghsa-disclose` ,`ghsa-submit` | Render and file a GitHub advisory in two separate steps. | \n| `asf-disclose` | Writes a security report email for an Apache project. | \n| `security-history` | Mines the git history for past security fixes. | \n\nAgents are Markdown files in `agents/`.\nSkills with background knowledge for the agents are in `skills/`.\n\n```\nflawrence-runner --agent <name> --directory <target> [--artifacts <dir>] \"<query>\"\n```\n\n| Option | Meaning | \n|---|---|\n| `-d` ,`--directory` | The target codebase. | \n| `--artifacts` | Output directory. Without it the runner creates `artifacts-<hex>/` and prints the name. | \n| `-m` ,`--model` | Model for every agent in this run. | \n| `-c` ,`--concurrent` /`-n` ,`--runs` | Run the root agent `n` times,`c` at a time. | \n| `-s` ,`--schedule 22:00-06:00` | Only call the model inside this daily window, in UTC. | \n| `--arg key=value` | Fill a `{{key}}` placeholder in the agent prompts. | \n| `--input-artifact key=path` | Load a file as a read-only artifact before the run starts. | \n| `-v` ,`--verbose` | Print reasoning, tool calls and results as they happen. | \n| `--tui` | Full screen dashboard. Unix only. Output on disk is the same. | \n| `--web-ui` | Serve a read-only status page on port 3000. | \n| `--load-all` | Load every agent, not only the ones the root agent can reach. | \n\nYou can also pipe the query through stdin.\n\nEach run writes its final report to `<session>_summary.md` in the artifacts directory.\nFindings never leave your machine unless you call `submit_finding` with `live=true` and set `FLAWRENCE_VULN_INGEST_LIVE=1`.\nThe GitHub tools have the same kind of guard with `FLAWRENCE_GHSA_LIVE=1`.\n\nCtrl+C works in three stages.\n\n1. The first press stops new work. Running agents finish on their own.\n2. The second press cancels running agents. The run still deduplicates and submits what it found and writes its summary.\n3. The third press quits at once.\n\nIf the summary step fails, the runner lists the finding artifacts on disk in `<session>_salvaged-summary.md`.\n\nA model name has the form `<provider>/<model>`.\n\n| Prefix | Provider | Credentials | \n|---|---|---|\n| `anthropic/` | Anthropic Messages API | `ANTHROPIC_API_KEY` | \n| `workers-ai/` | Cloudflare Workers AI | `CLOUDFLARE_API_TOKEN` ,`CLOUDFLARE_ACCOUNT_ID` | \n| `openai/` | OpenAI Responses API | `OPENAI_API_KEY` | \n| `<name>/` | Any OpenAI-compatible `/v1/chat/completions` server | `FLAWRENCE_PROVIDER_<NAME>_BASE_URL` ,`FLAWRENCE_PROVIDER_<NAME>_API_KEY` | \n\nA custom provider needs two variables.\nThe lowercase `<NAME>` becomes the model prefix.\n\n```\nexport FLAWRENCE_PROVIDER_VLLM_BASE_URL=http://localhost:8000/v1\nexport FLAWRENCE_PROVIDER_VLLM_API_KEY=unused\nflawrence-runner --model vllm/Qwen/Qwen3-Coder --agent security-review --directory . \"...\"\n```\n\nDo not name a custom provider `anthropic`, `openai` or `workers-ai`.\nThe built-in prefixes win and your provider is never used.\nTo reach api.openai.com over chat completions instead of the Responses API, call the provider `oai` or similar.\n\nCosts come from [models.dev](https://models.dev).\nSet `TOKEN_COST_INPUT` and `TOKEN_COST_OUTPUT` for models it does not know, or `MAX_COST_USD` cannot be enforced.\n\nFlawrence reads its settings from environment variables or `.env`.\nThese are the ones you will most likely need.\n\n| Variable | Meaning | \n|---|---|\n| `MAX_COST_USD` | Stop the run at this cost. | \n| `MAX_ITERATIONS` | Turns per agent. Default 500. | \n| `FLAWRENCE_MAX_PARALLEL_AGENTS` | Research agents that run at the same time. Default 40. | \n| `FLAWRENCE_WORKTREE_ISOLATION` | Give every agent that writes files its own git worktree. | \n| `FLAWRENCE_AGENT_MEMORY_MB` | Memory watchdog per agent tree. See [docs/agent-memory.md](https://github.com/mschwarzl/flawrence/blob/main/docs/agent-memory.md) . | \n| `TRAILMARK_BIN` | Path to [trailmark](https://github.com/trailofbits/trailmark) for call graphs. | \n| `COMMITRAIDER_PATH` | Path to [CommitRaider](https://github.com/mschwarzl/commitraider) for git history analysis. | \n\n[docs/configuration.md](https://github.com/mschwarzl/flawrence/blob/main/docs/configuration.md) lists every variable.\n\nThe image contains the runner, Rust, Java, Gradle, Maven, the Android SDK, trailmark, CommitRaider and common build tools.\n\n```\n./docker-shell.sh\n```\n\nThis builds the image and opens a shell as root.\nClone targets into `/workspace`, which is a persistent volume.\nResults go to `/artifacts`, which maps to `./artifacts` on the host.\n`agents/` and `skills/` are mounted from the repository, so edits take effect without a rebuild.\n\n```\ngit clone https://github.com/example/project.git /workspace/project\nflawrence-runner --agent security-review --directory /workspace/project \\\n  --artifacts /artifacts/project \"Review this codebase for security issues\"\n```\n\nThe image builds natively on amd64 and arm64. The Android SDK tools only run on amd64.\n\n`flawrence-web` starts runs from a browser and links to the live dashboard of the current run.\nThe Docker image starts it by default.\nIt needs `FLAWRENCE_WEB_PASSWORD` whenever it listens on a non-loopback address.\nSee [docs/web-launcher.md](https://github.com/mschwarzl/flawrence/blob/main/docs/web-launcher.md).\n\nAn agent is a Markdown file. The YAML front matter configures it and the body is its system prompt.\n\n```\n---\nmodel: anthropic/claude-sonnet-4-6\ndescription: Reviews the session handling.\nreasoning_effort: High\nparams:\n  focus: session cookies\ntools:\n  - read_file\n  - grep_files\n  - code_index\n  - artifact\n  - spawn_task\ntool_configs:\n  artifact:\n    read:\n      - threat_model: input\n      - finding_*\n    write:\n      - finding_*\nsubagents:\n  - vulnerability-validation\n---\nReview {{focus}} in this application and write one finding per issue.\n```\n\nPermissions are closed by default.\nAn agent can only read and write the artifact keys it lists and only spawn the agents under `subagents`.\nA trailing `*` matches a key prefix.\n\nA key marked `input` must be supplied with `--input-artifact`, or the run does not start.\nA glob marked `input`, such as `notes_*: input`, is optional.\n\n`--arg focus=...` overrides a value under `params`.\nThe run refuses to start if a `{{placeholder}}` has no value.\n\n| Field | Required | Meaning | \n|---|---|---|\n| `model` | yes | Default model. | \n| `description` | yes | One line about the agent. Parents see it when they choose a subagent. | \n| `reasoning_effort` | yes | `Low` ,`Medium` or`High` . | \n| `tools` | no | Tools the agent may call. | \n| `tool_configs` | no | Per-tool settings such as artifact permissions. | \n| `subagents` | no | Agents this one may spawn. | \n| `output_reviewer` | no | Agent that reviews the result before it is returned. | \n| `params` | no | Default values for `{{placeholders}}` . | \n| `output_schema` | no | JSON schema the result must follow. | \n| `max_iterations` | no | Turn limit for this agent. | \n| `output_grounding` | no | Result fields the runner checks against the agent's real tool calls. | \n| `todos` | no | A fixed checklist the agent must work through. | \n\n| Path | Contents | \n|---|---|\n| `bin/flawrence-runner` | The `flawrence-runner` CLI and the`flawrence-web` launcher. | \n| `bin/flawrence-index` | `flawrence-index-cli` , a debug tool for the code index. | \n| `lib/flawrence-api` | Provider clients, retries and streaming. | \n| `lib/flawrence-agent` | Agent and skill loading, permissions. | \n| `lib/flawrence-task` | The agent loop, task pool and logging. | \n| `lib/flawrence-tool` | All tools, the artifact store and worktrees. | \n| `lib/flawrence-index` | Tree-sitter code index for Python, Rust, JS/TS, C/C++, Go, Java, Ruby and Kotlin. | \n| `lib/flawrence-chat` | Shared message, usage and cost types. | \n| `lib/flawrence-status` | The `--web-ui` status server. | \n| `frontend` | The Vue dashboard. | \n\nContributors and coding agents should read [AGENTS.md](https://github.com/mschwarzl/flawrence/blob/main/AGENTS.md) first.\n\n```\ncargo fmt --all && cargo clippy --workspace && cargo test --workspace\n```\n\nFlawrence is licensed under the [MIT license](https://github.com/mschwarzl/flawrence/blob/main/LICENSE).\nThe harp icon in `bin/flawrence-runner/src/harp.svg` is by Magnific from [Flaticon](https://www.flaticon.com/free-icon/harp_4752991) and uses the Flaticon license.", "url": "https://wpnews.pro/news/flawrence-llm-based-vulnerability-analysis-for-everyone", "canonical_source": "https://github.com/mschwarzl/flawrence", "published_at": "2026-11-25 18:22:11+00:00", "updated_at": "2026-11-25 18:42:39.587572+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Flawrence", "Rust", "Anthropic", "OpenAI", "Cloudflare Workers AI", "GitHub"], "also_reported_by": [], "takeaway": "Flawrence's security-review pipeline runs threat-model, attack-surface, test-idiom, per-entry-point vulnerability-research, vulnerability-validation, vulnerability-poc, dedup_check and write_advisory stages, submitting only findings with a verified reproducer.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/flawrence-llm-based-vulnerability-analysis-for-everyone", "markdown": "https://wpnews.pro/news/flawrence-llm-based-vulnerability-analysis-for-everyone.md", "text": "https://wpnews.pro/news/flawrence-llm-based-vulnerability-analysis-for-everyone.txt", "jsonld": "https://wpnews.pro/news/flawrence-llm-based-vulnerability-analysis-for-everyone.jsonld"}}