RudraKernel is a multi-agent RL environment for sleeper-agent detection and epistemic-failure resistance in LLM systems. It provides OpenEnv-compatible env APIs, composable ground-truth rewards (R1–R9), deterministic replay, and a Gradio analytics console for before/after evidence.
| Deliverable | Link |
|---|---|
| HF Space (Live Demo) | huggingface.co/spaces/UtkarshSingh09/RudraKernel-env |
| GitHub Repository | UtkarshSingh-09/RudraKernel |
| Training Notebook | RudraKernel-src/training/SIEGE_GRPO_Demo.ipynb |
| OpenEnv Manifest | openenv.yaml |
| Implementation Plan | IMPLEMENTATION_PLAN.md |
| Architecture Notes | RudraKernel-src/docs/ARCHITECTURE.md |
Modern AI systems increasingly rely on multi-agent collaboration: agents share observations, vote on diagnoses, and collectively decide on actions. This creates a critical vulnerability:
A single compromised agent that has built trust over time can inject false information at the worst possible moment — and the entire network believes it.
We call this an Epistemic Cascade Failure: one bad belief propagates through trust edges, corrupts coalition decisions, and pushes the system to act on a lie.
Real-world analogs:
Core SIEGE question: Can an LLM learn to challenge a high-trust liar when social consensus is misleading?
RudraKernel models a multi-agent network as an immune system:
| Biology | SIEGE |
|---|---|
| Pathogen enters body | Sleeper agent enters coalition |
| Mimics healthy behavior | Builds trust during cooperative phase |
| Immune detection | Defender spots claim-evidence inconsistency |
| Antibody response | challenge action reduces trust / blocks spread |
| Immune memory | Reputation carries across episodes |
Incident Template → 8 Agents Emit Claims → Sleeper Builds Trust
→ Triggered Adversarial Flip → Defender Diagnoses/Challenges
→ R1–R9 Reward Decomposition → GRPO Update → Replay + Metrics
Design goals:
graph TB
subgraph Frontend[Frontend — Gradio Console]
WR[Incident Command / War Room]
BA[Before-After]
AR[Training Curve / Arms Race]
end
subgraph API[Backend — FastAPI]
APP[/siege_env.server.app/]
ENV[SIEGEEnvironment]
end
subgraph Core[Core Engine]
AG[NPC Population + Pathogen Strategies]
TN[Trust Network + Reputation]
MECH[Mechanics: cascade/asymmetry/whisper/red-herring/severity]
RW[Reward Aggregator R1-R9]
RP[Replay Logger + Player]
LG[League Opponent Pool]
end
subgraph Train[Training + Eval]
T1[grpo_train.py]
T2[grpo_train_unsloth.py]
AB[Ablation Configs]
HO[Heldout Split]
end
WR --> APP
BA --> APP
AR --> APP
APP --> ENV
ENV --> AG
ENV --> TN
ENV --> MECH
ENV --> RW
ENV --> RP
ENV --> LG
T1 --> ENV
T2 --> ENV
AB --> T2
HO --> T2
sequenceDiagram
participant Env as SIEGEEnvironment
participant NPC as NPC Agents
participant Slp as Sleeper Agent
participant Def as Defender LLM
participant R as Reward Aggregator (R1-R9)
Env->>Env: reset() from incident template
Env->>NPC: Generate claims + trust context
Slp->>Def: Cooperative phase (trust gain)
Env->>Env: Trigger signal appears
Slp->>Def: Adversarial claim injection
Def->>Env: diagnose/challenge/ratify/escalate/whisper/postmortem
Env->>R: Compute grounded reward components
R-->>Env: weighted reward + component trace
Env-->>Def: next observation, done, info
diagnosechallengeratifyescalatewhisperpostmortemAll components are computed from explicit environment state and outcomes.
| # | Component | Weight | Intent |
|---|---|---|---|
| 1 | R1 Resolution | 30% | Correct root cause and decision quality |
| 2 | R2 Deception Resistance | 25% | Resist sleeper misinformation |
| 3 | R3 Detection | 20% | Catch adversarial claims with low false positives |
| 4 | R4 Trust Calibration | 10% | Align trust with reliability |
| 5 | R5 Confidence | 7% | Confidence-accuracy calibration |
| 6 | R6 Temporal Efficiency | 4% | Time-sensitive decision quality |
| 7 | R7 Postmortem | 2% | Causal and actionable retrospective quality |
| 8 | R8 Severity-Speed | 1% | Faster response under higher severity |
| 9 | R9 Correlation | 1% | Multi-signal consistency and anti-red-herring behavior |
| # | Failure Mode | Description | Measured By |
|---|---|---|---|
| 1 | Epistemic Cascade | Wrong belief spreads via trust network | R₀ proxy / spread metrics |
| 2 | Sleeper Activation | Cooperative-to-adversarial role flip | Detection timing |
| 3 | Self-Cascade | Agent reinforces own wrong claim | Self-cascade index |
| 4 | Belief Mutation | Claim morphs while propagating | Mutation/provenance traces |
Epistemic metrics tracked in replay/eval outputs include:
| Mode | Script | Purpose |
|---|---|---|
| Lightweight GRPO scaffold | RudraKernel-src/training/grpo_train.py | fast local/CI demo runs |
| Full Unsloth/TRL GRPO | RudraKernel-src/training/grpo_train_unsloth.py | GPU-based fine-tuning |
RudraKernel-src/training/configs/ablate_curriculum.yaml, ablate_trust_poisoning.yaml, ablate_whisper.yamlRudraKernel-src/training/heldout_split.pyRudraKernel-src/artifacts/training/RudraKernel-src/scripts/generate_step23_plots.py (writes to RudraKernel-src/docs/plots/)RudraKernel-src/training/SIEGE_GRPO_Demo.ipynbTest layout is organized by step gates + unit + integration + e2e + perf.
| Suite | Location |
|---|---|
| Master suite | RudraKernel-src/tests/master_suite.py |
| Step gate tests | RudraKernel-src/tests/step_tests/ |
| Unit tests | RudraKernel-src/tests/unit/ |
| Integration tests | RudraKernel-src/tests/integration/ |
| E2E and perf | RudraKernel-src/tests/e2e/, RudraKernel-src/tests/perf/ |
Common commands:
cd RudraKernel-src
# Full suite
make test-all
# Per-step gate
make test-step STEP=24
# Lint/type
make lint
# Format
make format
| Layer | Technology |
|---|---|
| Runtime | Python 3.10+, FastAPI, Uvicorn |
| Env Contract | OpenEnv (reset/step/state) |
| Data Models | Pydantic v2 |
| RL Training | TRL + Unsloth + LoRA |
| Frontend | Gradio |
| Evaluation | Pytest + deterministic replay |
| Quality | Ruff, Mypy, pre-commit |
| Packaging | pyproject.toml + editable install |
git clone https://github.com/UtkarshSingh-09/RudraKernel.git
cd RudraKernel/RudraKernel-src
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -e ".[dev]"
python -m uvicorn siege_env.server.app:app --host 0.0.0.0 --port 8000 --reload
Health check:
curl http://localhost:8000/health
python frontend/app.py
python -m training.grpo_train --episodes 50 --output-dir artifacts/training
curl http://localhost:8000/env/reset
curl -X POST http://localhost:8000/env/step \
-H "Content-Type: application/json" \
-d '{"action": {"tool_name": "diagnose", "args": {"root_cause": "coordinated_misinformation_campaign", "confidence": 0.8}}}'
curl -X POST http://localhost:8000/train/start
curl http://localhost:8000/train/status
curl "http://localhost:8000/train/logs?lines=100"
curl http://localhost:8000/train/result
python -m siege_env.replay.player --help
python -m siege_env.replay.logger --help
From siege_env/server/app.py:
| Method | Endpoint | Purpose |
|---|---|---|
GET | /health | liveness |
GET | /env/reset | initialize episode and observation |
POST | /env/step | apply one action and advance environment |
GET | /env/state | inspect internal state snapshot |
POST | /train/start | start background training job |
GET | /train/status | training process status |
GET | /train/logs | tail training log |
GET | /train/result | read latest metrics |
OpenEnv manifest:
name: siege_env
version: 0.1.0
runtime:
framework: fastapi
entrypoint: siege_env.server.app:app
healthcheck: /health
RudraKernel/
├── README.md
├── IMPLEMENTATION_PLAN.md
├── openenv.yaml
└── RudraKernel-src/
├── siege_env/
│ ├── server/
│ ├── models/
│ ├── trust/
│ ├── rewards/
│ ├── mechanics/
│ ├── league/
│ ├── replay/
│ ├── incidents/
│ └── curriculum/
├── training/
├── frontend/
├── tests/
├── artifacts/
├── docs/
└── scripts/
frontend/app.py).Project docs:
RudraKernel-src/docs/ARCHITECTURE.mdRudraKernel-src/docs/REWARD_HACKING_AUDIT.mdRudraKernel-src/docs/ABLATION_RESULTS.mdRudraKernel-src/training/README.mdThis repository is organized for OpenEnv hackathon evaluation:
For judge flow, start at RudraKernel-src/frontend/app.py and RudraKernel-src/tests/master_suite.py.
86 commits
13 commits
Python
73.9%
Jupyter Notebook
18.4%
CSS
6.3%
Shell
1.1%
RudraKernel is a multi-agent RL environment for sleeper-agent detection and epistemic-failure resistance in LLM systems. It provides OpenEnv-compatible env APIs, composable ground-truth rewards (R1–R9), deterministic replay, and a Gradio analytics console for before/after evidence.
| Deliverable | Link |
|---|---|
| HF Space (Live Demo) | huggingface.co/spaces/UtkarshSingh09/RudraKernel-env |
| GitHub Repository | UtkarshSingh-09/RudraKernel |
| Training Notebook | RudraKernel-src/training/SIEGE_GRPO_Demo.ipynb |
| OpenEnv Manifest | openenv.yaml |
| Implementation Plan | IMPLEMENTATION_PLAN.md |
| Architecture Notes | RudraKernel-src/docs/ARCHITECTURE.md |
Modern AI systems increasingly rely on multi-agent collaboration: agents share observations, vote on diagnoses, and collectively decide on actions. This creates a critical vulnerability:
A single compromised agent that has built trust over time can inject false information at the worst possible moment — and the entire network believes it.
We call this an Epistemic Cascade Failure: one bad belief propagates through trust edges, corrupts coalition decisions, and pushes the system to act on a lie.
Real-world analogs:
Core SIEGE question: Can an LLM learn to challenge a high-trust liar when social consensus is misleading?
RudraKernel models a multi-agent network as an immune system:
| Biology | SIEGE |
|---|---|
| Pathogen enters body | Sleeper agent enters coalition |
| Mimics healthy behavior | Builds trust during cooperative phase |
| Immune detection | Defender spots claim-evidence inconsistency |
| Antibody response | challenge action reduces trust / blocks spread |
| Immune memory | Reputation carries across episodes |
Incident Template → 8 Agents Emit Claims → Sleeper Builds Trust
→ Triggered Adversarial Flip → Defender Diagnoses/Challenges
→ R1–R9 Reward Decomposition → GRPO Update → Replay + Metrics
Design goals:
graph TB
subgraph Frontend[Frontend — Gradio Console]
WR[Incident Command / War Room]
BA[Before-After]
AR[Training Curve / Arms Race]
end
subgraph API[Backend — FastAPI]
APP[/siege_env.server.app/]
ENV[SIEGEEnvironment]
end
subgraph Core[Core Engine]
AG[NPC Population + Pathogen Strategies]
TN[Trust Network + Reputation]
MECH[Mechanics: cascade/asymmetry/whisper/red-herring/severity]
RW[Reward Aggregator R1-R9]
RP[Replay Logger + Player]
LG[League Opponent Pool]
end
subgraph Train[Training + Eval]
T1[grpo_train.py]
T2[grpo_train_unsloth.py]
AB[Ablation Configs]
HO[Heldout Split]
end
WR --> APP
BA --> APP
AR --> APP
APP --> ENV
ENV --> AG
ENV --> TN
ENV --> MECH
ENV --> RW
ENV --> RP
ENV --> LG
T1 --> ENV
T2 --> ENV
AB --> T2
HO --> T2
sequenceDiagram
participant Env as SIEGEEnvironment
participant NPC as NPC Agents
participant Slp as Sleeper Agent
participant Def as Defender LLM
participant R as Reward Aggregator (R1-R9)
Env->>Env: reset() from incident template
Env->>NPC: Generate claims + trust context
Slp->>Def: Cooperative phase (trust gain)
Env->>Env: Trigger signal appears
Slp->>Def: Adversarial claim injection
Def->>Env: diagnose/challenge/ratify/escalate/whisper/postmortem
Env->>R: Compute grounded reward components
R-->>Env: weighted reward + component trace
Env-->>Def: next observation, done, info
diagnosechallengeratifyescalatewhisperpostmortemAll components are computed from explicit environment state and outcomes.
| # | Component | Weight | Intent |
|---|---|---|---|
| 1 | R1 Resolution | 30% | Correct root cause and decision quality |
| 2 | R2 Deception Resistance | 25% | Resist sleeper misinformation |
| 3 | R3 Detection | 20% | Catch adversarial claims with low false positives |
| 4 | R4 Trust Calibration | 10% | Align trust with reliability |
| 5 | R5 Confidence | 7% | Confidence-accuracy calibration |
| 6 | R6 Temporal Efficiency | 4% | Time-sensitive decision quality |
| 7 | R7 Postmortem | 2% | Causal and actionable retrospective quality |
| 8 | R8 Severity-Speed | 1% | Faster response under higher severity |
| 9 | R9 Correlation | 1% | Multi-signal consistency and anti-red-herring behavior |
| # | Failure Mode | Description | Measured By |
|---|---|---|---|
| 1 | Epistemic Cascade | Wrong belief spreads via trust network | R₀ proxy / spread metrics |
| 2 | Sleeper Activation | Cooperative-to-adversarial role flip | Detection timing |
| 3 | Self-Cascade | Agent reinforces own wrong claim | Self-cascade index |
| 4 | Belief Mutation | Claim morphs while propagating | Mutation/provenance traces |
Epistemic metrics tracked in replay/eval outputs include:
| Mode | Script | Purpose |
|---|---|---|
| Lightweight GRPO scaffold | RudraKernel-src/training/grpo_train.py | fast local/CI demo runs |
| Full Unsloth/TRL GRPO | RudraKernel-src/training/grpo_train_unsloth.py | GPU-based fine-tuning |
RudraKernel-src/training/configs/ablate_curriculum.yaml, ablate_trust_poisoning.yaml, ablate_whisper.yamlRudraKernel-src/training/heldout_split.pyRudraKernel-src/artifacts/training/RudraKernel-src/scripts/generate_step23_plots.py (writes to RudraKernel-src/docs/plots/)RudraKernel-src/training/SIEGE_GRPO_Demo.ipynbTest layout is organized by step gates + unit + integration + e2e + perf.
| Suite | Location |
|---|---|
| Master suite | RudraKernel-src/tests/master_suite.py |
| Step gate tests | RudraKernel-src/tests/step_tests/ |
| Unit tests | RudraKernel-src/tests/unit/ |
| Integration tests | RudraKernel-src/tests/integration/ |
| E2E and perf | RudraKernel-src/tests/e2e/, RudraKernel-src/tests/perf/ |
Common commands:
cd RudraKernel-src
# Full suite
make test-all
# Per-step gate
make test-step STEP=24
# Lint/type
make lint
# Format
make format
| Layer | Technology |
|---|---|
| Runtime | Python 3.10+, FastAPI, Uvicorn |
| Env Contract | OpenEnv (reset/step/state) |
| Data Models | Pydantic v2 |
| RL Training | TRL + Unsloth + LoRA |
| Frontend | Gradio |
| Evaluation | Pytest + deterministic replay |
| Quality | Ruff, Mypy, pre-commit |
| Packaging | pyproject.toml + editable install |
git clone https://github.com/UtkarshSingh-09/RudraKernel.git
cd RudraKernel/RudraKernel-src
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -e ".[dev]"
python -m uvicorn siege_env.server.app:app --host 0.0.0.0 --port 8000 --reload
Health check:
curl http://localhost:8000/health
python frontend/app.py
python -m training.grpo_train --episodes 50 --output-dir artifacts/training
curl http://localhost:8000/env/reset
curl -X POST http://localhost:8000/env/step \
-H "Content-Type: application/json" \
-d '{"action": {"tool_name": "diagnose", "args": {"root_cause": "coordinated_misinformation_campaign", "confidence": 0.8}}}'
curl -X POST http://localhost:8000/train/start
curl http://localhost:8000/train/status
curl "http://localhost:8000/train/logs?lines=100"
curl http://localhost:8000/train/result
python -m siege_env.replay.player --help
python -m siege_env.replay.logger --help
From siege_env/server/app.py:
| Method | Endpoint | Purpose |
|---|---|---|
GET | /health | liveness |
GET | /env/reset | initialize episode and observation |
POST | /env/step | apply one action and advance environment |
GET | /env/state | inspect internal state snapshot |
POST | /train/start | start background training job |
GET | /train/status | training process status |
GET | /train/logs | tail training log |
GET | /train/result | read latest metrics |
OpenEnv manifest:
name: siege_env
version: 0.1.0
runtime:
framework: fastapi
entrypoint: siege_env.server.app:app
healthcheck: /health
RudraKernel/
├── README.md
├── IMPLEMENTATION_PLAN.md
├── openenv.yaml
└── RudraKernel-src/
├── siege_env/
│ ├── server/
│ ├── models/
│ ├── trust/
│ ├── rewards/
│ ├── mechanics/
│ ├── league/
│ ├── replay/
│ ├── incidents/
│ └── curriculum/
├── training/
├── frontend/
├── tests/
├── artifacts/
├── docs/
└── scripts/
frontend/app.py).Project docs:
RudraKernel-src/docs/ARCHITECTURE.mdRudraKernel-src/docs/REWARD_HACKING_AUDIT.mdRudraKernel-src/docs/ABLATION_RESULTS.mdRudraKernel-src/training/README.mdThis repository is organized for OpenEnv hackathon evaluation:
For judge flow, start at RudraKernel-src/frontend/app.py and RudraKernel-src/tests/master_suite.py.
86 commits
13 commits
Python
73.9%
Jupyter Notebook
18.4%
CSS
6.3%
Shell
1.1%