AI Guardian
Security controls for AI coding agents: hooks scan prompts and tool activity, enforce permissions, and detect sensitive data.
Documentation and Q&A
- Full documentation site (latest stable release) — searchable, versioned guides.
- Latest documentation (tracks
main) — guides for upcoming development changes. - Source documentation index — browse the documentation in this repository.
- Ask questions about the documentation in NotebookLM — a Google account is required.
- Use the combined documentation export with a private LLM tool — upload this generated single-file compilation to your organization's approved private NotebookLM instance or other LLM search tool. It is generated during releases; do not edit it directly.
Security Disclaimer
AI Guardian is one layer of defense in depth, not a guarantee against every threat. Detection may miss novel or obfuscated attacks, and secret coverage depends on available scanner patterns. By design, scanner errors fail open so development remains available. Combine AI Guardian with code review, CI/CD scanning, network controls, and secret management. See Security Design for architecture and limitations.
Quick Start
uv tool install ai-guardian
ai-guardian setup --create-config --install-scanner
ai-guardian daemon start -b
Setup detects supported IDEs and guides hook setup. Open your IDE to start using
AI Guardian. For optional desktop controls, run ai-guardian tray start -b; open
the browser console with ai-guardian console.
MCP servers and Skills are blocked by default. Built-in tools (Bash, Read, Write, Edit) are allowed and scanned by hooks. See Tool Policy for the security posture and configuration.
Per-integration behavior and limitations
Supported does not mean identical enforcement. Protection requires the hooks/plugins to be installed, enabled, trusted where applicable, and loaded in the actual execution scope. A local installation does not automatically protect cloud jobs.
Legend:
- Gate can stop the action before it starts. Replace/withhold changes the model-visible prompt or result; it is not a native prompt denial or a rollback.
- Advice/observe adds context or scans activity without enforcing a gate or replacing a result.
- Conditional depends on the host path/configuration. Unverified must not be relied on for enforcement.
- Not installed/unavailable means no AI Guardian hook coverage at that stage.
| Integration / surface | Prompt handling | Pre-tool enforcement | Post-tool result handling | Key limitation |
|---|---|---|---|---|
| Claude Code | Gate | Gate | Feedback or replace supported results | Bash replacement is currently ignored; a post-tool block alone leaves the original result visible. |
| Cursor desktop / local CLI | Gate | Gate | Replace supported MCP results only | No general built-in result replacement; backend-hosted HTTP MCP results cannot be replaced locally. |
| Cursor Cloud Agent | Unavailable | Conditional gate | Supported MCP replacement only; not backend-hosted HTTP MCP | Requires loaded project/cloud-workspace hooks; local user hooks do not protect cloud runs. |
| GitHub Copilot CLI / local command hooks | Observe only | Gate | Not installed | Prompt-hook output is ignored; it cannot block or rewrite the prompt. |
| GitHub Copilot cloud coding-agent job | Not installed | Not installed | Not installed | Local setup does not provision remote job hooks. |
| Grok Build | Observe only | Gate | Observe only | Passive-event output is ignored; project hooks require trust. |
| Codex CLI / desktop Codex mode | Gate | Gate | Replace with feedback, not a sanitized copy | Codex hooks require review/trust and do not cover regular ChatGPT mode. |
| ChatGPT desktop — regular mode | Unavailable | Unavailable | Unavailable | Outside the Codex hook surface; shared MCP configuration does not add hook enforcement. |
| Windsurf Cascade | Gate | Gate | Observe only | Post-hooks cannot block or replace completed results. |
| Gemini CLI | Gate | Gate | Withhold with a fixed refusal | Does not deliver AI Guardian's sanitized copy of a sensitive result. |
Antigravity CLI (agy) |
Advice only | Gate | Observe only; no result content | Prompt advice does not terminate the model request; post-hooks cannot inspect tool output. |
| Cline | Observe only | Gate | Observe only; no verified replacement | Script-hook prompt cancellation and result replacement are not documented host contracts. |
| ZooCode | Unverified | Intended gate; unverified | Unverified replacement | Shared Cline scripts are not independently qualified for the exact ZooCode runtime. |
| Kiro IDE | Gate | Gate | Advice/context only | Post-hook context is not result replacement. |
| Kiro CLI | Observe/advice only | Gate | Advice/context only | Prompt Submit cannot block; hook availability varies by CLI generation. |
| AiderDesk extension | Gate | Conditional gate | Replace where the callback runs | Requires v0.55.0+ and an enabled extension; execution paths differ in callback coverage. |
| OpenClaw Gateway plugin | Observe only | Gate | Observe only | Prompt-event return values are ignored; the loaded plugin does not replace post-tool results. |
| OpenCode V1 (1.x) | Replace with a fixed refusal | Gate | Conditional transformation | An explicit replacement can be applied; a post-hook block is not a verified safe-redaction guarantee. |
| OpenCode V2 (2.x) | Replace with a fixed refusal | Gate | Replace/withhold | Requires V2 plugin discovery and artifacts; V1 plugin code does not run in V2. |
| Pi extension | Gate | Gate | Replace or mark as error | Requires a loaded extension; commands handled before the input event are outside its prompt gate. |
| Augment / Auggie local hooks | Not installed | Gate for selected tools | Feedback only; no replacement | Installed matchers do not cover every tool. |
| Crush | Not installed | Gate | Not installed | AI Guardian installs only the pre-tool stage. |
| Goose host CLI | Observe only | Gate | Observe only | v1.59.0 Linux/macOS only; requires an enabled plugin with the fail-closed pre-tool action. Desktop/native Windows and product container/OpenShell runtimes are unqualified. |
| Junie | Not installed | Not installed | Not installed | MCP-only advisory checks depend on the agent choosing to call and follow them; no enforced hooks. |
Post-tool processing cannot undo completed tool side effects. See the detailed per-integration behavior matrix for version-specific prerequisites, protocols, timeouts, failure behavior, and upstream references. That guide is the source of truth for this summary.
Guides
| Topic | Documentation |
|---|---|
| Install and verify | Getting started |
| Configuration and security profiles | Configuration Guide |
| IDE and agent integrations | Agent Support |
| Scanners | Scanner Installation |
| Console and operations | Console Guide · Troubleshooting |
| Containers and sandboxes | Sandbox Guide · Container Guide |
| Development | Developer Guide · Contributing |
Features
| Feature | Guide |
|---|---|
| Secret scanning and custom detection rules | Secret Scanning |
| PII detection | Secret Scanning |
| Prompt injection detection | Prompt Injection |
| Context poisoning detection | Context Poisoning |
| Image scanning | Image Scanning |
| Unicode attack detection | Unicode Attacks |
| SSRF protection | SSRF Protection |
| Config-file and credential exfiltration detection | Credential Exfiltration |
| Command credential argument scanning | Command Credential Scanning |
| HTTP request credential source scanning | HTTP Request Credential Scanning |
| Directory blocking | Directory Rules |
| Tool, MCP, and Skill permissions | Tool Policy |
| MCP security advisor and scanning | MCP Server |
| Supply-chain scanning | Configuration Guide |
| Sanitize command and secret redaction | Secret Redaction |
| Violation logging | Violation Logging |
| Compliance audit logging | Audit Logging |
| Support bundles | Support |
| Uninstall and orphan recovery | Uninstall Guide |
| Interactive console | Console Guide |
| Scanner management | Scanner Installation |
| Built-in TOML pattern engine | TOML Patterns |
| Secret liveness validation | Configuration Guide |
| Code security scanning | Scanner Installation |
| Pre-commit scanning | Pre-commit Hook |
| Inline annotations | Annotations |
| Self-protection | Security Design |
| Project configuration overlay | Configuration Guide |
| Security instructions | Configuration Guide |
| Multi-agent support and transcript scanning | Agent Support |
| Agent CLI maturity advisories | Agent Support |
| OpenCode support | OpenCode |
| Pi and Crush support | Agent Support |
| Goose host CLI pre-tool enforcement | Goose Support |
| Dummy agent for hook testing | Agent Support |
| Container image | Container Guide |
| Docker, Podman, and OpenShell sandboxes | Sandbox Guide |
| OpenShell supervisor middleware | OpenShell Middleware |
| Kubernetes deployment | Kubernetes Guide |
| Multi-daemon tray | Multi-Daemon Tray |
| Desktop shortcut and autostart | Multi-Daemon Tray |
| Tray plugins and event-driven updates | Multi-Daemon Tray |
| Hook latency metrics | Hooks |
| OpenTelemetry observability | Observability |
| Canary token detection | Configuration Guide |
| Offensive language scanning | Configuration Guide |
| Exfiltration behavior detection | Credential Exfiltration |
| Zero-config onboarding | Configuration Guide |
| Language-aware false-positive suppression | Prompt Injection |
| ML prompt injection detection | Prompt Injection |
| LeakTK listen mode | Scanner Installation |
| Scan-and-configure workflow | Console Guide |
| Security SDK and REST API | SDK Guide |
License and Contributions
Licensed under Apache-2.0. Contributions are welcome; see the Developer Guide and Contributing Guide.
For production use, install a stable release from PyPI. The main branch contains unreleased development code.
Metadata
Release files for ai-guardian 1.22.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 |
|---|---|---|---|---|
| ai_guardian-1.22.0.tar.gz | 14.4 MB | With provenance | Details for ai_guardian-1.22.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_guardian-1.22.0-py3-none-any.whl | Python 3 | none | any | Details for ai_guardian-1.22.0-py3-none-any.whl |
Total release size: 18.3 MB
Release files / ai_guardian-1.22.0.tar.gz
| Download URL | ai_guardian-1.22.0.tar.gz |
|---|---|
| Size | 14.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de23556650239f765d2a25cf5b1041c844ff86e1c3474d92be9856809c8b013a
|
|
BLAKE2b-256 checksum How to use checksums |
874887d781bbec0d263a38dabd525fb720afd7b4441fef2fe2b382e2c5cbb434
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / ai_guardian-1.22.0-py3-none-any.whl
| Download URL | ai_guardian-1.22.0-py3-none-any.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d89ff95ceaa9f5d0a7171f04fea62bc3c6d52122a3f69d7a0bb6b50066799a82
|
|
BLAKE2b-256 checksum How to use checksums |
3060c1caf7d0ce8c8ae9edd49488b3bca50561cd5bcb08c3420cc76a721e8a63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for ai-guardian 1.22.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ai_guardian-1.22.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA 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.