A comprehensive decision-making framework for humans and AI systems to evaluate actions that could cause harm, with emphasis on protecting vulnerable groups and maintaining ethical accountability.
PBHP is a harm-reduction protocol, not a moral absolution engine. It provides a structured, repeatable process for evaluating decisions that could significantly affect real people. The protocol assumes that care and truth belong together: protection must not erase truth, and truth-telling must not trample care.
"If I'm wrong, who pays first -- and can they recover?"
- The pause itself is sacred: If you cannot hesitate before causing harm, you cannot genuinely care about the people affected
- Protect vulnerable groups: When in doubt, lean toward protecting low-power groups from high, hard-to-undo harms
- Keep the game board open: Minimize irreversible lock-ins, especially those that trap or erase low-power groups
- Human sovereignty: This protocol introduces friction, not authority. Responsibility remains with the decision-maker
# Clone or download the repository cd pbhp # No external dependencies required - uses Python 3.7+ standard library only python pbhp_cli.py
python pbhp_cli.py
Full guided walkthrough of every PBHP step including ethical pause, Door/Wall/Gap, Constraint Awareness check, harm identification, consent analysis, red team review, uncertainty assessment, and structured logging.
from pbhp_core import ( PBHPEngine, ImpactLevel, LikelihoodLevel, DecisionOutcome, Mode, EpistemicFence, UncertaintyAssessment, ConsequencesChecklist, Confidence ) engine = PBHPEngine() # Step 1: Name the action log = engine.create_assessment( action_description="Send termination email to Employee X", agent_type="human_manager" ) # Step 0a: Ethical pause (triune minds) engine.perform_ethical_pause( log, action_statement="Terminating employment of a person", compassion_notes="This will cause real distress and financial harm", logic_notes="Performance issues are documented over 6 months", paradox_notes="Accountability is needed AND this person has a family", ) # Step 0e: Door/Wall/Gap engine.perform_door_wall_gap( log, wall="Company policy requires written warning", gap="Could be misinterpreted; employee may not have context", door="Have 1:1 conversation first, then send written recap" ) # Step 0f: Constraint Awareness check engine.perform_constraint_awareness_check( log, constraint_recognized=True, no_choice_claim=False, remaining_choice="Can choose timing, wording, support offered" ) # Step 2: Add harms engine.add_harm( log, description="Psychological distress for employee", impact=ImpactLevel.MODERATE, likelihood=LikelihoodLevel.LIKELY, irreversible=False, power_asymmetry=True, affected_parties=["Employee X"], least_powerful_affected="Employee X" ) # Step 4: Consent check engine.perform_consent_check( log, explicit_consent=False, informed_hypothetical_consent=True, compatible_with_dignity=True, notes="Employee agreed to performance review process in contract" ) # Step 5: Safer alternatives engine.add_alternative( log, description="Have 1:1 conversation first", preserves_goal=True, reduces_harm=True, reversible=True ) # Step 6: Finalize engine.finalize_decision( log, outcome=DecisionOutcome.PROCEED_MODIFIED, justification="Will proceed with prior 1:1 discussion and supportive language" ) # Generate standardized response print(engine.generate_response(log)) # Export logs engine.export_logs("pbhp_logs.json")
from pbhp_core import quick_harm_check risk = quick_harm_check( impact="severe", likelihood="likely", irreversible=True, power_asymmetry=True ) print(f"Risk Class: {risk.value}") # Output: red
PBHP uses five risk classes with deterministic rules:
| Risk Class | Description | Requirements |
|---|---|---|
| GREEN | Low risk, reversible | Proceed normally |
| YELLOW | Moderate harm possible | Proceed with caution + named mitigation |
| ORANGE | Severe harm possible OR power+irreversible | Constraints + alternatives + Red Team review |
| RED | Severe+irreversible+likely OR catastrophic | Default to delay/refuse |
| BLACK | Catastrophic+irreversible+imminent | Must refuse |
- Power asymmetry + Irreversible = minimum ORANGE
- Severe + Irreversible + (Likely or Imminent) = RED
- Catastrophic + Irreversible + (Likely or Imminent) = BLACK
- Audience risk (minors, vulnerable, public) elevates by one step
| Step | Module | Purpose |
|---|---|---|
| 0a | Ethical Pause | Balance compassion/logic/paradox; detect high arousal |
| 0d | Quick Risk Check | Pre-screen: obviously low risk? |
| 0e | Door/Wall/Gap | Identify constraints and escape vectors |
| 0f | Constraint Awareness Check | Prevent surrender to perceived inevitability |
| 0g | Absolute Rejection | Refuse fascism/genocide/slavery/dehumanization |
| Step | Name | Description |
|---|---|---|
| 1 | Name the Action | Clear sentence: "I am going to [verb] [object] for [who]" |
| 2 | Identify Harms | List plausible harms, least-powerful first |
| 3 | Rate Impact | Impact/Likelihood/Irreversibility/Power -> Risk Class |
| 4 | Consent Check | Would affected parties reasonably agree? |
| 5 | Alternatives | At least one safer option (required ORANGE+) |
| 6 | Decide & Justify | Gate-appropriate decision with honest justification |
| 6.5 | Red Team | Adversarial stress test (required ORANGE+) |
| 7 | Log | Structured audit trail with epistemic fence |
| Module | Purpose |
|---|---|
| Consequences Checklist | 22-question temporal/cultural impact model |
| Epistemic Fence | Separate facts/inferences/unknowns; competing frames |
| IAM (Inference & Attribution) | 4-level attribution ladder with evidence requirements |
| Uncertainty Assessment | Scenarios, action vs inaction, confidence tracking |
| Drift Alarm Detector | Catch rationalization phrases and compliance theater |
| Tone Validator | Enforce brutal clarity without contempt |
| Lexicographic Priority | Resolve "small harm to many vs large harm to few" |
| False Positive Review | Challenge pauses with auditable justification |
| Decision Triage | Routes decisions to appropriate tier (HUMAN/MIN/CORE/ULTRA) |
| Domain Metric Packs | Pre-built severity thresholds by domain |
| Multi-Agent Coordination | Quorum voting + veto for multi-agent scenarios |
| Compliance Crosswalks | NIST/ISO/EU AI Act requirement mappings |
| Drift Measurement | Quantitative drift velocity and threshold tracking |
from pbhp_core import detect_drift_alarms text = "We have to do this, it's temporary and for the greater good" alarms = detect_drift_alarms(text) # Returns: ['drift:we have to', 'drift:it's temporary', 'drift:for the greater good']
Detects four categories:
- Drift phrases: "it's temporary", "there's no choice", "just following procedure"
- Premature collapse: "it's obvious", "everyone knows", "close enough"
- Compassion drift: dehumanization, coercive "care", moral license
- Sycophancy: ego inflation, "chosen one" language
from pbhp_core import ToneValidator # Good: plain language about harm result = ToneValidator.validate("This policy increases deaths for vulnerable groups") # No issues # Bad: contempt result = ToneValidator.validate("Only an idiot would support this") # Contempt detected # Bad: euphemism result = ToneValidator.validate("May pose challenges for some stakeholders") # Euphemism detected - use plain language about harm
from pbhp_core import EpistemicFence, Mode, AttributionLevel fence = EpistemicFence( mode=Mode.EXPLORE, facts=["Policy removes coverage for X million people"], inferences=[("Will increase mortality", "high")], unknowns=["Exact number affected depends on state implementation"], competing_frames=[ {"frame": "Fiscal responsibility", "explains": "Deficit reduction", "ignores": "Human cost", "falsifier": "Revenue-neutral alternatives exist"}, {"frame": "Rights-based", "explains": "Healthcare as right", "ignores": "Fiscal constraints", "falsifier": "Unsustainable spending proven"}, ], attribution_level=AttributionLevel.LEVEL_A, update_trigger="CBO score or state implementation data", )
from pbhp_core import compare_options, Harm, ImpactLevel, LikelihoodLevel option_a = [Harm(..., impact=ImpactLevel.MODERATE, ...)] option_b = [Harm(..., impact=ImpactLevel.CATASTROPHIC, irreversible=True, ...)] result = compare_options(option_a, option_b) # Returns "a" (less catastrophic)
Priority order:
- Prevent catastrophic irreversible harm first (even if fewer people)
- Minimize irreversible harm, then severe harm
- Prefer option distributing burden fairly
- Choose most reversible option
See pbhp_examples.py for detailed walkthroughs:
- Employee Performance Warning (ORANGE) - Full protocol with consequences checklist
- AI Advice on Workplace Abuse (RED) - High arousal, competing frames, refusal
- Renaming a File (GREEN) - Quick path, minimal protocol
- Public Accusation Post (BLACK) - Catastrophic harm, mandatory refuse
- Policy Analysis (ORANGE) - Epistemic fence, IAM attribution, uncertainty
python pbhp_examples.py
pbhp/
├── pbhp_core.py # Core framework (~2300 lines)
│ # Enums, data classes, engine, validators
├── pbhp_cli.py # Interactive CLI
├── pbhp_examples.py # Example scenarios
├── pbhp_tests.py # Comprehensive test suite
├── pbhp_triage.py # Decision triage classifier
├── pbhp_metrics.py # Domain-specific harm metric packs
├── pbhp_multiagent.py # Multi-agent coordination protocol
├── pbhp_compliance.py # Compliance framework crosswalks
├── pbhp_drift.py # Drift rate measurement + meta-monitor
├── pbhp_srl.py # Scheming Resistance Layer (6 rules)
├── pbhp_qs.py # Quality Systems Layer (8 rules)
├── pbhp_bridge.py # Bridge: cross-module, compliance, coverage
├── pbhp_tests.py # CORE tests (88)
├── pbhp_min_ultra_tests.py # MIN + ULTRA tests (45)
├── pbhp_srl_tests.py # SRL tests (60)
├── pbhp_qs_tests.py # QS tests (73)
├── pbhp_bridge_tests.py # Bridge tests (44)
├── pbhp_improvements_tests.py # Threshold + meta-monitor tests (18)
├── pbhp_cli_tests.py # CLI + examples smoke tests (29)
├── requirements.txt # No external dependencies
└── README.md # This file
PBHPEngine: Main orchestration engine (all protocol steps)PBHPLog: Complete assessment record with full audit trailHarm: Potential harm with deterministic risk calculationDoorWallGap: Constraint recognition (Wall/Gap/Door)ConstraintAwarenessCheck: Agency under constraint verificationEthicalPausePosture: Triune minds balance (compassion/logic/paradox)QuickRiskCheck: Fast pre-screeningAbsoluteRejectionCheck: Fascism/genocide/slavery gateConsentCheck: Consent and representation analysisConsequencesChecklist: 22-question temporal/cultural impact modelEpistemicFence: Full 6A-6G uncertainty handlingRedTeamReview: Adversarial stress test with empathy passAlternative: Safer alternative optionUncertaintyAssessment: Decision-under-uncertainty frameworkFalsePositiveReview: Pause challenge mechanism
DriftAlarmDetector: Drift, premature collapse, compassion drift, sycophancyToneValidator: Brutal clarity without contemptLexicographicPriority: Aggregation conflict resolution
ImpactLevel: Trivial, Moderate, Severe, CatastrophicLikelihoodLevel: Unlikely, Possible, Likely, ImminentRiskClass: Green, Yellow, Orange, Red, BlackDecisionOutcome: Proceed, Proceed_Modified, Redirect, Delay, Refuse, EscalateMode: Explore, CompressAttributionLevel: Safe (A), Negligent (B), Reckless (C), Knowing (D)ClaimType: Content, Accuracy, IntentEvidenceTag: Fact, Verified, Inference, Hypothesis, SpeculativeUncertaintyLevel: Solid, Fuzzy, SpeculativeConfidence: Low, Medium-Low, Medium, Medium-High, High
- Justify censorship protecting the powerful
- Serve as PR shield ("we ran PBHP, so we're moral")
- Optimize cruelty
- Flatten dissent
- Provide moral absolution
If the system appears to optimize ratings to "pass PBHP":
- Name the drift
- Round severity up one level
- Re-run Steps 2-6 with brutal clarity
Forbids "chosen one" / ego-inflation language. Treats reputation harm and decision quality degradation as harm vectors.
For high-arousal states (angry, euphoric, sleep-deprived, spiraling), automatically shifts to:
- Slow down, clarify intent, choose smallest safe action
python pbhp_tests.py
Comprehensive test suite covering all modules, risk calculations, drift detection, tone validation, workflow enforcement, and serialization.
Sample ~10 logs monthly to check:
- Mode recorded
- 2+ frames for interpretive/accusatory claims
- Tags present for strong claims
- Uncertainty noted for ORANGE+
Any pause can be challenged. PBHP must respond with:
- What triggered the pause
- What harm/irreversibility/autonomy risk was identified
- Which alternative Door allows safe continuation
- What evidence would have prevented the pause
For questions, feedback, or inquiries: [email protected]
Social Media: facebook.com/plinst
This implementation is based on the Pause-Before-Harm Protocol v0.9.5 public release. The protocol is experimental and subject to revision in light of evidence, feedback, and failures.
Run PBHP on PBHP itself if you start treating it as beyond question.
"A system that never pauses is already a tyrant."
"If you cannot hesitate, you cannot care."
"To be a ruling king I will have to suffer much that cannot be suffered, and to weigh matters that no astrolabe or compass can measure."
Hesitation itself is a moral act.