AI coding agents can edit files, run shell commands, and touch infrastructure. One bad rm -rf, force-push, or docker compose down -v can wipe hours of work or production data.
Thanks for helping make agent-guard safer and clearer.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest
pytest --cov=agent_guard --cov-report=term-missing
Coverage target: >90%.
Never execute destructive commands in tests. Mock subprocess.run for run / BLOCK paths. Prefer harmless commands such as python -c "print('hello')".
ruff check .
mypy src
src/agent_guard/rules/@register_ruleredactor.redacttests/rules/Treat changes to parser, run execution, redaction, and path resolution as security-critical:
check must never execute user inputrun must evaluate before subprocess.runshell=False--allow-risk