Who guards the agents? A framework for orchestrating AI coding agents through verified implementation phases.
Project description
Juvenal
Quis custodiet ipsos custodes? — Who guards the agents?
Juvenal is a framework for orchestrating AI coding agents through verified implementation phases. It prevents agents from cheating on success criteria by separating implementation from verification.
How It Works
A non-agentic Python script orchestrates AI coding agents (Claude or Codex) through alternating steps:
- Implementation — an agent executes a prompt to build/modify code
- Verification — separate checkers (scripts, agents, or both) verify the work
- Retry — if verification fails, the failure context is injected and the agent tries again
The implementing agent and the checking agent are separate processes, so the implementer can't cheat by weakening tests.
Install
pip install -e ".[dev]"
Quick Start
# Scaffold a workflow
juvenal init my-project
# Run a workflow
juvenal run workflow.yaml
# Generate a workflow from a goal
juvenal plan "implement a REST API with tests" -o workflow.yaml
# Plan and immediately run
juvenal do "add authentication to the Flask app"
Workflow Formats
YAML
name: "my-workflow"
backend: claude
max_retries: 999
phases:
- id: implement
prompt: "Implement the feature."
checkers:
- type: script
run: "pytest tests/ -x"
- type: agent
role: tester
Directory Convention
my-workflow/
phases/
01-setup/
prompt.md # implementation prompt
check-build.sh # script checker (exit 0 = pass)
check-quality.md # agent checker
02-implement/
prompt.md
check-tests.sh # paired with .md = composite
check-tests.md # gets {script_output} injected
Bare Markdown
phases/
01-setup.md # single phase, default tester checker
Checker Types
| Type | Description |
|---|---|
script |
Shell command; exit 0 = PASS, nonzero = FAIL |
agent |
AI agent that emits VERDICT: PASS or VERDICT: FAIL: reason |
composite |
Script runs first, output fed to agent via {script_output} |
Built-in Roles
Agent checkers can use built-in verification personas:
tester— runs tests, checks for build errorsarchitect— validates design, checks for circular dependenciespm— confirms requirements are met, no TODOs remainsenior-tester— checks test integrity, looks for cheatingsenior-engineer— reviews code quality, completeness, security
CLI
juvenal run <workflow> [--resume] [--phase X] [--max-retries N] [--backend claude|codex] [--dry-run]
juvenal plan "goal" [-o output.yaml] [--backend claude|codex]
juvenal do "goal" [--backend claude|codex] [--max-retries N]
juvenal status [--state-file path]
juvenal init [directory] [--template name]
License
MIT
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 juvenal-0.3.0.tar.gz.
File metadata
- Download URL: juvenal-0.3.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99e7b5d62e3139cea1651f0500c6e6ebb7d689f5cdcac53ebd22340c97d9ae77
|
|
| MD5 |
e87182f344ec03991a4726c75a57732f
|
|
| BLAKE2b-256 |
075be98d7c185e6fa4ddea00dc0f21f22581aa17d374957be7c34c6ce6b9a154
|
File details
Details for the file juvenal-0.3.0-py3-none-any.whl.
File metadata
- Download URL: juvenal-0.3.0-py3-none-any.whl
- Upload date:
- Size: 28.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d1b80a15ab827cfc4bdbc84ac9c7328b1f33b8fe62517908a6118003fd6022
|
|
| MD5 |
415d236af1c68823aa933704d31bbea5
|
|
| BLAKE2b-256 |
da684e252a68c4c661ae6303597ea8c3a811eb0a03305eeff25a6103f1330710
|