Skip to content

Commit 22d11a6

Browse files
authored
fix: correct product docs to web-audit library (no CLI/Action) (#9)
* fix: correct product docs to web-audit library (no CLI/Action) inspect is a website security & accessibility audit library + embeddable MCP server, not a "code security scanner CLI". Made all docs/config honest: - README/docs/architecture/AGENTS.md: rewritten to describe the real web-audit library (a11y/TLS/cookies/security-headers/mixed-content/meta + crawler + MCP). Removed all references to a non-existent inspect-ci/inspect-action CLI binary. - Deleted action.yml + .github/action.yml (composite Action built a non-existent ./cmd/inspect-action) and deploy/docker/docker-compose.yml (referenced a non-existent inspect-ci binary). - api/openapi.yaml: corrected the MCP surface to the real constructor (mcp.New(...).ServeStdio()) and replaced the bogus checks enum with the 6 real checks (security-headers, cookie-security, tls, mixed-content, meta-tags, accessibility); dropped SEO/performance overclaims. - Issue templates: removed deleted GitHub Action options. - CI: pinned gofumpt v0.10.0; Go badge -> 1.26+. Verified: go build/vet/test pass; gofumpt clean; golangci-lint 0 issues; zero dangling CLI/Action references. * fix: align inspect check schema names * fix: align README/docs with the nine registered checks The Features list and intro omitted links/forms/perf/seo and the Presets table said 'all checks' without defining it. Document all nine registered checks, mark the six that run in the default presets, and correct the Standard godoc comment. Drop the stale 'GitHub Action' entry from the [Unreleased] bug_report surface-dropdown description (action.yml was removed in this PR).
1 parent c7bf61f commit 22d11a6

12 files changed

Lines changed: 261 additions & 269 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ body:
3131
options:
3232
- "Library API (`inspect.Scan`, `inspect.NewScanner`, etc.)"
3333
- "MCP (`inspect_scan`, `inspect_scan_dir` tools)"
34-
- "GitHub Action (`.github/action.yml`)"
3534
- "SARIF output"
3635
- "Browser-based checks (`browser/` sub-module)"
3736
- "CVE / dependency database"

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
- "Browser-based / dynamic check (`browser/`)"
3131
- "Output format (JSON, SARIF, JUnit, HTML, terminal)"
3232
- "Configuration (`.inspect.toml`, options)"
33-
- "MCP server / GitHub Action / tooling"
33+
- "MCP server / tooling"
3434
validations:
3535
required: true
3636

.github/action.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: git clone --depth=1 https://github.com/GrayCodeAI/hawk.git ../hawk
5656
- name: gofumpt diff
5757
run: |
58-
go install mvdan.cc/gofumpt@latest
58+
go install mvdan.cc/gofumpt@v0.10.0
5959
out=$(gofumpt -l .)
6060
if [ -n "$out" ]; then
6161
echo "::error::gofumpt would reformat the following files:"

AGENTS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Website security auditing and crawling library for Go. Crawls sites concurrently
44

55
## Design Principles
66

7-
- **Library + CLI** — importable library with optional `inspect-ci` binary
7+
- **Library** — importable Go library + embeddable MCP server (no CLI binary)
88
- **No LLM dependency** — pure static analysis on crawled pages
99
- **Extensible** — custom checks (Go code) + declarative rules (no code required)
1010

@@ -25,7 +25,6 @@ gofumpt -w . # Format
2525
- `rule.go` — Declarative rule engine (YAML-based)
2626
- `finding.go` — Findings with severity, CWE, and evidence
2727
- `report.go` — Report generation (JSON, SARIF, HTML)
28-
- `cmd/inspect-ci/` — Optional CI binary for pipeline integration
2928

3029
## Conventions
3130

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4040
quality impact / SARIF compatibility / SSRF & egress safety /
4141
Testing / Checklist.
4242
- `.github/ISSUE_TEMPLATE/bug_report.yml` — surface dropdown
43-
(library API / MCP / SARIF / GitHub Action / browser checks /
44-
CVE database) and false-positive textarea.
43+
(library API / MCP / SARIF / browser checks / CVE database) and
44+
false-positive textarea.
4545
- `.github/ISSUE_TEMPLATE/feature_request.yml``kind` selector
4646
covering 8 functional areas (security checks / accessibility /
4747
SEO / performance / browser / output formats / config / tooling)

README.md

Lines changed: 145 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,179 @@
11
<p align="center">
22
<h1 align="center">Inspect</h1>
33
<p align="center">
4-
<strong>Security vulnerability scanner for code</strong>
4+
<strong>Live website auditor for accessibility, TLS, cookies, and security headers</strong>
55
</p>
66
<p align="center">
7-
<a href="https://golang.org/"><img src="https://img.shields.io/badge/Go-1.23+-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go"></a>
7+
<a href="https://golang.org/"><img src="https://img.shields.io/badge/Go-1.26+-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go"></a>
88
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License"></a>
99
<a href="https://github.com/GrayCodeAI/inspect/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/GrayCodeAI/inspect/ci.yml?style=flat-square&label=tests" alt="CI"></a>
1010
</p>
1111
</p>
1212

1313
---
1414

15-
Inspect scans code for security vulnerabilities, anti-patterns, and potential issues. It provides actionable findings with severity ratings and remediation guidance.
15+
## What is inspect
1616

17-
## Features
17+
inspect is a Go library that crawls live **websites** and audits the pages it
18+
finds — broken links, security headers, forms, accessibility, performance, SEO,
19+
TLS, cookies, mixed content, subresource integrity, AI-readiness, and
20+
reachability. It is part of the [hawk](https://github.com/GrayCodeAI/hawk) ecosystem:
21+
hawk wires inspect into its own commands, and inspect also ships an MCP server
22+
so any MCP-compatible agent can run audits.
1823

19-
- **Multi-language support** - Scans Go, Python, JavaScript, TypeScript, and more
20-
- **OWASP coverage** - Detects common vulnerability patterns
21-
- **Custom rules** - Define project-specific security policies
22-
- **CI/CD integration** - Fails builds on critical issues
24+
> **inspect is a Go library (and MCP server), not a CLI.** It ships no `inspect`
25+
> binary of its own — it analyzes running URLs, not source code. Import it
26+
> directly to embed website auditing in your own Go program, or run the MCP
27+
> server to expose it to an agent.
2328
24-
## Quick Start
29+
It crawls concurrently (with rate limiting, robots.txt support, redirect
30+
handling, and SSRF protection), runs each check against the discovered pages,
31+
and returns findings with severity levels. Results can be emitted as SARIF for
32+
the GitHub Security tab.
2533

26-
```bash
27-
go get github.com/GrayCodeAI/inspect
28-
```
34+
## Quick Start
2935

3036
```go
31-
import "github.com/GrayCodeAI/inspect"
37+
import (
38+
"context"
39+
"fmt"
3240

33-
scanner := inspect.NewScanner(
34-
inspect.WithRules(inspect.DefaultRules),
41+
"github.com/GrayCodeAI/inspect"
3542
)
3643

37-
report, err := scanner.Scan(ctx, "./path/to/code")
44+
// One-shot scan with the Standard preset.
45+
report, err := inspect.Scan(ctx, "https://example.com", inspect.Standard)
46+
if err != nil {
47+
// handle error
48+
}
3849
for _, f := range report.Findings {
39-
fmt.Printf("[%s] %s - %s\n", f.Severity, f.Rule, f.Message)
50+
fmt.Printf("[%s] %s: %s\n", f.Severity, f.URL, f.Message)
51+
}
52+
```
53+
54+
Requires Go 1.26+.
55+
56+
For repeated or high-throughput scans, reuse a `Scanner` (safe for concurrent use):
57+
58+
```go
59+
scanner := inspect.NewScanner(inspect.Standard, inspect.WithDepth(3))
60+
r1, _ := scanner.Scan(ctx, "https://site-a.com")
61+
r2, _ := scanner.Scan(ctx, "https://site-b.com")
62+
```
63+
64+
## Features
65+
66+
inspect ships nine built-in checks (registered in `check.DefaultRegistry`). The
67+
six marked **(default)** run in the `Standard`, `Deep`, and `CI` presets; the
68+
remaining three are opt-in via `WithChecks`.
69+
70+
- **Links** *(default)* — crawls and reports broken/unreachable links
71+
- **Security headers** *(default)* — detects missing CSP, HSTS, and related
72+
headers; also audits TLS certificate validity/expiry, cookie `Secure` /
73+
`HttpOnly` / `SameSite` flags, and mixed content on HTTPS pages
74+
- **Forms** *(default)* — form validation checks (CSRF, action URLs)
75+
- **Accessibility (`a11y`)** *(default)* — meta/ARIA checks; optional axe-core
76+
and color-contrast analysis through the `browser` sub-module (headless
77+
Chromium via rod)
78+
- **Performance (`perf`)** *(default)* — resource sizes and render-blocking
79+
resources
80+
- **SEO** *(default)* — meta tags, structured data, and metadata checks
81+
- **SRI** — Subresource Integrity validation
82+
- **AI-ready (`aiready`)** — checks for agent/LLM-friendly metadata
83+
- **Reachability** — host/URL reachability checks
84+
- **Concurrent crawler** — depth limits, rate limiting, robots.txt, redirect
85+
following, and SSRF protection (private IPs blocked by default)
86+
- **SARIF output**`inspect.GenerateSARIF` emits SARIF 2.1.0 for the GitHub
87+
Security tab
88+
- **MCP server** — expose `inspect_scan` and `inspect_scan_dir` to any agent
89+
- **Extensible** — register custom `Checker` implementations or declarative
90+
`RuleCheck` patterns
91+
92+
## Presets
93+
94+
The default checks are: `links`, `security`, `forms`, `a11y`, `perf`, `seo`.
95+
Add the opt-in checks (`sri`, `aiready`, `reachability`) with `WithChecks`.
96+
97+
| Preset | Behavior |
98+
|---|---|
99+
| `Quick` | Shallow crawl (depth 2), `links` only |
100+
| `Standard` | Balanced crawl (depth 5), the six default checks |
101+
| `Deep` | Exhaustive crawl (no depth limit), the six default checks |
102+
| `SecurityOnly` | Security-related checks only |
103+
| `CI` | Default checks, fail on high severity |
104+
105+
## MCP Server
106+
107+
inspect ships an MCP server (stdio transport) that exposes website auditing to
108+
any MCP-compatible agent:
109+
110+
```go
111+
import inspectmcp "github.com/GrayCodeAI/inspect/mcp"
112+
113+
srv := inspectmcp.New(inspect.Standard)
114+
if err := srv.ServeStdio(); err != nil {
115+
// handle error
40116
}
41117
```
42118

119+
**Tools:**
120+
121+
- `inspect_scan` — crawl a URL and run the configured checks
122+
- `inspect_scan_dir` — serve and scan a local directory of HTML files
123+
124+
## Browser-Rendered Analysis
125+
126+
By default inspect analyzes raw HTTP responses. To analyze JavaScript-rendered
127+
pages and run axe-core accessibility checks, supply a `BrowserEngine` from the
128+
`browser` sub-module:
129+
130+
```go
131+
import "github.com/GrayCodeAI/inspect/browser"
132+
133+
engine, err := browser.New()
134+
if err != nil {
135+
// handle error
136+
}
137+
defer engine.Close()
138+
139+
report, err := inspect.Scan(ctx, "https://example.com",
140+
inspect.Standard,
141+
inspect.WithBrowser(engine),
142+
)
143+
```
144+
145+
## Custom Checks
146+
147+
```go
148+
// Declarative rule — no Go code beyond the struct.
149+
inspect.RegisterRule(inspect.RuleCheck{
150+
RuleName: "x-frame-options",
151+
RuleSeverity: inspect.SeverityHigh,
152+
HeaderMissing: []string{"X-Frame-Options"},
153+
})
154+
155+
// Full Checker implementation, scoped to a single Scanner.
156+
scanner := inspect.NewScanner(inspect.WithCustomChecks(myCheck))
157+
```
158+
43159
## Examples
44160

45161
See the [examples/](examples/) directory for runnable code samples.
46162

47-
## Configuration
163+
## Architecture
48164

49-
Create `.inspect.yaml` to customize scanning:
165+
See [docs/architecture.md](docs/architecture.md) for the package layout and data flow.
50166

51-
```yaml
52-
rules:
53-
- name: no-hardcoded-secrets
54-
severity: critical
55-
- name: sql-injection
56-
severity: high
57-
ignore:
58-
- vendor/
59-
- testdata/
60-
```
167+
## Ecosystem
168+
169+
inspect is part of the hawk ecosystem:
170+
171+
| Component | Repository | Purpose |
172+
|---|---|---|
173+
| **hawk** | [GrayCodeAI/hawk](https://github.com/GrayCodeAI/hawk) | AI coding agent |
174+
| **eyrie** | [GrayCodeAI/eyrie](https://github.com/GrayCodeAI/eyrie) | LLM provider runtime |
175+
| **yaad** | [GrayCodeAI/yaad](https://github.com/GrayCodeAI/yaad) | Graph-based memory |
176+
| **inspect** | This repo | Website audit library + MCP server |
61177

62178
## Contributing
63179

0 commit comments

Comments
 (0)