Thanks for your interest in contributing to AgentGuard! This document covers how to set up your environment, the coding/testing conventions we use, and how to submit changes.
Looking for AI-agent-friendly build/test instructions? See AGENTS.md. 简体中文贡献指南见 CONTRIBUTING_CN.md。
Everyone participating in this project is expected to follow our Code of Conduct. If you discover a security vulnerability, please follow SECURITY.md instead of opening a public issue.
- Report bugs via GitHub Issues.
- Propose features or discuss design changes via a feature-request issue before sending a large PR, so we can align on direction first.
- Improve docs under
docs/en/**(English) anddocs/zh/**(简体中文). - Add framework adapters for agent frameworks not yet supported (see
src/client/python/agentguard/adapters/agent/andsrc/client/js/agentguard/adapters/agent/). - Add or improve tests, especially around the policy/rule engine.
- Python 3.11+
- Node.js 18+ (JS client + docs tooling)
- Docker + Docker Compose (optional, needed for the full end-to-end test and for running the control server as described in the README)
git clone https://github.com/WhitzardAgent/AgentGuard.git
cd AgentGuard
# Python client + server (editable install with dev/server extras)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev,server]"
# JS client
npm installOther optional extras you may need depending on what you're working on:
redis, postgres, neo4j, dynamic (LiteLLM), dify, sandbox. See
pyproject.toml → [project.optional-dependencies].
# Python test suite
pytest -q
# A single test file / test
pytest -q tests/test_parser.py
pytest -q tests/test_parser.py::test_specific_case
# JS test suite (Node's built-in test runner, no extra framework needed)
node --test
# End-to-end smoke test (Docker if available, otherwise in-process HTTP)
./scripts/e2e.shruff check src tests # must pass cleanly
mypy src # advisory only for now — see AGENTS.md for contextPlease run ruff check src tests before submitting a PR; CI enforces it. We
run mypy in advisory (non-blocking) mode while the codebase incrementally
adopts full strict typing — you don't need to resolve every existing finding,
but please don't introduce obviously-typed regressions in files you touch.
- Fork the repository and create a topic branch off
main(git checkout -b feat/short-description). - Keep PRs focused and small where possible — one logical change per PR makes review much faster.
- Add or update tests for behavior changes, especially anything touching
the rule/policy engine (
src/shared/rules/,src/server/backend/runtime/) or the client enforcement path (.../u_guard/). - Update documentation (
docs/en/**, anddocs/zh/**where practical, plusREADME.md/README_CN.mdfor user-facing changes). - Make sure
ruff check,pytest, andnode --testpass locally. - Use a clear commit message / PR title, e.g.
feat(langgraph): support X,fix(rules): correct trace matching for Y,docs: clarify Z. - Reference related issues (
Closes #123) where applicable. - A maintainer will review your PR, may request changes, and will merge once CI is green and the review is approved.
If you're adding support for a new agent framework, mirror the structure of
an existing adapter (e.g. src/client/python/agentguard/adapters/agent/langgraph.py)
and add:
- A client adapter implementing the standard attach/patch hooks.
- Unit tests under
tests/(Python) or alongside the module (JS). - A short how-to doc under
docs/en/how-to-plugin/(and ideallydocs/zh/how-to-plugin/).
See the client plugin guide and server plugin guide for the extensibility model.
By contributing, you agree that your contributions will be licensed under the project's GNU GPLv3 license.