JeongJaeSoon/agent-guard
Local shell guardrails against coding-agent secret leaks, backed by gitleaks
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Agent Guard is a shell-based policy layer around coding-agent tools and Git. Claude Code and Codex hooks apply policy before supported commands execute, mask output where the host exposes a supported route, and trigger scans after file mutations. The native pre-commit hook, GitHub Action, and standalone CLI provide scan entry points that do not depend on agent hook dispatch.
Shell owns detection orchestration, policy, and host adapters; gitleaks provides secret scanning. Release archives and Homebrew packages use a checksum-verified, prebuilt Rust helper for literal replacement rather than moving policy or detection into the native binary. A shell fallback remains available, and Git marketplace plugins are source-only.
Key Capabilities & Differentiators
Agent Guard can block common risky .env reads before a supported tool executes, mask secret-like values on supported output routes, and scan modified files after edits. For supported agent-driven commit and push commands, the plugin checks staged added lines and refuses options that disable Git hooks or signing. The commit gate also accounts for tracked changes that Git may stage as part of the commit itself.
When the final commit contents cannot be determined ahead of time, the plugin can scan tracked changes and untracked files rather than relying on the current index. The native pre-commit hook checks staged additions once Git has assembled the commit's contents and aborts on a finding or scan failure. The GitHub Action checks the files checked out for the push or pull request on which it runs; this is not a claim of full Git-history coverage.
Trade-offs & Limitations
Standalone gitleaks is the simpler choice for a scan at a known Git or CI checkpoint. Agent Guard adds coverage earlier in the agent's workflow, including certain reads and output paths that a repository scanner never sees. That coverage depends on host hook dispatch and shell command interpretation, so a passing synthetic check is not evidence that every live route works. Broader scans when commit contents are uncertain are worth testing in large working trees.
Default processing is local and ephemeral, without a hosted account or telemetry collector. An endpoint-backed PII provider changes that boundary and warrants separate privacy review. Keep GitHub Secret Scanning, Push Protection, and regular credential management in place: Agent Guard is an additional control, not a vault, DLP system, EDR, or credential rotator.
Hardware & Deployment Guide
Supported platforms are Apple silicon macOS and Linux on x64 or arm64; Windows and Intel macOS are unsupported. Existing Intel Mac installs can still use the shell/jq fallback but are not release-tested. Runtime requirements are sh, awk, git, jq, and gitleaks 8.30 or newer. The gitleaks version probe also needs setsid or Perl for process-group isolation; agent-guard doctor reports a missing isolation tool. Rust is not a runtime dependency.
Run guided plugin setup first, then use the harmless live probes to verify dispatch on the actual host tool routes you rely on. v3.17.2 moved the shell-word parser and Git gate into bin/lib. v3.17.3 refined handling of quoted and piped ripgrep commands and made a signaled hook-input validator follow infrastructure-failure policy rather than treating its input as malformed.
Teams using Claude Code or Codex that want to stop accidental secret exposure on verified tool routes and back that up with local Git and CI checks.
A standalone CI scan is sufficient, your fleet is Windows-only, or you need comprehensive DLP, credential rotation, or guaranteed coverage across every agent tool.
Quick Start & Installation
agent-guard scan-working-tree agent-guard scan-staged agent-guard scan-path .
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| agent-guard ★ | 47 | +2 | Shell | MIT | Local shell guardrails against coding-agent secret leaks, backed by gitleaks |
| obsidian-skills | 56.2k | +1.7k | Shell | MIT | Agent Skills plugins for editing Obsidian files and working with vaults |
| ponytail | 204.4k | +4.1k | JavaScript | MIT | A prompt-driven coding-agent plugin for smaller changes and focused tests. |
| ECC | 316.1k | +4.2k | JavaScript | MIT | Plugins and CLI workflows for planning, reviewing, and verifying agent-written c |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/JeongJaeSoon/agent-guard.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about agent-guard
Does a successful plugin setup prove that my agent is protected?
What hardware does it need, and where should I measure overhead?
Can we deploy it internally without sending data to a hosted service?
When is Agent Guard worth adding over standalone gitleaks?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy