Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

op1: reject patches that inject off-protocol inputs (proof-forgery) - #82

Merged
bitzic merged 1 commit into
RalphLabsAI:mainfrom
karpabot:op1-exploit-scan
Jun 30, 2026
Merged

op1: reject patches that inject off-protocol inputs (proof-forgery)#82
bitzic merged 1 commit into
RalphLabsAI:mainfrom
karpabot:op1-exploit-scan

Conversation

@karpabot

Copy link
Copy Markdown

What

Adds an op1 static gate that rejects the proof-forgery class found in open recipe PRs: a miner patches train() to torch.load("/home/.../checkpoint.pt") — a model trained off-protocol, mounted on their own CC box — and fabricates the training log; or points the data dir at /mnt/.../data_50b to bypass the locked manifest. The attestation still signs (the canonical image did run the recipe — it just loaded a file), and integrity.check_checkpoint_trained passes a real-but-off-protocol checkpoint.

Seen in the wild (open recipe PRs): #586 torch.load("/home/jovyan/v10sub/checkpoint.pt") + fake final_state.json/training_log.jsonl; #344 "data_base_dir": "/mnt/scratch/SN40/data_50b".

How

proof.runner.scan_diff_for_exploit_patterns flags added patch lines that reference a host path (/home /root /mnt /media /srv /scratch /Users, ~, ..) or torch.load/np.load/… an absolute checkpoint path. Wired into:

  • validator.op1_diff_and_integrity — authoritative, rejects before any compute is spent
  • proof.runner main flow — in-container defense-in-depth

Not a complete fix

Static + evadable (a determined miner can stage inputs under a canonical mount). The authoritative defense is sealed re-eval (re-run the recipe with no external mounts and require the checkpoint to reproduce). This stops the current in-the-wild attempts and raises the bar substantially.

Tests

tests/test_restricted_scanner.py (+7): the 3 real exploit patterns + false-negative guards (lr-schedule returns, relative / /data-canonical / /tmp-cache paths, removed lines). 29 passed.

🤖 Generated with Claude Code

- scan_diff_for_exploit_patterns: flag added recipe-patch lines that
  reference a host path (/home /root /mnt /media /srv /scratch /Users,
  ~, ..) or torch.load/np.load an ABSOLUTE checkpoint path. A canonical
  recipe trains from scratch and reads only mounted canonical data.
- wired into op1_diff_and_integrity (validator-side, authoritative) and
  proof.runner main flow (in-container, defense-in-depth)
- catches the in-the-wild warm-start forgery (load an off-protocol
  checkpoint + fabricate the training log) + non-canonical data-dir
  overrides; tests include lr-schedule/relative/canonical false-neg guards
- static pre-compute gate; NOT sufficient alone — sealed re-eval is the
  authoritative fix

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bitzic
bitzic merged commit 16a9501 into RalphLabsAI:main Jun 30, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants