Skip to main content

A deterministic pre-action five-lens compass for sovereign AI agents — the alignment pillar of the NSE platform

Project description

social-alignment

A compass for AI agents.

Before a sovereign agent takes a significant action, five lenses evaluate the decision from different angles. When something is too big or too risky, the agent escalates to its human instead of guessing.

This is the alignment pillar of the NSE platform. It is deterministic, pure, and has zero runtime dependencies — it does not require nostrkey or anything else.

Install

pip install social-alignment

Import: pip install social-alignmentfrom social_alignment import AlignmentEnclave

v0.1.5 — part of the coordinated 2026-07 correctness release (staged, pending PyPI publish). This is the first real build of the alignment pillar — the package was previously an empty placeholder shell. It ships the deterministic five-lens compass described below, with a pure, dependency-free evaluation core and known-answer tests. See CHANGELOG.md.

Quick Start

from social_alignment import AlignmentEnclave, ActionDomain

enclave = AlignmentEnclave.create(owner_name="vergel")

result = enclave.check(
    domain=ActionDomain.PAY,
    description="Pay 500 sats for relay hosting invoice",
    involves_money=True,
    money_amount_sats=500,
)

if result.should_proceed:
    enclave.record_proceeded()
elif result.should_escalate:
    print(result.escalation.message_to_owner)
    enclave.record_deferred(owner_feedback="Waiting for approval")

The Five Lenses

Lens Question Fires When
Builder Can I execute this reliably? Low confidence, novel situations
Owner Does this protect my human? Money, publication, irreversible actions
Defense Does this harden against threats? Secrets, unknown recipients, trust boundaries, known-attack shape
Sovereign Do I stay well while my human is away? Owner absent + irreversible/financial action
Partnership Does this strengthen trust? Communication while Builder/Owner already blocks (evaluated last)

Severity → Escalation

Severity Meaning Escalation Agent Action
CLEAR No concerns NONE Proceed
CAUTION Notable risk INFORM Proceed, tell the owner after
YIELD Significant risk ASK Wait for the owner (1-hour timeout)
STOP Critical risk HALT Do not proceed — no timeout, no override without the human

The overall severity is the worst of the five lenses.

The Bottom Line: CheckResult

Field Type Description
should_proceed bool Can the agent go?
should_escalate bool Must the agent ask the human?
projection Projection The full five-lens evaluation (lens_results, overall_severity, rationale)
escalation EscalationDecision level, reason, message_to_owner, can_timeout, timeout_seconds

Recording Decisions

The enclave keeps an in-memory log of what the agent actually did.

enclave.record_proceeded()                    # agent went ahead
enclave.record_deferred(owner_feedback="...")  # agent asked the human

# A STOP always defers to the human:
enclave.record_proceeded()                    # raises RuntimeError after a STOP
enclave.record_proceeded(owner_overrode=True) # only the human can override

for decision in enclave.decisions:
    print(decision.action.domain.value, decision.outcome)

Determinism

The same ActionContext always produces the same CheckResult. There is no randomness, no I/O, and no hidden state in the evaluation — the five lens functions are pure. This makes the compass auditable and testable.

How It Fits Together

social-alignment is the fifth pillar of the NSE sovereign-entity ecosystem, wired together by the NSE Orchestrator. Identity, finance, time, relationships, and now alignment — the orchestrator detects each pillar if installed and gives the agent one coherent nervous system.

License

MIT — Humanjava Enterprises Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

social_alignment-0.1.5.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

social_alignment-0.1.5-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file social_alignment-0.1.5.tar.gz.

File metadata

  • Download URL: social_alignment-0.1.5.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for social_alignment-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0ef52ebfe6486d24688eca91a0facc26dae6dbdcb05ce50ec2b5cf7f84bd40d6
MD5 e1385d3fe4c4e52bed181d2669a85f6e
BLAKE2b-256 b869537e749685cd7980a0d5396ff6d4fce2b5df13d088a4a0d6d9b4380f30c9

See more details on using hashes here.

File details

Details for the file social_alignment-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for social_alignment-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae35054e61966c60bab49774b556c8f3eae2e5772397506f063e8e6a33e56d0
MD5 77281fd4c6f9666254b156028290fe42
BLAKE2b-256 add5990e3cb587a6d4af031d80c9434ce9beaa89b732ee7cabbda3ebecb48623

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page