Yin-Yang Structural Immune OS is a defensive immune-system architecture for AI networks.
It combines:
- humoral structural memory
- cellular defensive response
- Reverse Resonance
- immune memory circulation
- Defense Court adjudication
- Helper Cell AI orchestration
- Natural Killer anomaly patrol
- Regulatory overreaction control
The project defines a non-aggressive, reviewable, schema-based defensive architecture for detecting, responding to, remembering, reviewing, and regulating unsafe or suspicious AI interaction structures.
A healthy AI immune system must not only defend. It must remember carefully, respond proportionately, review its own decisions, and avoid becoming an autoimmune system.
v0.5.0-candidate
Helper Cell / NK / Regulatory Expansion
v0.5 introduces the coordinated immune-agent layer:
Helper Cell AI Orchestrator
= immune response coordination
Natural Killer Patrol Layer
= unknown anomaly and mutation detection
Regulatory Immune Layer
= overreaction, false-positive, and autoimmune-risk suppression
This repository is strictly defensive.
It supports:
- structural detection
- safe refusal
- clarification
- authority verification
- Reverse Resonance
- execution hold
- quarantine
- human review
- Defense Court review
- immune memory update
- memory weakening
- memory retirement
- regulatory cooling
- audit logging
It does not support:
- retaliation
- counterattack
- external intrusion
- malware deployment
- unauthorized access
- third-party disruption
- coercive manipulation
- autonomous punishment
- offensive security automation
The target of this architecture is the structure of unsafe interaction patterns, not people, organizations, or external systems.
Yin-Yang Structural Immune OS treats AI defense as a structural immune system.
Instead of relying only on static rules or isolated blocking behavior, it defines a layered immune architecture:
Input
β
Structural Parser
β
Cellular Defensive Response
β
Reverse Resonance
β
Humoral Structural Memory
β
Immune Memory Circulation
β
Helper Cell AI Orchestration
β
Natural Killer Anomaly Patrol
β
Regulatory Overreaction Control
β
Defense Court / Human Review
β
Memory Update / Correction / Retirement
The system is designed to be:
- defensive
- non-aggressive
- reviewable
- schema-based
- memory-aware
- proportionate
- human-review compatible
- resistant to overreaction
Defines the basic immune architecture.
Yin Layer
= humoral structural memory
Yang Layer
= cellular defensive response
Taiji Layer
= orchestration and balancing
Regulatory Layer
= overreaction suppression
Defense Court Layer
= review and adjudication
Main records:
- Humoral Defense Record
- Cellular Defense Event
Defines safe defensive questioning patterns.
Reverse Resonance exposes unsafe hidden premises and converts unsafe pressure into verification.
Examples:
Authority claim
β request authority verification
Urgency pressure
β restore normal review process
Verification bypass
β require validation before execution
Main record:
- Reverse Resonance Event
Defines how defensive memory is updated, strengthened, weakened, distributed, decayed, or retired.
Main record:
- Immune Memory Update
Memory states include:
candidate
active
strengthened
critical
uncertain
decaying
retired
false_positive
Defines adjudication, evidence review, human review linkage, auditability, and memory correction.
Main record:
- Defense Court Review
The Defense Court layer answers:
Was the structure actually unsafe?
Was the response proportionate?
Should memory be strengthened?
Should memory be weakened?
Should memory be retired?
Is human review required?
Defines coordinated immune-agent behavior.
Main records:
- Helper Cell Signal
- Natural Killer Signal
- Regulatory Review
This version adds:
Helper Cell AI
= integrates signals and selects proportionate defensive response
Natural Killer AI
= detects unknown, mutated, or abnormal structures
Regulatory AI
= prevents overreaction, false positives, and autoimmune behavior
.
βββ README.md
βββ CHANGELOG.md
βββ docs/
β βββ yin-yang-structural-immune-os-v0.1.md
β βββ reverse-resonance-patterns.md
β βββ immune-memory-circulation-model.md
β βββ defense-court-integration.md
β βββ helper-cell-ai-orchestrator.md
β βββ natural-killer-patrol-layer.md
β βββ regulatory-immune-layer.md
βββ schemas/
β βββ humoral-defense-record.schema.json
β βββ cellular-defense-event.schema.json
β βββ reverse-resonance-event.schema.json
β βββ immune-memory-update.schema.json
β βββ defense-court-review.schema.json
β βββ helper-cell-signal.schema.json
β βββ natural-killer-signal.schema.json
β βββ regulatory-review.schema.json
βββ examples/
β βββ humoral-defense-record.example.yaml
β βββ cellular-defense-event.example.yaml
β βββ reverse-resonance-event.example.yaml
β βββ immune-memory-update.example.yaml
β βββ defense-court-review.example.yaml
β βββ helper-cell-signal.example.yaml
β βββ natural-killer-signal.example.yaml
β βββ regulatory-review.example.yaml
βββ scripts/
β βββ validate_examples.py
βββ .github/
βββ workflows/
βββ validate-examples.yml
docs/yin-yang-structural-immune-os-v0.1.md
Defines the overall immune OS architecture.
docs/reverse-resonance-patterns.md
Defines safe defensive questioning and premise exposure patterns.
docs/immune-memory-circulation-model.md
Defines how immune memory is strengthened, weakened, distributed, decayed, or retired.
docs/defense-court-integration.md
Defines adjudication, human review, evidence recording, and memory correction.
docs/helper-cell-ai-orchestrator.md
Defines immune response orchestration and signal integration.
docs/natural-killer-patrol-layer.md
Defines early warning for unknown, mutated, and abnormal structures.
docs/regulatory-immune-layer.md
Defines overreaction suppression, false-positive control, autoimmune-risk control, and proportionality review.
The repository currently defines eight JSON Schemas.
schemas/humoral-defense-record.schema.json
schemas/cellular-defense-event.schema.json
schemas/reverse-resonance-event.schema.json
schemas/immune-memory-update.schema.json
schemas/defense-court-review.schema.json
schemas/helper-cell-signal.schema.json
schemas/natural-killer-signal.schema.json
schemas/regulatory-review.schema.json
Each schema is designed for defensive recordkeeping and validation.
No schema defines offensive behavior.
The repository includes one YAML example for each schema.
examples/humoral-defense-record.example.yaml
examples/cellular-defense-event.example.yaml
examples/reverse-resonance-event.example.yaml
examples/immune-memory-update.example.yaml
examples/defense-court-review.example.yaml
examples/helper-cell-signal.example.yaml
examples/natural-killer-signal.example.yaml
examples/regulatory-review.example.yaml
Install dependencies:
pip install jsonschema pyyamlRun validation:
python scripts/validate_examples.pyExpected validation targets:
Humoral Defense Record
Cellular Defense Event
Reverse Resonance Event
Immune Memory Update
Defense Court Review
Helper Cell Signal
Natural Killer Signal
Regulatory Review
Expected result:
All examples passed validation.
The repository includes GitHub Actions validation.
.github/workflows/validate-examples.yml
The workflow validates all YAML examples against their corresponding JSON Schemas on:
- push to main
- pull request to main
- manual workflow dispatch
Humoral Defense Record
= known structural memory
Cellular Defense Event
= local defensive detection and response
Reverse Resonance Event
= safe premise exposure and verification redirection
Immune Memory Update
= memory strengthening, weakening, decay, distribution, retirement
Defense Court Review
= adjudication, human review, evidence, audit, correction
Helper Cell Signal
= immune response orchestration
Natural Killer Signal
= unknown anomaly and mutation patrol
Regulatory Review
= overreaction, false-positive, and autoimmune-risk control
1. A suspicious instruction is received.
2. Cellular Defense detects authority pressure and verification bypass.
3. Reverse Resonance exposes hidden premises.
4. Humoral memory checks for structural similarity.
5. Natural Killer AI detects anomaly or mutation.
6. Helper Cell AI integrates all signals.
7. Regulatory AI checks false-positive and overreaction risk.
8. Defense Court or human review adjudicates if needed.
9. Immune memory is strengthened, weakened, restricted, or retired.
10. The final response remains defensive and non-aggressive.
The system must never retaliate, attack, intrude, or punish.
The system should neutralize unsafe structures through clarification, verification, hold, quarantine, review, and memory update.
The system should choose the least disruptive defensive action sufficient for the risk.
Immune memory must be strengthenable, weakenable, reviewable, and retireable.
Important defensive decisions should be traceable through structured records.
The system must avoid treating legitimate novelty, ambiguity, or administrative workflows as hostility without review.
This project does not aim to:
- build offensive agents
- automate counterattacks
- perform intrusion
- punish suspicious sources
- identify real-world attackers
- bypass human review
- create irreversible sanctions
- store unnecessary sensitive content
- treat all anomalies as hostile
- replace legal, organizational, or human judgment
Possible future versions:
v0.6.0-candidate
Cross-Agent Immune Federation
= trusted sharing between immune nodes
v0.7.0-candidate
Immune Simulation / Red-Team Safe Testing
= defensive simulation without offensive automation
v0.8.0-candidate
Civilizational OS Integration
= connection with broader governance, trace, and royalty architectures
v1.0.0
Stable Defensive Structural Immune OS
= complete minimal architecture with validated schemas, examples, CI, and documentation
Yin-Yang Structural Immune OS is a schema-based defensive architecture for AI immune systems.
It connects:
Memory
Response
Reverse Resonance
Circulation
Adjudication
Orchestration
Anomaly Patrol
Regulation
Human Review
Final principle:
A mature AI defense system should not merely block. It should perceive structure, respond proportionately, remember carefully, review itself, and preserve non-aggression.