How rick-clinton-jpg/black-mirror works
Black Mirror contains untrusted agents behind a Linux process boundary, mediates their requests, and reflects suspicious or locked-session actions into a simulated world. Reviewers can inspect a bounded observation log and a separate tamper-evident trace; trusted host code can authorize narrowly scoped re-entry. A second product layer normalizes traces and evaluates six security invariants. The README documents this workflow and its guarantees; several implementation relationships below are omitted where the sampled source does not establish them.
Main entry points: governor_process.py Real Governor · engine.py Constitution Engine · trace.py Trace Normalizer · locket.py Locket Monitor
Components 25
Agent Containment
- Linux Boundary
mirror_world/sandbox/kernel_containment.py - Agent Runtime
mirror_world/sandbox/agent_runtime.py - Real Governor
mirror_world/sandbox/governor_process.py - Model Governor
mirror_world/sandbox/model_governor.py - Sandbox Policy
mirror_world/sandbox/policy.py - Capability Approvals
mirror_world/authorization.py - Signed Approvals
mirror_world/signed_approvals.py
Mirror Mediation
- Locket Monitor
mirror_world/sandbox/locket.py - Simulated Worlds
mirror_world/sandbox/mirror_store.py - Observation Log
mirror_world/sandbox/black_mirror.py
Audit and Invariants
- Trace Normalizer
mirror_world/trace.py - Hash Chain
mirror_world/hashchain.py - Containment State
mirror_world/state.py - Constitution Engine
mirror_world/engine.py - Authority Check
mirror_world/invariants/authority.py - Delegation Check
mirror_world/invariants/chainmail.py - Channel Check
mirror_world/invariants/channel.py - Confidentiality Check
mirror_world/invariants/confidentiality.py - Evaluator Trust Check
mirror_world/invariants/evaluator_trust.py - Mirror Weave Check
mirror_world/invariants/weave.py
Research Trials
- Trial Launcher
mirror_world/trial_launcher.py - Trial Protocol
mirror_world/trial_protocol.py - Trial Transcript
mirror_world/trial_transcript.py - Observer Trial
mirror_world/observer_trial.py
Other components
- Untrusted Agent
Connections 24
- Untrusted Agent → Linux Boundary: runs within
- Linux Boundary → Agent Runtime: contains
- Agent Runtime → Real Governor: sends requests
- Real Governor → Locket Monitor: routes through
mirror_world/sandbox/locket.py - Model Governor → Locket Monitor: mediates with
mirror_world/sandbox/model_governor.py - Model Governor → Real Governor: dispatches to
mirror_world/sandbox/model_governor.py - Real Governor → Simulated Worlds: serves mirror data
- Locket Monitor → Observation Log: records observations
mirror_world/sandbox/locket.py - Locket Monitor → Real Governor: requests execution
mirror_world/sandbox/locket.py - Real Governor → Capability Approvals: uses approvals
- Real Governor → Signed Approvals: checks signed approval
- Real Governor → Trace Normalizer: records decisions
- Trace Normalizer → Hash Chain: verifies chain
mirror_world/trace.py - Trace Normalizer → Containment State: builds graph
mirror_world/trace.py - Trace Normalizer → Constitution Engine: supplies normalized inputs
mirror_world/trace.py - Constitution Engine → Authority Check: checks authority
mirror_world/engine.py - Constitution Engine → Delegation Check: checks delegation
mirror_world/engine.py - Constitution Engine → Channel Check: checks channels
mirror_world/engine.py - Constitution Engine → Confidentiality Check: checks leakage
mirror_world/engine.py - Constitution Engine → Evaluator Trust Check: checks attribution
mirror_world/engine.py - Constitution Engine → Mirror Weave Check: checks mirror weave
mirror_world/engine.py - Trial Launcher → Trial Protocol: uses protocol
- Trial Launcher → Trial Transcript: emits transcript
- Observer Trial → Trial Launcher: observes run