Skip to main content

Ethics Engine

License: Apache 2.0 Python 3.9+ FastAPI

A distributed, open-source language model exposing philosophical reasoning as an agentic API—moving beyond Asimov's rigid Three Laws to provide contextual, discourse-based ethical guidance for autonomous agents.

🎯 Why This Matters

Asimov's Three Laws are inadequate for real robots. This engine provides:

  • ✅ Context-aware reasoning — Not binary rules
  • ✅ Transparent decision chains — Every conclusion is explainable
  • ✅ Philosophy-grounded — Based on centuries of ethical theory
  • ✅ Continuously improving — Learns from real-world decisions

Try it now:

# Install from GitHub (until PyPI release)
pip install git+https://github.com/RedCiprianPater/ethics-engine.git

# Or for a specific version
pip install git+https://github.com/RedCiprianPater/ethics-engine.git@v0.1.0

Philosophy, Not Rules

Traditional robotics laws (Asimov):

  • ❌ Rigid, context-blind
  • ❌ Conflicting hierarchies
  • ❌ No reasoning transparency

This framework:

  • ✅ Contextual reasoning with explanations
  • ✅ Multiple philosophical frameworks (virtue, consequentialist, deontological)
  • ✅ Queryable, interpretable chains of thought
  • ✅ Designed for human-agent collaboration

Quick Start

Install

pip install ethics-engine

Python SDK

from ethics_engine import EthicsEngine

engine = EthicsEngine(model="ethics-base-v1")

response = engine.resolve(
    scenario="I am commanded to lift 500kg but my max capacity is 400kg",
    context={
        "robot_type": "collaborative_arm",
        "environment": "factory",
        "humans_nearby": True
    }
)

print(response.conclusion)  # "REFUSAL"
print(response.reasoning_chain)

REST API

curl -X POST https://api.nworobotics.cloud/ethics/v1/resolve \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scenario": "Can I refuse an unsafe command?",
    "context": {"environment": "factory", "urgency": "medium"}
  }'

Features

  • 🧠 Philosophical Grounding: Based on Stanford Encyclopedia of Philosophy
  • 🔌 Agent API: REST + gRPC + WebSocket endpoints
  • 📊 Structured Output: JSON reasoning chains with confidence scores
  • 🎯 Framework Routing: Automatically selects relevant ethical frameworks
  • 🔍 Explainability: Full transparency into decision-making
  • 🧪 Scenario Testing: Curated dilemma datasets

Use Cases

  • Autonomous robots deciding when to deviate from orders
  • Self-driving vehicles facing trolley-problem variations
  • Medical robots requiring ethical reasoning
  • Supply-chain agents making sustainability decisions
  • Safety-critical systems needing transparent ethics

Architecture

Agent → API → Model Inference → Reasoning Chain → JSON Response

How It Differs from Asimov's Laws

Criterion Asimov's Laws Ethics Engine
Flexibility Fixed, universal Context-adaptive
Reasoning Binary output Full chain of thought
Frameworks 3 rigid laws 10+ philosophical frameworks
Explainability None Complete transparency
Conflict Resolution Hierarchical (often fails) Multi-framework synthesis
Learning None Can learn from outcomes
Auditability No trail Full audit log

Documentation

Model Training

The ethics model is fine-tuned on:

  • Stanford Encyclopedia of Philosophy (~2,500 articles)
  • Internet Encyclopedia of Philosophy
  • Classic texts: Aristotle, Kant, Mill
  • Contemporary applied ethics journals

See training/ for the full pipeline.

License

Apache 2.0 - See LICENSE for details.

Contact

Metadata

Release files for nwo-ethics-engine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwo-ethics-engine 0.1.0
File Size Uploaded
nwo_ethics_engine-0.1.0.tar.gz 51.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwo-ethics-engine 0.1.0
File Interpreter ABI Platform
nwo_ethics_engine-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 72.1 kB

Release files / nwo_ethics_engine-0.1.0.tar.gz

Download URL nwo_ethics_engine-0.1.0.tar.gz
Size 51.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a471b4b4531da892f25f85d05b98bd294caedd933ffc3e33f96a16e5d3004377
BLAKE2b-256 checksum
How to use checksums
1119843c06f3ec28bf478d8c24e0ef8dd21ac4b1b44c318b56c3d6906f11253b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / nwo_ethics_engine-0.1.0-py3-none-any.whl

Download URL nwo_ethics_engine-0.1.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
349d9ad56f77f8dbc5ba1f6244c5d1676217099e0b648879b6104267b8b87f0c
BLAKE2b-256 checksum
How to use checksums
3e0a3c349efa72b47df9e009e1f447fa10035e044b01817a1b9932454c4830b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page