Skip to main content

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:

  1. Implementation — an agent executes a prompt to build/modify code
  2. Verification — separate checkers (scripts, agents, or both) verify the work
  3. 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 errors
  • architect — validates design, checks for circular dependencies
  • pm — confirms requirements are met, no TODOs remain
  • senior-tester — checks test integrity, looks for cheating
  • senior-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

This version

0.3.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juvenal-0.3.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juvenal-0.3.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file juvenal-0.3.1.tar.gz.

File metadata

  • Download URL: juvenal-0.3.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for juvenal-0.3.1.tar.gz
Algorithm Hash digest
SHA256 cdc5fadbcb2d079ceffee9b2749676d5720440690466882b8b74ad10c9645f70
MD5 0b5732a457e439c6ebd177ce1b5aadb5
BLAKE2b-256 b8ddac577a213bb90081afb41f9050154e5a444c2e37cafd684243ce1c260aac

See more details on using hashes here.

File details

Details for the file juvenal-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: juvenal-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for juvenal-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b98d15ea6580de270070ddd99af4a10199880508e9d1c317a4dd5bf462546f9
MD5 cbfa5f655d0a1e528cbe02d282803131
BLAKE2b-256 490dd4bb46edc974c99163a40d52591307abcb4cf4ab541075946d22fc2c8295

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page