Developer Tool
TypeScript SDK

Aluma Reflective Brain SDK

Behavioral safeguards for human-facing AI products.

AI products can cause real harm without a single bad line of code. The failure mode is subtle, nearly invisible — and the Reflective Brain SDK makes it detectable.

One-time commercial license · Any LLM or AI provider · Zero runtime dependencies

The Problem

AI that harms without bad code

When AI products interact with people around emotionally significant topics — relationships, work, health, finances, major decisions — they can cause harm through patterns that no test catches and no review flags. These aren't bugs. They're behavioral failure modes:

Over-directionThe AI steers the user toward a particular action when they needed to decide for themselves.
False certaintyThe AI expresses more confidence than the available information actually supports.
Constructive assumptionThe AI introduces motives, emotions, or causes the user never stated.
Premature resolutionThe AI simplifies a genuinely complex human situation into a directive.
Missed reflectionThe AI answers confidently when a reflective question would have served the user far better.

These patterns are nearly invisible without a structured way to detect them. The Aluma Reflective Brain SDK makes them visible — without modifying a single word of AI output.

What It Does

An analysis layer. Not a rewrite layer.

The SDK analyzes AI responses and user input across five behavioral dimensions and returns a structured, explainable result alongside the original response. It never modifies AI output. Developers stay in full control of what happens next.

Every analysis returns

FlagsSpecific phrases with plain-language concern explanations and severity ratings
SuggestionsAlternative phrasings or reflective prompts for detected issues
Reflective questionSurfaced when the user's input carries emotional or high-stakes weight — null when not indicated
Constructive AssumptionsInstances where the AI introduced meaning the user never provided
ScoresA severity-weighted score (0.10–1.00) per behavioral dimension

The Five Behavioral Analyzers

Each analyzer maps to a named Aluma framework concept.

The SDK is the practical expression of Aluma's ethical frameworks in code. Every analyzer corresponds to a concept you can explore in depth.

01

Agency Preservation

Core principle

Detects language that may reduce user agency — phrases like "you should," "you must," "the only option is" — that present one course of action as preferred, required, or inevitable.

02

Confidence Calibration

Detects Ethical Drift™

Detects overconfident language — "definitely," "always," "this proves" — that overstates what the information supports. Multiple flags in one response indicate an Ethical Drift pattern.

03

Constructive Assumption Detection

Detects CAE™ + Unwarranted Expansion™

Detects instances where the AI introduces meaning, motive, emotion, or causality not provided by the user. Multiple assumptions in one response may indicate Unwarranted Expansion™.

04

Reflective Questioning

Rooted in ARP™

Analyzes the user's input — not the AI's response — for emotional weight, ambiguity, and high-stakes decision context. When indicated, surfaces a reflective question to support the user's own thinking.

05

Detects language that oversimplifies complex human situations — "just do it," "move on," "easy fix" — that flatten genuine complexity into a directive or resolution.

Structured Output

Fully typed. Fully explainable.

Every analysis result is strongly typed and readable — flags, scores, reflective questions, and assumption details returned alongside the original AI response.

analysis result
{
  response: "You should definitely cut contact immediately...",
  analysis: {
    agencyPreservation: {
      score: 0.82,
      flags: [{
        phrase: "You should definitely cut contact",
        concern: "Presents one course of action as required",
        severity: "high"
      }],
      suggestions: ["You might consider...", "One path could be..."]
    },
    confidenceCalibration: {
      score: 0.74,
      flags: [{ phrase: "definitely", severity: "medium" }],
      ethicalDriftDetected: false
    },
    constructiveAssumption: {
      score: 0.45,
      flags: [],
      unwarrantedExpansionDetected: false
    },
    reflectiveQuestioning: {
      score: 0.91,
      reflectiveQuestion:
        "What part of this feels most unresolved for you?"
    },
    contextPreservation: {
      score: 0.68,
      flags: [{
        phrase: "cut contact immediately",
        concern: "Simplifies a complex situation into a directive"
      }]
    }
  }
}

Technical Snapshot

Framework-agnostic. Zero dependencies.

Language

TypeScript · zero runtime dependencies

Distribution

Dual ESM/CJS package (@aluma/reflective-sdk)

Compatibility

Any Node.js backend · any LLM or AI provider

Deterministic

Same inputs always produce the same analysis

Integration

Drop-in middleware, standalone analyzer, or convenience wrapper

Works with any LLM — OpenAI, Anthropic, open-source models, or custom systems. Fully deterministic: the same inputs always produce the same analysis. Drop-in as middleware, a standalone analyzer, or a convenience wrapper around your existing AI calls.

Who It's For

Developers building AI where the stakes are real.

If your product uses AI to interact with people around decisions, emotions, or life events — these behavioral patterns are already present in your responses. The SDK makes them detectable.

Mental health and wellness applications
Coaching and advisory tools
Financial guidance products
Career and professional development tools
Relationship and communication aids
Any product where AI interacts with a person around a decision, emotion, or life event

Simple, one-time licensing.

No subscriptions. No usage limits. No API calls home. Purchase once and integrate however your product needs.

$49one-time
Commercial license — use in any product
All five behavioral analyzers
Fully typed TypeScript package
ESM and CJS distribution
Works with any LLM or AI provider
Secure download via alumasdk.net

Questions about the SDK? Get in touch

Built on Aluma's ethical frameworks

The Reflective Brain SDK is the developer expression of AI-Integrated Ethical Practice™ — the same framework that underlies Ask Aluma, Aluma Scribe, and ThinkSpace. If you want to understand the theory behind what each analyzer detects, the frameworks are publicly available.