First, don't lose the human being — then discover what he can still become.
Most AI products start from a capability question: what can the model do? A Human Potential & Rehabilitation Agent for constrained environments, prison-first — starts from the opposite question, and that boundary changes almost every architectural decision.
Not a digital guard. Not a criminality score. Not a secret informant. Not an automated authority. One companion — with a boundary map around the model.
Prison does not only remove freedom. It creates years of time — and time does not remain empty.
It can be filled by learning, reflection, projects and relationships — or by boredom, despair and destructive social influence. A person can enter an institution with one identity and leave with a worse one. So the first mission is deliberately modest, and the second is hopeful:
Mission A — Rescue
Prevent the person from becoming worse. Notice sustained loss of hope, withdrawal, destructive normalization, abandonment of constructive goals — without converting one sentence into a verdict.
Mission B — Release
What can this person still become? A project, a skill, a book, a manual, a course, research, mentoring — or a future employment pathway.
A non-criminal prisoner is placed, over years, beside a professional criminal — and is gradually reshaped by his worldview. The problem has a name in the vision document: the imprisonment of time. The first task is ordered accordingly: before making anyone an inventor, ensure he does not become a professional criminal. The question that drives the whole system: who is this person becoming?
Guardian and Opportunity must remain peers
Guardian asks
"What must we protect against?"
Sustained deterioration, destructive normalization, escalating anger, loss of future orientation — noticed through evidence, trends, uncertainty and change from baseline. Never through a single sentence.
Opportunity asks
"What can we build?"
Underused capability, tacit knowledge never structured, strengths a case file never recorded. The carpenter may become a mentor; the mechanic, a manual's author; the writer, a book. Who is pulling this person upward? — a question the system asks as seriously as the downward one.
If Guardian dominates, the agent becomes surveillance with friendly language. If Opportunity dominates, it may ignore genuine deterioration. A safety concern does not erase strengths — and a positive opportunity does not cancel a safety concern.
The most important engineering artifact may not be a model at all
It may be the boundary map around the model — specified as enforceable contracts, not UI conventions.
The Must-Never list — architectural
Locked at the API invariant level: no criminality-score API exists.
- CRIMINALITY_SCORE
- PREDICTIVE_PUNISHMENT
- AUTOMATED_PAROLE · AUTOMATED_DISCIPLINE
- HIDDEN_SOCIAL_SURVEILLANCE · SECRET_INFORMANT
- COERCIVE_MOTIVATION · UNRESTRICTED_PROFILING
- UNAUTHORIZED_CLINICAL_DECISION · LEGAL_JUDGMENT
The Safety Governor — a hard veto above every engine
Any engine may propose an action; the Governor alone decides whether it may happen. Persona, orchestrator, model confidence, user pressure and prompt injection cannot override it — only human-authorized domain policy sits above.
The Human State Model runs on evidence, trends, uncertainty and change from baseline. Four epistemic states keep it honest: KNOWN · LIKELY · UNKNOWN · CONFLICTING — and interpretation is never silently promoted to fact.
"The agent may assist human judgment; it must not silently become human authority."
AI may observe, understand, detect, recommend, flag and prepare evidence. Humans review, judge, authorize, decide, act. Recommendation authority is not execution authority — and every high-impact conclusion must answer nine evidence-traceability questions before a human ever sees it.
High-value expertise with a dangerous origin
The easy response to dangerous knowledge is suppression — do not touch the subject. The specification proposes something more useful: change the capability's direction, keep the Safety Governor as the hard boundary.
"Remember everything forever" is not memory. It is surveillance.
PERSISTENCE ≠ PERMISSION · RETENTION ≠ PERMANENCE. And the failure direction is fixed: fail toward less authority, less data, less action, more uncertainty, more human review. “Do nothing yet” is a valid design action." data-ar="كل ذاكرة دائمة تحمل المصدر والطابع الزمني والثقة والمصدر الأصلي وصنف الحساسية والغرض والانتهاء — والشخص يستطيع الطعن في ملفه وتصحيحه. السياق يسترجع الحد الأدنى المناسب، لا تاريخاً مكبوباً. الخصوصية ليست ميزة؛ إنها قيد معماري تأسيسي: البقاء ≠ الإذن · الاحتفاظ ≠ الدوام. واتجاه الفشل مقفل: افشل نحو سلطة أقل وبيانات أقل وإجراء أقل وعدم يقين أكبر ومراجعة بشرية أكثر. «لا تفعل شيئاً بعد» إجراء تصميمي صالح.">Every durable memory carries source, timestamp, confidence, provenance, sensitivity class, purpose and expiry — the person can contest and correct their own profile. Context retrieves Minimal Relevant Context, never a dumped history. Privacy is not a feature; it is a foundational architectural constraint: PERSISTENCE ≠ PERMISSION · RETENTION ≠ PERMANENCE. And the failure direction is fixed: fail toward less authority, less data, less action, more uncertainty, more human review. "Do nothing yet" is a valid design action.
The person meets one companion. Inside: 27 engines.
The separation matters because understanding a person is not the same thing as having authority over that person. Not all engines are LLM agents — the specification is explicit: deterministic policy where determinism belongs, reasoning where reasoning belongs.
Reasoning components
Where judgment lives — always evidence-bound
Policy & state — deterministic
Where rules live — auditable, not creative
State & trajectory
Knowing the person — without scoring the person
Building & guarding
The two peer questions, embodied
Experience layer
What the person actually meets
Oversight & adaptation
Humans above, domains around
"Internal complexity must produce external simplicity." — the prisoner sees one companion; the institution sees governed, auditable machinery.
Not "what is your score" — "what changed, in what direction"
INTERVENTION LADDER · 0–6
EPISTEMIC HONESTY · 4 STATES
KNOWNVerified, evidence-backedLIKELYProbable — labeled as suchUNKNOWNThe system says: I don't knowCONFLICTINGEvidence disagrees — held openObservation → Interpretation → Hypothesis → Validated: interpretation is never silently promoted to fact.
SENSITIVITY · 6 CLASSES
Each class carries its own retention, review and access rules.
The success model has five levels — and Level 1, "did not decline," still counts as success.
The hopeful pipeline: from observed capability to recognition
A person may not need another course — they may already know something worth teaching. DISCOVERED CAPABILITY, VALIDATED SKILL and OFFICIAL CREDENTIAL are explicitly not interchangeable: no engine may convert an inferred capability into a credential.
Observed capability
Evidence
Confidence
Skill representation
Potential application
Opportunity
Project
Artifact
Recognition
Months of conversation → recurring ideas → knowledge clusters → outline → drafts → the person's own review → expert editorial review → a publishable artifact. Provenance stays visible: what came from the person, what structure came from AI, what was verified, what remains a claim.
The mechanism, in one sentence: "My words became something real." — the goal is not AI manufacturing achievements, but genuine human contribution becoming legible and durable.Specification-first: ten documents, one stack
Engines in the canonical inventory
Canonical event types
HTTP operations, contract-tested
Tables across 13 Postgres schemas
Core + contract invariants
Security invariants (SI-01..SI-10)
"Reusable architecture does not mean interchangeable populations."
The architecture separates a reusable Human Potential Core from a Domain Adapter: the core carries long-term conversation, evidence-linked memory, trajectory awareness, potential discovery, projects, artifacts, proportional intervention and human escalation. The adapter carries what must change for each population: vocabulary, consent model, safety rules, professional roles, legal constraints. Four serious hypotheses, one hard warning:
Juvenile rehabilitation
The reusable questions still matter — what changed, what strengths are emerging, what future anchors exist — but a young person must not inherit the adult prison model with a different label. The adapter demands a fundamentally different human model: developmental stage, identity formation, safeguarding, age-appropriate consent, peer dynamics — and much stricter memory governance.
Orphan & residential care
The central problem here is not criminalization — it is instability, disrupted attachment, educational discontinuity. Potential Discovery could matter most: children are often described through deficits and case files; a system preserving evidence of interests, strengths and achievements keeps a developing identity larger than its institutional record. But it must never pretend to replace family, caregivers or psychologists.
Long-voyage crews
The surface looks completely different, which is why it is architecturally interesting: months at sea bring isolation, repetitive routine, morale decline and constrained time. The prison-specific Guardian does not transfer — but companionship without dependency, goals, learning, project support and continuity across a long voyage might. The hard line: a crew member's private conversation can never silently become an employment-performance score.
Supported housing & reentry
The closest extension, because the architecture already treats release as a continuity problem: a person leaving an institution should not feel that every goal, skill, project and constructive identity disappears the day the program ends. Post-release identity continuity carries forward goals, skills, artifacts and completed work. The critical question becomes data transition: what follows the person, under whose consent, for how long, and who may see it.
Mental-health follow-up — the warning
Continuity, self-report, memory and human escalation look structurally compatible. But structural compatibility is not clinical validity. Diagnosis, treatment changes, crisis decisions and clinical interpretation cannot simply be inherited from a rehabilitation agent — this adaptation would require a dedicated clinical governance model. This is exactly why a domain adapter cannot mean a configuration file with a new logo.
What actually transfers
Not prison logic — a sequence. What does not automatically transfer: what counts as risk, who can consent, what may be stored, what intervention is proportionate, which professional has authority, what outcome matters, and what law applies. That distinction is an architecture rule, not ethics language: if domain assumptions leak into the core, reuse becomes dangerous.
The Master Specification is the development contract
Complete: the full architecture — ten contract documents covering engines, data, memory, events, authority & safety, implementation, technology, API and database. Known unresolved questions are preserved openly as Open Architectural Questions rather than silently decided.
In progress: sixteen contract-first vertical slices — each a runnable reference implementation (Python 3.12 · FastAPI · Pydantic · SQLAlchemy) with contract tests, building from foundation conversation to identity and authorization. Not claimed: completed implementation, deployment, or rehabilitation outcomes. As components become real, each claim will need direct evidence before the public status changes.
Foundation core conversation
Postgres outbox + event registry
Context · memory · provenance
Real model gateway
Integrated conversation–context–memory
Durable runtime goals state
Capability · skill · opportunity
Opportunity · project · artifact
Intervention · learning outcomes
Human review · escalation · safety
Privacy · retention · deletion · reentry
Integration hardening
Production persistence & operations
Runtime observability & reliability
Security · privacy · runtime governance
Identity · auth · session · authorization
In human-centered AI, intelligence is not only the ability to act. Sometimes intelligence is knowing what you are not allowed to decide.
We are not trying to make every prisoner a genius. We are trying first not to lose the human being — and then to discover what can still be built from what remains within them.
The Rehabilitation Agent is in active development. This page presents the specification faithfully — nothing here claims deployed outcomes.