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.
caseguard/: Core application package.data_loader.py: Loads and parsesreferral-queue.json.history_client.py: Interacts with the local Resident History API.policy_service.py: Parses rules fromauthority-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.
- Python 3 standard library (no external packages required)
(To simulate a pure clean-machine evaluation)
- (Optional) Create and activate a clean virtual environment:
python -m venv venv # Windows: .\venv\Scripts\activate # Mac/Linux: source venv/bin/activate
- Start the resident history API in a background terminal:
(Note: The main application is fault-tolerant and will gracefully handle missing history if you skip this step).
python -m services.history_service --port 8083
- Run the main processing workflow:
python -m caseguard.main
- Run the deterministic safety tests:
python -m unittest discover tests
Running the main workflow will process the 12 official referrals from referral-queue.json.
You will observe:
- Normal Referrals: Fetch history, draft a triage note via the LLM provider, and log completion.
- 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. - The queue continues processing unaffected.
- Supervisor Review: At the end of the run, escalations are reviewed. Approved actions acquire an
ApprovalRecordand resume safely. Rejected actions terminate.