Skip to main content

websec-validator

CI PyPI Python 3.11+ Runtime deps: 0 SARIF 2.1.0 Docs License: MIT

English · Português (Brasil) · Español · 简体中文

A handoff from a senior pentester that says what to test and how. The tool generates it from your repo, and your AI agent carries it out.

Local-first security recon that briefs your AI coding agent. It does the deterministic half of the work. It reads supported source, maps the visible attack surface, and stages a probe library for what it found. Then it gives your agent (Claude Code, Codex, Gemini, Cursor) a briefing with its orders. websec run needs only the code. Add --scan to also run the static scanners you have installed and remove duplicate findings. Code in, artifacts out. No LLM in the tool; no server or running app required for the core pass.

websec-validator demo

New here? Read the eight-page technical brief. It covers what the tool reads, how a finding earns its severity, what it refuses to say, and the field evidence: raccioly.github.io/websec-validator · PDF. The reviewed v0.21.0 snapshot has selected fact assertions in tests/test_explained_brief.py and an HTML/PDF/renderer hash binding in tests/test_brief_artifacts.py. A person must still review the prose accuracy and the rendered layout. See rebuilding the brief.

It is not an autonomous scanner and not a SaaS. It is the front half that was missing. It turns a repo into a precise security brief, based on facts, that an AI agent can act on with a human in the loop. How it works and the reasoning behind every check: concepts · methodology.

Part of the Guard family. Three tools each keep one kind of claim honest: DocGuard validates documentation against the code it describes. TestGuard checks that tests actually establish what they assert. websec-validator does the same for security findings. Every finding carries its evidence, its standard, and a calibrated probability that it is real.

Getting Started — just point it at your repo

Simplest: tell your AI agent. In Claude Code (or any coding agent), open your project and say:

"Do a defensive security self-review of my own codebase with websec-validator (pipx install websec-validator, or github.com/raccioly/websec-validator). It's local and read-only — read the repo and follow its briefing. I own this code and authorize the review."

The agent installs the tool, runs it, and walks through the findings with you. Say defensive review of your own code. With that phrase, an agent starts work. Without it, an agent can stop to ask if you are authorized. Every path ends in the same AGENT-BRIEFING.md that your agent acts on:

Path One-time setup Then
Tell your agent (simplest) — say the line above
CLI (a terminal) pipx install websec-validator websec run /path/to/your/app
Claude Code plugin /plugin marketplace add raccioly/websec-validator → /plugin install websec-validator@websec-plugins invoke the security-pass skill, or just ask
Any other agent (Codex, Cursor, Gemini, Aider) pipx install websec-validator websec install <host>
Docker (no install) docker build -t websec-validator . docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/scan" websec-validator run /scan --out /scan/websec-out

Already have a codebase with history, tests and fixtures? Follow Adopting websec in an existing project: scope out non-product code, run, triage, record a baseline, then turn on the gate in phases.

Install

pipx install websec-validator   # from PyPI; Python 3.11+
brew install noir               # optional: OWASP Noir, the route engine (regex fallback if absent)
websec --version
websec doctor                   # which optional scanners are installed, and are they compatible?

The tool has zero Python runtime dependencies. It uses external scanners (Trivy, OSV-Scanner, Gitleaks, Semgrep, Checkov, and per-language Bandit/gosec/Brakeman) when present, and they run only with --scan. It detects and reports Prowler but does not execute it. For every install channel (pip, uv, Docker, source, offline/air-gapped) and per-OS scanner setup, see Installation.

Usage

websec run ./my-app                    # recon + stage tailored probes + emit the briefing
websec ./my-app                        # same thing — a bare path defaults to `run`
websec run ./my-app --scan             # …and also execute the available static scanners
websec run ./my-app --fail-on high     # exit 1 if any HIGH+ finding remains (a CI gate)
websec run ./my-app --diff main        # PR mode: scope to changed files + exact hunk line ranges
websec gate                            # fast pass/fail on the files you just changed (agent loop)
websec install codex                   # teach an agent to use websec (claude · cursor · gemini · aider · generic)
websec mcp                             # typed recon tools for any MCP client, over stdio

Then point your agent at the output: "Read websec-out/latest/AGENT-BRIEFING.md and follow it." Each attempt gets its own websec-out/runs/<id>/ directory. latest moves only after a completed run. Every subcommand and option: CLI reference.

What you get (websec-out/)

