Developer-first AI safety checks: prompt-policy lint, secret scanning, and log scanning with PII detection. Zero-dep CLI + GitHub Action + Claude Skill + Cursor Rule.
Project description
wrg-devguard
Developer-first AI safety checks: prompt-policy lint + secret scanning.
Zero-dependency Python CLI that scans a repository for two classes of issues before your PR lands:
- Leaked secrets — API keys, private keys, tokens, common credential formats in tracked files.
- Prompt-policy violations — deny-listed patterns in prompts, system messages, and AI-facing text assets (configurable via JSON policy).
Ships as:
- A Python package (
pip install wrg-devguard) - A GitHub Action (drop-in composite action for any repo)
- A Claude Code skill (
.claude/skills/wrg-devguard/) - A Cursor rule (
.cursor/rules/wrg-devguard.mdc)
No external dependencies in the core scanner (stdlib only). Optional [yaml]
extra for YAML policy files. Optional bandit subcommand for Python security
scanning.
Install
pip install wrg-devguard
For YAML policy support:
pip install "wrg-devguard[yaml]"
Quick start
# Run both checks and fail on any high-severity finding
wrg-devguard check --path . --fail-on error
# Scan only for leaked secrets
wrg-devguard scan-secrets --path .
# Lint AI-facing text assets against a policy
wrg-devguard lint-policy --path . --profile strict
# Emit a JSON report for CI
wrg-devguard check --path . --json-out wrg-devguard-report.json
GitHub Action
# .github/workflows/security.yml
name: security
on: [pull_request, push]
jobs:
wrg-devguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: WRG-11/wrg-devguard@v0
with:
profile: strict
fail-on: error
See action.yml for all inputs.
GitHub Actions Marketplace
3-line quickstart (drop into any .github/workflows/*.yml):
- uses: WRG-11/wrg-devguard@v0
with:
path: .
fail-on: error
Inputs
| Name | Required | Default | Description |
|---|---|---|---|
path |
no | . |
Root path to scan |
fail-on |
no | error |
Fail threshold: error, warn, none |
format |
no | text |
Report format: text, json, sarif |
profile |
no | baseline |
Policy profile: baseline or strict |
allowlist |
no | empty | Optional path to allowlist JSON |
python-version |
no | 3.12 |
Python version installed by the action |
version |
no | latest | Pip version spec (e.g. ==0.1.1) |
Outputs
| Name | Description |
|---|---|
findings-count |
Total number of findings produced by the scan |
report-path |
Path to the generated report (empty when format: text) |
Use cases
1. PR check — block any error-severity finding:
name: security
on: pull_request
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: WRG-11/wrg-devguard@v0
with:
path: .
fail-on: error
2. Scheduled audit — emit SARIF, never fail the job, upload to code-scanning:
name: weekly-audit
on:
schedule:
- cron: '0 6 * * 1'
jobs:
scan:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- id: dg
uses: WRG-11/wrg-devguard@v0
with:
format: sarif
fail-on: none
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.dg.outputs.report-path }}
3. Monorepo path filter — scan only one app, warn-level threshold:
- uses: WRG-11/wrg-devguard@v0
with:
path: apps/payments
profile: strict
fail-on: warn
format: json
Pinning
@v0— moving major tag during the beta v0.x line, fast-forwards on every minor/patch release. Will flip to@v1on the v1.0.0 ship.@v0.2.2— immutable release tag (recommended for reproducible CI)
See the Marketplace listing for the latest published versions.
Claude Code skill
Drop the skill into your workspace:
mkdir -p .claude/skills/wrg-devguard
curl -L https://raw.githubusercontent.com/WRG-11/wrg-devguard/main/.claude/skills/wrg-devguard/SKILL.md \
-o .claude/skills/wrg-devguard/SKILL.md
Claude Code will surface the skill automatically when you ask things like "scan for secrets", "is this safe to commit", or "check for leaks".
Cursor rule
Drop the rule into your workspace:
mkdir -p .cursor/rules
curl -L https://raw.githubusercontent.com/WRG-11/wrg-devguard/main/.cursor/rules/wrg-devguard.mdc \
-o .cursor/rules/wrg-devguard.mdc
Cursor will apply the rule before suggesting any git commit command.
Policy file
Default lookup order:
--policy <path>argument if provided.wrg/policy.jsonat the repo root- Built-in defaults
Profiles:
baseline→ PR-friendly baseline (recommended for CI, default)strict→ stricter local/release audits (use--profile strict)
Place custom policies in .wrg/policy.json (JSON) or .wrg/policy.yaml
(requires [yaml] extra).
Commands
wrg-devguard profiles # list available profiles
wrg-devguard lint-policy --path . # policy lint only
wrg-devguard scan-secrets --path . # secret scan only
wrg-devguard check --path . # lint-policy + scan-secrets, single JSON report
wrg-devguard check --path . --profile strict
wrg-devguard check --path . --json-out report.json
wrg-devguard check --path . --fail-on warning
wrg-devguard check --path . --allowlist .wrg/allowlist.json
wrg-devguard scan-logs --path <log-file> # PII + secret scan on log files (v0.2.0)
wrg-devguard scan-logs --path . --json-out logs.json
wrg-devguard bandit --path src/ # optional: bandit wrapper
Exit codes
0— no findings above threshold1— findings at or above--fail-onthreshold2— configuration or input error
Output schema
The scan-logs subcommand (shipped in v0.2.0) emits a frozen JSON contract
documented at schemas/log_scan_result.schema.json.
Consumers (the GitHub Action, the Control Center log viewer, future CI integrations) parse against this schema. Highlights:
schema_version:"1"(frozen for the v0.2.0 line).source: one ofmanual,ci,cc-endpoint. v0.2.0 shipsmanualonly.findings[].pattern_id: stable<NAMESPACE>-<NNN>identifiers (AWS-001,EMAIL-001, etc.). Patterns are versioned by ID — superseded patterns get a new ID, never reuse.findings[].redacted_excerpt: producers MUST middle-mask the matched value. Raw secrets never appear in the output.- Categories and severities are open-enum-friendly: consumers should accept unknown values gracefully (treat as a generic finding) so v0.3.0 additions don't break v0.2.0 readers.
Validation tests live at tests/schemas/test_log_scan_result_schema.py
(28 cases covering self-validation, fixture acceptance, and malformed-payload
rejection). To run them locally:
pip install -e ".[dev]"
pytest tests/schemas/ -v
Why another secret scanner?
- Zero runtime deps — the core scanner is stdlib only, so
pip installis instant and works in any sandbox. - Policy lint in the same tool — most scanners only do secrets. We also catch prompt-policy violations (deny-listed patterns, hardcoded system prompts, PII in AI-facing text).
- AI-native UX — ships with a Claude skill and a Cursor rule so the scanner runs automatically inside your AI coding assistant, not just in CI.
- Stable JSON schema —
check --json-outemits a versioned schema that never breaks.
Development
git clone https://github.com/WRG-11/wrg-devguard.git
cd wrg-devguard
pip install -e ".[dev]"
pytest -q
License
MIT. See LICENSE.
Contributing
Issues and PRs welcome. For substantial changes, open an issue first to discuss scope.
Part of the WinstonRedGuard
ecosystem (private monorepo). apps/wrg_devguard/ there is the canonical
source; this repo is the public distribution mirror kept in sync on every
release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wrg_devguard-0.2.2.tar.gz.
File metadata
- Download URL: wrg_devguard-0.2.2.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69528db6841c1df98c531fc7746d05b883bf57dfbfce543138625e67ca23a2fe
|
|
| MD5 |
430bbfc08117db11d8e52fdbd4181d50
|
|
| BLAKE2b-256 |
1a200a9b1bf61e2729b18eca732afb395a12d23ce4fffda2ecd11dce5760b571
|
Provenance
The following attestation bundles were made for wrg_devguard-0.2.2.tar.gz:
Publisher:
publish.yml on WRG-11/wrg-devguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wrg_devguard-0.2.2.tar.gz -
Subject digest:
69528db6841c1df98c531fc7746d05b883bf57dfbfce543138625e67ca23a2fe - Sigstore transparency entry: 1610128199
- Sigstore integration time:
-
Permalink:
WRG-11/wrg-devguard@db6339c7a0bf04208a379b3efe9880e2709622cf -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/WRG-11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db6339c7a0bf04208a379b3efe9880e2709622cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file wrg_devguard-0.2.2-py3-none-any.whl.
File metadata
- Download URL: wrg_devguard-0.2.2-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c1ee0531abb7a814495dc70605ba5e03f4ea343227d4734b1986fe854ea26fa
|
|
| MD5 |
dae02ab2d16eaa4c42146df5783e3b68
|
|
| BLAKE2b-256 |
4b0a153e131feb69ddaf60a951321941e7110583a119f14d117228e974203923
|
Provenance
The following attestation bundles were made for wrg_devguard-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on WRG-11/wrg-devguard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wrg_devguard-0.2.2-py3-none-any.whl -
Subject digest:
7c1ee0531abb7a814495dc70605ba5e03f4ea343227d4734b1986fe854ea26fa - Sigstore transparency entry: 1610128319
- Sigstore integration time:
-
Permalink:
WRG-11/wrg-devguard@db6339c7a0bf04208a379b3efe9880e2709622cf -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/WRG-11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db6339c7a0bf04208a379b3efe9880e2709622cf -
Trigger Event:
push
-
Statement type: