A quality-assurance engine for LLM-generated code
Project description
AgentGuard
Agent-native quality engine for LLM code generation. AgentGuard provides structured guidance to your AI agent — it never calls an LLM itself.
What It Does
AgentGuard is an MCP server that gives your AI agent (Claude, GPT, Gemini, etc.) a disciplined process for generating production-ready code:
- Skeleton → file tree with responsibilities
- Contracts & Wiring → typed stubs with import connections
- Logic → function-by-function implementation
- Challenge → self-review against quality criteria
- Validate → static analysis (syntax, lint, types, imports)
Your agent does the thinking. AgentGuard provides the framework.
Installation
pip install rlabs-agentguard
That's it. One command, no extras, no API keys needed.
Configure Your IDE
Claude Desktop / Claude Code
Add to your MCP config:
{
"mcpServers": {
"agentguard": {
"command": "agentguard-mcp"
}
}
}
Cursor / Windsurf
Add to .cursor/mcp.json or equivalent:
{
"mcpServers": {
"agentguard": {
"command": "agentguard-mcp"
}
}
}
Python (direct)
python -m agentguard # starts MCP server on stdio
Tools
Agent-Native (structured guidance — no API key)
| Tool | Purpose |
|---|---|
skeleton |
L1: file tree with responsibilities |
contracts_and_wiring |
L2+L3: typed stubs with imports (saves ~15K tokens vs separate calls) |
contracts |
L2 only: typed function/class stubs |
wiring |
L3 only: import and call-chain connections |
logic |
L4: implement one function body |
get_challenge_criteria |
Self-review criteria for an archetype |
digest |
Compact project summary for efficient review |
debug |
Structured debugging protocol |
migrate |
Migration plan with compatibility checks |
Utility
| Tool | Purpose |
|---|---|
validate |
Mechanical code checks (syntax, lint, types, structure) |
list_archetypes |
List all available project archetypes |
get_archetype |
Get detailed archetype configuration |
reload_archetypes |
Pick up newly installed archetypes |
trace_summary |
Get cost & token tracking summary |
docs |
Get AgentGuard documentation on any topic |
update_agentguard |
Update to the latest version from PyPI |
Built-In Archetypes
| Archetype | Tech Stack |
|---|---|
api_backend |
Python + FastAPI (production) |
library |
Python reusable package (production) |
cli_tool |
Python CLI with subcommands |
react_spa |
TypeScript + React SPA (production) |
web_app |
Python + TypeScript full-stack (production) |
script |
Python one-off automation |
debug_backend |
Python/FastAPI debugging protocol |
debug_frontend |
React/TypeScript debugging protocol |
Marketplace
Install community archetypes:
# From the AgentGuard marketplace (agentguard.rlabs.cl)
# Use the reload_archetypes tool after installing
How It Works
AgentGuard is agent-native: every tool returns structured prompts and criteria that your AI agent processes. The tool never calls an external LLM.
Your Agent (Claude, GPT, etc.)
│
├── calls skeleton(spec, archetype) ─────→ returns L1 file tree prompt
├── calls contracts_and_wiring(spec, skeleton) → returns L2+L3 stubs prompt
├── calls logic(file, function) ─────────→ returns L4 implementation prompt
└── calls get_challenge_criteria() ──────→ returns review criteria
└── calls validate(files) ───────────────→ returns static analysis results
The agent reads the prompt, generates the code, validates it, and loops back if criteria aren't met. AgentGuard provides the structure — your agent provides the intelligence.
Development
pip install -e ".[dev]"
pytest tests/
ruff check agentguard/
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 rlabs_agentguard-0.9.0.tar.gz.
File metadata
- Download URL: rlabs_agentguard-0.9.0.tar.gz
- Upload date:
- Size: 116.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ca43e17f0617d08a5458eef18c4d95188fa134dcedbdaa097b8efd1772c3b5
|
|
| MD5 |
e93b9169670bcb00f1c541a43f817534
|
|
| BLAKE2b-256 |
f06ef173574fb7d75e195fa947f44e30e5dd94af6dce06c04688f5988ef0d628
|
Provenance
The following attestation bundles were made for rlabs_agentguard-0.9.0.tar.gz:
Publisher:
publish-pypi.yml on rlabs-cl/agentguard-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rlabs_agentguard-0.9.0.tar.gz -
Subject digest:
01ca43e17f0617d08a5458eef18c4d95188fa134dcedbdaa097b8efd1772c3b5 - Sigstore transparency entry: 1238282391
- Sigstore integration time:
-
Permalink:
rlabs-cl/agentguard-lib@6199fc825642e985897139f0ce21869bfd9235e9 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/rlabs-cl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@6199fc825642e985897139f0ce21869bfd9235e9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rlabs_agentguard-0.9.0-py3-none-any.whl.
File metadata
- Download URL: rlabs_agentguard-0.9.0-py3-none-any.whl
- Upload date:
- Size: 135.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c40a708ccf3892901f45efcfbbe86d15838c761000e1de41a502bc3a73d22a7
|
|
| MD5 |
c53036a233ba94a2af546776ffc49b19
|
|
| BLAKE2b-256 |
3e3870cb53de7da6fcfec74d833e72a3c5a6c172237789751fd2e9ef45777a3d
|
Provenance
The following attestation bundles were made for rlabs_agentguard-0.9.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on rlabs-cl/agentguard-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rlabs_agentguard-0.9.0-py3-none-any.whl -
Subject digest:
8c40a708ccf3892901f45efcfbbe86d15838c761000e1de41a502bc3a73d22a7 - Sigstore transparency entry: 1238282397
- Sigstore integration time:
-
Permalink:
rlabs-cl/agentguard-lib@6199fc825642e985897139f0ce21869bfd9235e9 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/rlabs-cl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@6199fc825642e985897139f0ce21869bfd9235e9 -
Trigger Event:
release
-
Statement type: