Sim2Real API Reference¶
Sim2RealBridge ¶
Dual-mode bridge connecting MARL actions to the hypervisor backend.
Usage
bridge = Sim2RealBridge(mode='sim') # training default bridge = Sim2RealBridge(mode='real') # evaluation with Docker
result = bridge.dispatch('ExploitEternalBlue', '10.0.1.3', 'Windows_Server_2016') reward_delta = bridge.reward_delta(result)
Source code in netforge_rl\sim2real\bridge.py
dispatch ¶
Execute payload; auto-fallback to mock if real driver is down.
Source code in netforge_rl\sim2real\bridge.py
reward_delta ¶
Map a HypervisorResult to an immediate scalar reward delta.
This is additive on top of the scenario's standard reward — it represents additional friction from real-world exploit reliability.
Source code in netforge_rl\sim2real\bridge.py
HypervisorResult
dataclass
¶
Encapsulates the raw outcome of a payload dispatched against a target.
Both mock and real Docker drivers return this object so that the Sim2RealBridge can translate the outcome into environment reward deltas and SIEM telemetry strings in a uniform way.
Source code in netforge_rl\sim2real\hypervisor_base.py
MockHypervisor ¶
Bases: BaseHypervisor
Zero-dependency mock hypervisor for training-speed execution.
Uses a curated JSON library of authentic Metasploit stdout strings and models probabilistic success rates adjusted for target OS compatibility. No containers are spawned; all results are synthesised locally.
Source code in netforge_rl\sim2real\mock_hypervisor.py
dispatch ¶
Synthesise a realistic payload result without spawning containers.