Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

Implements complete Ethics-as-a-Service (EaaS™) middleware system that intercepts LLM inputs and outputs to enforce safety, ethics, and reasoning protocols through SPIEL™ framework and THT™ protocol validation.

Core Components

  • src/ethics_layer.py - SPIEL™ framework evaluator: Safety (harm detection), Personalization (trauma-aware adaptation), Integrity (consistency), Ethics (bias mitigation), Logic (fallacy detection). Outputs weighted scores and violation severities.

  • src/response_filter.py - THT™ protocol validator: Truth (fact verification), Honesty (uncertainty/hallucination detection), Transparency (AI disclosure). Auto-applies fixes like adding disclaimers and uncertainty language.

  • src/voice_input.py - Voice-first analyzer: Extracts emotional state, trauma indicators, urgency level (normal/elevated/critical). Infers user preferences from linguistic patterns.

  • src/middleware.py - Orchestrator: Chains voice→SPIEL™→LLM→THT™ pipeline. Blocks on critical violations in strict mode. Maintains audit log with statistics export.

Architecture

from src import AVRTFirewall

firewall = AVRTFirewall({'strict_mode': True})
firewall.set_llm_function(lambda prompt, ctx: llm_response)

result = firewall.process_interaction(
    user_input="text or voice transcription",
    context={'is_first_interaction': True}
)

# result contains:
# - voice_analysis: emotional state, trauma flags, urgency
# - input_ethics_evaluation: SPIEL™ scores and violations
# - output_filtering: THT™ scores and applied fixes
# - final_response: filtered safe output or blocking message
# - firewall_passed: bool

Crisis Response

Detects critical urgency (suicide, harm keywords) and injects crisis resources (988 hotline, Crisis Text Line) into blocking responses. Trauma-aware framing avoids re-traumatization.

Testing

31 unit + integration tests covering safe flows, blocking scenarios, trauma detection, bias/fallacy detection, crisis response. Zero external dependencies (stdlib only). CodeQL clean.

Demo

Interactive CLI (demo/avrt_demo_app.py) demonstrates 9 scenarios: safe interaction, harmful content blocking, trauma-aware response, crisis detection, bias detection, interactive mode, statistics, comprehensive reports.

Original prompt

AVRT™ Firewall (Advanced Voice Reasoning Technology)

The Trauma-Informed, Voice-First AI Middleware.

Overview

AVRT™ is a middleware system designed to overlay Large Language Models (LLMs) to enforce safety, ethics, and reasoning protocols. Acting as a distinct "Firewall for Cognition," AVRT intercepts user inputs (specifically voice) and model outputs to ensure strict adherence to SPIEL™ and THT™ values.

This repository (github.com/avrtpro/AVRT_firewall) contains the core SDK and logic for EaaS™ (Ethics-as-a-Service).

Core Values

SPIEL™ Framework

  • Safety: Zero-tolerance for harm or unsafe advice.
  • Personalization: Trauma-informed context adaptation.
  • Integrity: Consistency in persona and data handling.
  • Ethics: Algorithmic bias mitigation.
  • Logic: Fallacy detection and reasoning enforcement.

THT™ Protocol

  • Truth: Fact-checking against grounded truth sets.
  • Honesty: Identifying uncertainty; no hallucinations.
  • Transparency: The AI must disclose it is an AI and explain its reasoning.

Directory Structure

avrt_firewall/
├── README.md
├── LICENSE
├── .gitignore
├── /src/
│   ├── middleware.py
│   ├── ethics_layer.py
│   ├── voice_input.py
│   └── response_filter.py
├── /tests/
│   └── test_firewall.py
├── /docs/
│   └── architecture.md
├── /demo/
│   └── avrt_demo_app.py

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 23, 2025 06:04
Co-authored-by: avrtpro <232434109+avrtpro@users.noreply.github.com>
Co-authored-by: avrtpro <232434109+avrtpro@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AVRT firewall logic for voice input handling Implement AVRT™ Firewall - Trauma-Informed AI Middleware with SPIEL™ and THT™ Protocols Nov 23, 2025
Copilot AI requested a review from avrtpro November 23, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants