Skip to content
This repository was archived by the owner on Mar 21, 2026. It is now read-only.

Add Officer Clancy Budget Guardian for AI agent resource management#15

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-officer-clancy-skill
Draft

Add Officer Clancy Budget Guardian for AI agent resource management#15
Copilot wants to merge 3 commits intomainfrom
copilot/add-officer-clancy-skill

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 3, 2026

Implements budget and attempt tracking for Ralph's autonomous agent loop to prevent runaway costs and infinite loops.

Changes

New module: ralph/budget_guardian.py

  • BudgetGuardian class with attempt tracking, budget enforcement, and escalation callbacks
  • Four-level escalation: NORMAL → WARNING → CRITICAL → EXCEEDED
  • Returns Result[AttemptResult, BudgetExceededError] for each authorization

Runner integration

  • Guardian hooks into iteration loop (opt-in via RALPH_BUDGET_ENABLED=true)
  • Authorizes attempts, records outcomes, displays budget summary

Configuration

Variable Default Description
RALPH_BUDGET_ENABLED false Enable guardian
RALPH_MAX_ATTEMPTS 10 Max attempts before denial
RALPH_BUDGET_LIMIT 100.0 Total budget units
RALPH_COST_PER_ATTEMPT 10.0 Cost per attempt

Usage

from ralph.budget_guardian import BudgetConfig, BudgetGuardian

guardian = BudgetGuardian(BudgetConfig(max_attempts=5, budget_limit=50.0))

result = guardian.authorize_attempt()
if result.is_success():
    # execute work
    guardian.record_success()

Also added

  • skills/officer-clancy/SKILL.md - skill documentation
  • tests/test_budget_guardian.py - 24 tests
  • Justfile commands: ralph-budget, ralph-no-budget, ralph-test-budget

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 3, 2026 13:48
…ment

Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Co-authored-by: elasticdotventures <35611074+elasticdotventures@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Officer Clancy skill for AI persistence management Add Officer Clancy Budget Guardian for AI agent resource management Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants