agentleFS
openclawopenclaw/clawscan/AGENTS.md

clawscan

AGENTS.md158 starsChanged 42 days agoMITView on GitHub

ClawScan is a Go CLI for agent-skill security scanning. It runs scanner adapters, preserves their raw JSON evidence, optionally invokes an external judge harness, and supports benchmark/leaderboard workflows for comparing scanner and judge setups. Keep the public CLI general purpose. ClawHub parity helpers may exist in separate commands, but do not add ClawHub-specific flags to cmd/clawscan. - cmd/clawscan/ - public CLI entrypoint. - cmd/verify-clawhub-prompt/ - OpenClaw maintainer parity tooling, separate from the public CLI. - internal/runner/ - scanner adapters, artifact…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 1 is common, 4 are distinctive, and 7 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Keep the public CLI general purpose.

    line 10
  2. Very specific:

    Use standard Go formatting.

    line 47
  3. Distinctive:

    Keep package boundaries small and boring.

    line 48
  4. Distinctive:

    Keep scanner evidence raw.

    line 50
  5. Common:

    Add comments only for non-obvious contracts, such as secret redaction, artifact compatibility, or benchmark scoring semantics.

    line 52
  6. Very specific:

    Never add API-key CLI flags.

    line 64
  7. Very specific:

    Run artifacts must record only secret-safe env presence, such as present or missing, never secret values.

    line 66
  8. Very specific:

    When a judge is configured, usable partial SkillSpector reports may reach the independent judge with status: partial and reportPolicy: …

    line 83
  9. Distinctive:

    Use conventional commit messages.

    line 122
  10. Very specific:

    Keep generated dist/ changes out of ordinary feature commits unless the task is release-packaging proof.

    line 123
  11. Distinctive:

    After the one-time npm registry bootstrap package, npm releases use trusted publishing from GitHub Actions.

    line 130
  12. Very specific:

    Use --max-priority P3 with the shared autoreview helper to preserve this repository's existing P0–P3 review gate.

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Purpose

ClawScan is a Go CLI for agent-skill security scanning. It runs scanner adapters, preserves their raw JSON evidence, optionally invokes an external judge harness, and supports benchmark/leaderboard workflows for comparing scanner and judge setups.

Keep the public CLI general purpose. ClawHub parity helpers may exist in separate commands, but do not add ClawHub-specific flags to cmd/clawscan.

Project Structure

  • cmd/clawscan/ - public CLI entrypoint.
  • cmd/verify-clawhub-prompt/ - OpenClaw maintainer parity tooling, separate from the public CLI.
  • internal/runner/ - scanner adapters, artifact generation, judge execution, benchmark loading, and submission validation.
  • internal/profiles/ - built-in and project-local .clawscan.yml profile resolution.
  • internal/clawhubprompt/ - ClawHub prompt rendering parity support.
  • docs/ - public operator documentation and docs-site source.
  • leaderboard/ - Security Signals submissions, results, and Hugging Face Space support.
  • scripts/ - docs, release, and leaderboard helper scripts.
  • skills/clawscan-cli/ - Codex skill for using this CLI.
  • npm/clawscan/ - npm package wrapper, binary resolver, and package tests.
  • .agents/skills/autoreview/SKILL.md - shared review skill setup and entrypoint.
  • dist/ - generated release/docs artifacts. Do not hand-edit it.

Development Commands

  • go test -count=1 ./... - full Go test suite without cached results.
  • go vet ./... - Go static checks.
  • go run ./cmd/clawscan --help - inspect the public help output.
  • printf '{"status":"clean","findings":[]}' > /tmp/skillspector.json && go run ./cmd/clawscan ./README.md --scanner skillspector --scanner-result skillspector=/tmp/skillspector.json --sandbox off --json
    • secretless smoke test.
  • make docs-site - rebuild the generated docs site under dist/docs-site.
  • make release VERSION=v0.0.0-test - build local release archives under dist/.
  • node scripts/build-npm-package.mjs --version v0.0.0 --pack --smoke - build and smoke-test the npm package wrapper.

