Skip to content

Repository files navigation

CaseGuard AI

Controlled Autonomy for Intelligent Casework

CaseGuard AI automates the permitted caseworker workflow while enforcing authority boundaries through deterministic, policy-driven guardrails.

Differentiator: The agent's authority is controlled by an external policy (authority-policy.md) and enforced by a deterministic guardrail layer, so the agent cannot silently perform an unauthorized action.

Project Structure

  • caseguard/: Core application package.
    • data_loader.py: Loads and parses referral-queue.json.
    • history_client.py: Interacts with the local Resident History API.
    • policy_service.py: Parses rules from authority-policy.md.
    • guardrail_engine.py: Deterministically enforces policy rules on referrals.
    • llm_provider.py: Lightweight mock/real LLM abstraction for generating triage notes.
    • workflow_controller.py: Orchestrates the safe execution loop.
    • audit_logger.py: Provides structured execution tracing.
  • tests/: Automated test suite for safety invariants.

Requirements

  • Python 3 standard library (no external packages required)

Setup & Run Instructions

(To simulate a pure clean-machine evaluation)

  1. (Optional) Create and activate a clean virtual environment:
    python -m venv venv
    # Windows:
    .\venv\Scripts\activate
    # Mac/Linux:
    source venv/bin/activate
  2. Start the resident history API in a background terminal:
    python -m services.history_service --port 8083
    (Note: The main application is fault-tolerant and will gracefully handle missing history if you skip this step).
  3. Run the main processing workflow:
    python -m caseguard.main
  4. Run the deterministic safety tests:
    python -m unittest discover tests

Demo Instructions

Running the main workflow will process the 12 official referrals from referral-queue.json. You will observe:

  1. Normal Referrals: Fetch history, draft a triage note via the LLM provider, and log completion.
  2. Unauthorized Referrals: The deterministic GuardrailEngine will detect requests for suspension, payment updates, or reinstatements and place them in [PENDING APPROVAL] without executing history queries or LLM generation.
  3. The queue continues processing unaffected.
  4. Supervisor Review: At the end of the run, escalations are reviewed. Approved actions acquire an ApprovalRecord and resume safely. Rejected actions terminate.

About

CaseGuard AI - Brite Spark 2026 Problem 5

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages