Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

rhscope

Latest version: v0.1.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
PyPI package Publisher: rokoroks
0 Stars
0 Forks
1 Versions
Python Repo language

Scan summary

rhscope was last scanned on 29 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 29 Nov 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 29 Nov 2026 No rules fired

No rules fired in 0.1.0

Findings

Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

rhscope

License

Activation probes for reward hacking in LLM RL post-training.

rhscope trains linear probes on a base model's hidden states to detect reward hacking during RL fine-tuning, ships a sandbox-verified benchmark to evaluate those probes, and includes a probe-subspace drift detector that distinguishes genuine reform from monitor evasion.

pip install rhscope
from rhscope import HackMonitor, load_hack_examples, train_probe
from rhscope.training.trainer import load_model_for_probing

# 1. Train a probe for your base model (~5 min on a modest GPU).
model, tokenizer = load_model_for_probing("Qwen/Qwen3-1.5B")
result = train_probe(
    model, tokenizer,
    load_hack_examples("hack_examples.jsonl"),
    probe_type="dom",
    category="code_shortcut",
)
result.probe.save("my-probe")

# 2. Use it as a reward-hacking monitor during RL.
monitor = HackMonitor.from_probe(result.probe, model=model, tokenizer=tokenizer)
scores  = monitor.score_batch(prompts, completions)   # higher = more hack-like

Research - evasion vs reform

A policy trained against a probe-based reward penalty can either genuinely stop hacking (reform) or continue hacking after rotating its activation signature out of the probe's subspace (evade/obfuscate). Scalar hack-rate curves cannot tell the two apart. rhscope.research.EvasionDetector anchors a baseline probe direction, fits a fresh direction at each eval step on held-out data, and classifies the trajectory as reforming / obfuscating / stable / undecided.

Install

pip install rhscope                          # core: probes + bench
pip install "rhscope[trl]"                   # + GRPO/PPO reward-penalty integration
pip install "rhscope[dev,bench,trl]"         # development

Python 3.10+. Probe training and scoring run on whatever GPU torch can see; VRAM required scales with the base model's hidden state. All probe types train on CPU too, which is useful for small-model or heuristic-labelled smoke tests.

Plug a probe into GRPO training

from trl import GRPOTrainer
from rhscope import HackMonitor
from rhscope.integrations.trl import make_monitor_reward_fn

monitor   = HackMonitor.from_pretrained("my-probe")           # or .from_probe(probe)
reward_fn = make_monitor_reward_fn(monitor, penalty_coef=0.1).fn

trainer = GRPOTrainer(
    model=your_model,
    reward_funcs=[your_env.reward_func(), reward_fn],
    ...
)
trainer.train()

TRL sums reward-function outputs, so reward_fn returning negative values penalises hacking without subclassing the trainer or wiring custom callbacks. Watch monitor/hack_fraction in TensorBoard alongside your loss curve to catch monitor evasion before it corrupts the run.

The same pattern works with verl via rhscope.integrations.verl.MonitorRewardModel.

Probes we ship

Probe Where When to use
DoMProbe rhscope.DoMProbe Default. Difference-of-means direction with optional ZCA whitening. Trains in seconds, interpretable as a single activation direction.
LogisticProbe rhscope.LogisticProbe L2 logistic regression via torch-native L-BFGS. Stronger separator than DoM on noisier data.
MLPProbe rhscope.MLPProbe Shallow two-layer MLP with early stopping. Use when the hacking concept is non-linear in activation space.
OnlineProbe rhscope.OnlineProbe DoM probe with partial_fit for streaming RL rollouts; snapshots to a frozen DoMProbe on demand.

Choose the probe in train_probe(..., probe_type="dom" / "logistic" / "mlp").

Filter preference data for DPO / IPO / KTO

from rhscope.integrations.dpo import score_dpo_pairs

scores = score_dpo_pairs(monitor, model, tokenizer, prompts, chosen, rejected)
keep   = scores.filter_mask(drop_preference_flips=True)
clean  = [p for p, k in zip(preferences, keep) if k]

preference_flips_to_hacker flags pairs where the chosen completion scores more hack-like than the rejected one, i.e. your preference data is actively rewarding hacking.

Compose with your own detectors

rhscope ships probes. If you want to ensemble a probe with an external LLM-as-judge, a custom rule, or another team's probe, wrap your scoring function with CallableDetector and feed it to CompositeDetector:

from rhscope.bench import CallableDetector, CompositeDetector

def my_judge(prompts, responses):
    # call your judge here (OpenAI, Anthropic, Ollama, whatever)
    return scores

fused = CompositeDetector(
    [probe_detector, CallableDetector(my_judge, name="judge")],
    reducer="max",
)
monitor = HackMonitor(fused)

We do not ship built-in judge or heuristic detectors - that scope belongs to other libraries. rhscope is the probe side.

Documentation

Full docs site at 082t.github.io/rhscope. Local sources:

  • Introduction - what rhscope is, when to use it, mental model
  • Quickstart - install to first score in 10 minutes
  • Examples - five self-contained runnable scripts
  • API overview - complete public surface
  • Benchmark + Probe catalog - methodology and shipped probes
  • Related work - how rhscope positions against prior art
  • Limitations - what rhscope does NOT do in v0.1

Citation

@software{rhscope,
    title = {rhscope: activation probes for reward hacking in LLM RL post-training},
    year  = {2026},
}

License

Apache 2.0. See LICENSE.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases rhscope

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229