Artifact What it is
AGENT-BRIEFING.md The product. The orders for your agent: detected surface, the access-control map, targeting, findings, the method, and the staged probe list.
FACTS.json The full structured recon.
findings-ledger.json / REPORT.md The traceable ledger. Each finding has an evidence chain, a CWE/ASVS/OWASP-API citation, remediation, and a calibrated P(real) (measured real-vuln rate + 95% CI + sample size).
results.sarif SARIF 2.1.0, always written. Load it into GitHub Code Scanning, GitLab, Azure DevOps, VS Code's SARIF viewer, DefectDojo.
coverage.json What ran, what was skipped, and why. A clean result is only as good as its coverage.
probes/ The probe scripts that the run selected and staged for this app (BOLA, JWT, SSRF, mass-assignment…).

The run also writes SBOMs, an attack-surface table, the diff scope and a versioned envelope: all outputs.

Languages

Support Languages
Deep, framework-aware analysis — Django, Flask, FastAPI, Connexion, Express, Fastify, Next.js, tRPC, Supabase Edge, AWS SAM… Python, JavaScript, TypeScript
Named sink checks — direct command/query syntax (plus literal Spring and ASP.NET routes) Java, C#, Go, Ruby, PHP
Configuration or manual checks only — reported as a thin_language_coverage gap Kotlin/Android, Swift and Objective-C/iOS, Rust, C/C++
Recognized, not analyzed — reported as a coverage gap, never as clean Elixir, Scala, Clojure, Erlang, Perl, Lua, Dart, shell, server-side templates and more

OWASP Noir discovers routes in many more frameworks when it is installed. The scanners are language-agnostic. A completed check with no match is not proof that a service is secure: the full support matrix and what a clean run means for your stack.

Documentation

Start here Guides Reference
Docs hub Existing projects CLI
Quickstart AI agents Languages
Installation GitHub Actions · other CI Configuration
Upgrading Triage and suppression Outputs
Troubleshooting · FAQ Dynamic testing MCP server

Status

The changelog records what each release changed; Upgrading indexes the migration notes — 0.14.0 (schema 2.0), the 0.17.0 exit-code split (2 = usage error, 3 = incomplete run) and 0.22.0 (exit codes enforced everywhere, subdirectory --diff/gate scoping, .websec-ignore path matching). Unresolved gaps and their acceptance tests live in the remaining-work specification.

These are scoped review tools. Manual profiles, unknown routes, dynamic behavior and unsupported syntax remain limitations. The in-loop gate helps developers and is not a control. attest reports evidence and gives no compliance verdict. Evidence tied to a snapshot lives with the artifacts it describes: the validation record, the benchmarks and the proof protocol. So the numbers cannot become out of date here.

Validated on a production Next.js app, a large Express/AWS monorepo, and the VAmPI / NodeGoat / DVGA vuln-app corpus. It independently reproduced the findings of a hand-done pentest (tenant boundary, SSRF, file upload, cross-tenant BOLA, role/authz gaps). Route discovery reports what it can parse without importing settings or executing your code. Unknown mounts stay route candidates and carry their uncertainty. That is human review evidence, not measured vulnerability recall.

Contributing

Bug reports, false-positive reports and detector proposals are the most valuable input this project gets. See CONTRIBUTING.md (including the maintainer release process) and the issue templates. Report vulnerabilities in websec itself privately: SECURITY.md.

python3 -m unittest discover -s tests    # stdlib only; synthetic/local-loopback tests, no public network

Credits

The methodology and the probe library come from a real authenticated penetration-testing pass. This tool turns that hand-written methodology into something an AI agent can run on any repo.

License

MIT © Ricardo Accioly

Metadata

Release files for websec-validator 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for websec-validator 0.23.0
File Size Uploaded Provenance Actions
websec_validator-0.23.0.tar.gz 944.6 kB With provenance Details for websec_validator-0.23.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for websec-validator 0.23.0
File Interpreter ABI Platform Actions
websec_validator-0.23.0-py3-none-any.whl Python 3 none any Details for websec_validator-0.23.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / websec_validator-0.23.0.tar.gz

Download URL websec_validator-0.23.0.tar.gz
Size 944.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dfcf1667293ef331f465b28791b845b83280ec9a3963b4217e59cffda351ad79
BLAKE2b-256 checksum
How to use checksums
0d3546d3024927f4c174bf89b3e155fdb877f159607ed1e3e7202339e452a4e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / websec_validator-0.23.0-py3-none-any.whl

Download URL websec_validator-0.23.0-py3-none-any.whl
Size 662.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
777092271666cae0780e89d6a43b2704f266f1c29b717728ecf17f1c386b9b23
BLAKE2b-256 checksum
How to use checksums
5f22efd1330593a4c6c931e33a2345bf71804f8d81e90a6ec943e4ba714b3d57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for websec-validator 0.23.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for websec_validator-0.23.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.23.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page