hardHats
A verdict a chatbot can't fake.
Point hardHats at a file, a folder, or a URL and it returns PASS or FAIL with the finding — because a real check produced it, not an opinion. A chatbot can write a paragraph that looks like a security review; it cannot hand you the file and line of the committed secret. hardHats hands you the line.
30 seconds
pip install hardhats
python -m hardhats.crews # list the seats
python -m hardhats.crews crypteng ./src # e.g. scan a tree for committed secrets
python -m hardhats.crews sec https://your.site
Add --json to any seat for a machine-readable verdict a script or another agent can read.
The exit code is the verdict: 0 clears, 1 caught the defect.
Why it holds
A seat is a crew of hats, and a hat is one of two things:
- a gate hat — a deterministic function: a real check, a measurement, a linter;
- an LLM hat — a model wearing an instruction.
The gate hats settle the facts. The LLM hats do only the judgement a rule can't, and they are handed the facts after they exist — they cannot overrule a gate and are never asked whether something passed. That is the moat: the output is a finding with a location, not a vibe. Every seat also prints what it did not check, so a clean result never reads as a blank cheque.
The bench — an expert for the call
40 seats, summoned by keyword, each gated on a real external standard it cannot fake:
| keyword | what it catches |
|---|---|
crypteng |
a secret committed in the clear, or crypto broken by design (values redacted) |
tests |
a test suite that only looks real — mutation testing, not a green checkmark |
sec |
missing OWASP secure headers on a live URL |
schema |
SQL without primary keys or indexed foreign keys |
resilient |
errors swallowed where a failure should surface |
…and 35 more — inject (RCE / injection patterns), ghactions (CI-workflow security), seizure (photosensitive-flash safety), pwa (installable), og (shareable), gameperf (60 fps hold), traffic (human-vs-bot reach), attribution (UTM integrity), seo (indexability floor), deliverability (email auth), community / loop / relay (the distribution plays), api, cite, proof, vision, geom, i18n, perf, links, env, richdata, spec, method, archive, repro, deps, food, ops, balance, cipher, privacy, license, route.
Don't know which seat? Point the router at the thing and it picks:
python -m hardhats.crews route ./my-project
python -m hardhats.crews ./openapi.json # a bare path routes too
Full catalog, with the standard behind each gate: hardhats/crews/README.md.
Gate your repo (CI / pre-commit)
The exit code is the verdict, so any seat drops into a pipeline as a gate — 1 fails the step.
# .github/workflows/gate.yml
name: gate
on: [push, pull_request]
jobs:
hardhats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install hardhats
- run: python -m hardhats.crews crypteng . # a committed secret fails the build
- run: python -m hardhats.crews resilient . # a swallowed error fails the build
Catch it before it ever leaves your machine, with pre-commit:
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: hardhats-crypteng
name: hardhats crypteng
entry: python -m hardhats.crews crypteng
language: system
pass_filenames: false
args: ["."]
Want a report rather than a gate? Add --json and read the envelope — exit, verdict, detail.
Build your own crew
The seats are built on a tiny engine, and a crew is config, not code:
from hardhats import Hat, Crew
crew = Crew("review", [
Hat("reader", model=("groq", "<model-id>"), instruction="List what a Statement of Need must establish."),
Hat("check", gate=slopgate), # a deterministic gate hat
])
outputs = crew.run("Draft a Statement of Need for an accessibility tool.")
hardhats.backends speaks one chat() across many free model backends, each read from the
environment — keys are never printed. Add a key, gain a perspective. Each hat sees the task and
every prior hat's output, down the line.
Proven on every change
python -m unittest discover -s tests runs the bench's own gate suite: every seat against a
known-good input it must clear and a known-bad input it must catch. A GitHub Action runs it
on every push, across Python 3.11–3.13.
License
MIT. Copyright Vincent Gonzalez / F-Keys Creative LLC.
Metadata
Release files for hardhats 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hardhats-0.3.0.tar.gz | 141.2 kB | Without provenance | Details for hardhats-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hardhats-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for hardhats-0.3.0-py3-none-any.whl |
Total release size: 315.2 kB
Release files / hardhats-0.3.0.tar.gz
| Download URL | hardhats-0.3.0.tar.gz |
|---|---|
| Size | 141.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4a77f1ed8bc3c7969c04ec9aa00c04c9577f4e830cc739bd6b01ba0655aacbe
|
|
BLAKE2b-256 checksum How to use checksums |
5639935a18460e6305c0355fa26109534c1429bbc133679bd638d6a62b7aee39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / hardhats-0.3.0-py3-none-any.whl
| Download URL | hardhats-0.3.0-py3-none-any.whl |
|---|---|
| Size | 174.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
274eaa9a84e145765da538cf3ada50cb5d96528b21d86d171c19b70a18275620
|
|
BLAKE2b-256 checksum How to use checksums |
aabab75364429b7712d5766c837d750986ae7ad75aaaba39f5c60ba7ea71c705
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for hardhats 0.3.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.