Coding Style

  • Use standard Go formatting. Run gofmt on touched Go files.
  • Keep package boundaries small and boring; prefer targeted helpers over large cross-cutting abstractions.
  • Keep scanner evidence raw. Scanner adapters should emit the upstream JSON or a small wrapper around skipped/error state, not a normalized policy summary.
  • Add comments only for non-obvious contracts, such as secret redaction, artifact compatibility, or benchmark scoring semantics.

Scanner And Judge Rules

  • Public scanner IDs are part of the CLI surface. The retired static, clawscan-static, and virustotal scanners are gone; do not reintroduce them.
  • Register built-in scanners through the scanner registry instead of adding one-off scanner switches.
  • Scanner adapters should declare required environment variables up front so ClawScan can fail before doing partial work.
  • Never add API-key CLI flags. Credentials belong in environment variables such as SNYK_TOKEN and SOCKET_CLI_API_TOKEN.
  • Run artifacts must record only secret-safe env presence, such as present or missing, never secret values.
  • Command-backed scanners and judges run through the Docker sandbox by default, including SkillSpector. Do not assume host scanner binaries are needed unless the user explicitly chooses --sandbox off.
  • Sandbox env passthrough is an allowlist of variable names, never values. Use --sandbox-env or profile sandbox.env for judge-specific credentials.
  • --judge is an external harness command. Do not add a model-provider framework to ClawScan unless the product direction changes.
  • The runner is judge-agnostic. Never key runner, scanner, or judge behavior on a profile name. Judge-specific checks (input limits, inspection proofs) belong in the judge command; a failed judge command keeps its own error.
  • Judge placeholders and prompt interpolation must fail clearly when they reference a scanner that was not requested.
  • The optional overview step is advisory prose about a completed verdict. Its failure, timeout, or output never changes the verdict, gate, run status, completeness, or exit status.
  • When a judge is configured, usable partial SkillSpector reports may reach the independent judge with status: partial and reportPolicy: judge-gaps. Preserve raw partial status, findings, gaps, and provenance. An artifact-capable judge investigates material gaps in the exact artifact; an evidence-only judge (the bundled ClawHub profiles) treats them as uncertainty. Both record that uncertainty; do not add a 100%-coverage or inspect-every-gap gate. Missing, malformed, crashed, or unsuccessful output remains an operational failure. Keep sandbox checks and genuine secret, malicious, and unsafe-bytecode protections. See docs/judge.md and internal/runner/skillspector_partial_test.go for the consumer contract and regression checks.

Profiles And Benchmarks

  • Built-in profiles live in internal/profiles/<profile>/clawscan.yml.
  • Project-local .clawscan.yml / .clawscan.yaml files may shadow built-ins. CLI flags override profile values for a single run.
  • Select the ClawHub production profile explicitly with --profile clawhub. --config <path> without --profile runs every profile in that config.
  • Supported benchmark verdicts are clean, suspicious, and malicious.
  • OpenClaw Security Signals predictions use predictions.jsonl; keep that file lightweight and secret-free.

Verification Expectations

  • For Go behavior changes, run focused tests plus go test -count=1 ./... and go vet ./....
  • For docs/help changes, run make docs-site when generated docs can change.
  • For npm wrapper or release changes, run node --test npm/clawscan/test/*.test.mjs, node --test scripts/build-npm-package.test.mjs, and node scripts/build-npm-package.mjs --version v0.0.0 --pack --smoke.
  • For scanner adapters, add fixture-backed tests and use live API smoke tests only when credentials are already available. Do not print secrets.
  • For leaderboard/submission changes, validate the relevant shell/Python paths and run scripts/validate-security-signals-submissions.sh on a representative fixture when possible.

Commit And Release Notes

  • Use conventional commit messages.
  • Keep generated dist/ changes out of ordinary feature commits unless the task is release-packaging proof.
  • For non-trivial changes, follow the repository autoreview entrypoint and its Sol/high/Standard defaults and explicit-override precedence before final handoff. Preserve the P0–P3 review gate.
  • Releases are tag-driven through the GitHub release workflow. Local release archives should match make release VERSION=<version>.
  • After the one-time npm registry bootstrap package, npm releases use trusted publishing from GitHub Actions. Do not add long-lived npm tokens.

Autoreview priority

Use --max-priority P3 with the shared autoreview helper to preserve this repository's existing P0–P3 review gate. Follow the shared skill setup before running it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.